数式処理システム
asir は OpenXM プロトコル
(Open message eXchange for Mathematics, http://www.openxm.org)
をサポートしたサーバを
コンポーネントとして利用できる.
これらのサーバを呼ぶためのインタフェース関数はファイル
`OpenXM/rc/asirrc' をロードすることによりシステムに読み込まれる.
Risa/Asir (OpenXM 配布版) では起動時に自動的にこのファイルが読まれる.
Risa/Asir (OpenXM 配布版) は, このマニュアルでは
OpenXM/Risa/Asir と呼ぶ.
このマニュアルでは asir 用のこれらの関数
およびユーザ言語で書かれた数学関数およびユーティリティ関数を説明する.
OpenXM プロトコルの技術的詳細については,
`$(OpenXM_HOME)/doc/OpenXM-specs' にあるファイル
`openxm-jp.tex'
を見て下さい.
それでは, あなたの計算機上で数学をお楽しみ下さい.
List of contributors:
この Contrib パッケージの
著作権については, OpenXM/Copyright
を見て下さい.
有用だとおもいますが無保証です.
`OpenXM/rc/asirrc'
をロードすることにより Asir/Contrib の主な関数が利用可能となる.
OpenXM/Risa/Asir では ASIR_CONFIG 環境変数により
このファイルを起動時に読みこんでいる.
`names.rr' が Asir/Contrib のトップレベルのファイルである.
このファイルよりその他のファイルが読み込まれている.
一部のパッケージは `names.rr' からは読み込まれないので,
明示的に読み込む必要がある.
A sample of `asirrc' to use Asir/Contrib.
load("gr")$
load("primdec")$
load("katsura")$
load("bfct")$
load("names.rr")$
load("oxrfc103.rr")$
User_asirrc=which(getenv("HOME")+"/.asirrc")$
if (type(User_asirrc)!=0) {
if (!ctrl("quiet_mode")) print("Loading ~/.asirrc")$
load(User_asirrc)$
}else{ }$
end$
Asir Contrib には
(1) 標準的な名前で定義された数学函数 (names.rr
および
(2) Asir 標準函数以外の有用なライブラリ函数
および
(3) OpenXM サーバを asir から呼ぶための函数
が含まれている.
Asir Contrib の函数名はモジュール化されているかまたは次の形をしている:
カテゴリ名_函数名
標準的な数学函数は実体へのラッパーである.
たとえば
sm1.hilbert は OpenXM サーバ sm1 の
Hilbert 函数の計算函数を呼び出す函数である.
一方 poly_hilbert_polynomial は Asir Contrib の
Hilbert 函数を計算するための (1) に属する標準的な函数名である.
標準函数 poly_hilbert_polynomial は,
現在 sm1.hilbert を呼び出して Hilbert 函数を計算しているが,
これは将来変更されるかもしれない.
たとえば, Asir 言語で記述された有用なライブラリ函数集
commutativeRing.rr が開発されて
Hilbert 函数の計算函数
commutativeRing_hilbert_polynomial が含まれるようになったら,
標準函数 poly_hilbert_polynomial は,
commutativeRing_hilbert_polynomial を呼び出して
Hilbert 函数を計算するようになるかもしれない.
したがって, ユーザプログラムは標準数学函数名を用いるのが望ましい.
標準数学函数名は, OpenXM project において, 全てのプロジェクトで共通の
仕様を持つように努力している.
たとえば, kan/k0 も Asir Contrib と同様の標準数学函数名を持つ
予定である.
現在実験的に数学函数のカテゴリ complex 複体 (複素数でない)
のマニュアルを kan/k0, asir/contrib で共通化を試みている.
以下の章は, 標準数学函数の解説をおこない, それから ライブラリ函数, それから, OpenXM サーバのインタフェースの説明を おこなう.
Windows でも不完全ながら asir-contrib が動作する. 現在, 外部コンポーネント sm1 および, 外部 コンポーネント を利用しない asir-contrib の関数が動作する. Cygwin 環境では外部コンポーネント sm1, phc が動作する. その他の外部コンポーネントは動作しない.
次の関数は Windows では動作しない. Windows での cygwin 環境では動作する場合がある.
gnuplot.*
om.*
mathematica.*
phc.*
print_dvi_form
print_gif_form
print_open_math_xml_form
print_png_form
print_xdvi_form
print_xv_form
tigers_xv_form
base_cancelExample:
base_cancel([(x-1)/(x^2-1), (x-1)/(x^3-1)]);
base_chooseExample:
base_choose([1,2,3],2);
base_flattenExample:
base_flatten([[1,2,3],4]);
base_intersectionExample:
base_intersection([1,2,3],[2,3,5,[6,5]]);
base_memberqExample:
base_memberq(2,[1,2,3]);
base_permutationExample:
base_permutation([1,2,3,4]);
base_positionExample:
base_position("cat",["dog","cat","monkey"]);
base_pruneExample:
base_prune("cat",["dog","cat","monkey"]);
base_replaceExample:
base_replace(x^2+y^2,[[x,a+1],[y,b]]);
x is replaced by a+1 and y is replaced by b in x^2+y^2.
base_replace_nExample:
base_replace_n(x^2+y^2,[[x,1/2],[y,2.0+3*@i]]);
x is replaced by 1/2 and y is replaced by 2.0+3*@i in x^2+y^2.
base_set_minusExample:
base_set_minus([1,2,3],[3,4,5]);
base_set_unionExample:
base_set_union([1,2,3],[3,4,5]);
base_subsetqExample:
base_subsetq([1,2],[1,2,3,4,5]);
base_subsets_of_sizeExample:
base_subsets_of_size(2,[3,5,3,2]);
number_absExample:
number_abs(-3);@end example
number_ceiling
Example:
number_abs(1.5);@end example
number_factor
Example:
number_factor(20);@end example
number_floor
Example:
number_floor(1.5);@end example
number_imaginary_part
Example:
number_imaginary_part(1+2*@i);@end example
number_is_integer
Example:
number_is_integer(2/3);@end example
number_real_part
Example:
number_real_part(1+2*@i);@end example微積分(標準数学函数)
級数(標準数学函数)
特殊函数(標準数学函数)
まだ書いてない.
行列(標準数学函数)
matrix_cloneExample:
matrix_clone(matrix_list_to_matrix([[1,1],[0,1]]));
matrix_detExample:
poly_factor(matrix_det([[1,x,x^2],[1,y,y^2],[1,z,z^2]]));
matrix_diagonal_matrixExample:
matrix_diagonal_matrix([1,2,3]);
References:
matrix_list_to_matrix
matrix_eigenavaluesExample:
matrix_eigenvalues([[x,1],[0,y]]);
matrix_identity_matrixExample:
matrix_identity_matrix(5);
References:
matrix_diagonal_matrix
matrix_imageExample:
matrix_image([[1,2,3],[2,4,6],[1,0,0]]);
References:
matrix_kernel
matrix_inner_productExample:
matrix_inner_product([1,2],[x,y]);
matrix_inverseExample:
matrix_inverse([[1,2],[0,1]]);
matrix_kernelExample:
matrix_kernel([[1,1,1,1],[0,1,3,4]]);
matrix_list_to_matrixExample:
print_xdvi_form(matrix_list_to_matrix([[1,1],[0,2]]));
References:
matrix_matrix_to_list
matrix_matrix_to_listReferences:
matrix_list_to_matrix
matrix_rankExample:
matrix_rank([[1,1,1,1],[0,1,3,4]]);
matrix_solve_linearExample:
matrix_solve_linear([[1,2],[0,1]],[x,y],[1,2]);
matrix_submatrixExample:
matrix_submatrix([[0,1],[2,3],[4,5]],[1,2]);
matrix_transposeReferences:
matrix_list_to_matrix
まだ書いてない.
print_dvi_formExample:
print_dvi_form(x^2-1);
References:
print_xdvi_form,print_tex_form
print_emExample:
print_em(x^2-1);
print_gif_formExample:
print_gif_form(newmat(2,2,[[x^2,x],[y^2-1,x/(x-1)]]));
References:
print_tex_form
print_input_formExample:
print_input_form(quote(x^3-1));
print_open_math_tfb_formDescription:
It is experimental. You need to load taka_print_tfb.rr to call it.
Example:
print_open_math_tfb_form(quote(f(x,1/(y+1))+2));
print_open_math_xml_formExample:
print_open_math_xml_form(x^3-1);
References:
www.openmath.org
print_outputExample:
print_output("Hello"|file="test.txt");
References:
glib_tops,(,)
print_ox_rfc100_xml_formExample:
print_ox_rfc100_xml_form(x^3-1);
References:
www.openxm.org
print_png_formExample:
print_png_form(x^3-1);
References:
print_tex_form
print_terminal_formprint_tex_formDescription:
The global variable Print_tex_form_fraction_format takes the values "auto", "frac", or "/". The global variable Print_tex_form_no_automatic_subscript takes the values 0 or 1. BUG; A large input S cannot be translated.
Example:
print_tex_form(x*dx+1 | table=[["dx","\\partial_x"]]);
The optional variable table is used to give a translation table of asir symbols and tex symbols.
References:
print_xdvi_form
print_tfb_formExample:
print_tfb_form(x+1);
print_xdvi_formExample 0:
print_xdvi_form(newmat(2,2,[[x^2,x],[y^2-1,x/(x-1)]]));
Example 1:
print_xdvi_form(print_tex_form(1/2));
References:
print_tex_form,print_dvi_form
print_xv_formExample 0:
print_xv_form(newmat(2,2,[[x^2,x],[y^2-1,x/(x-1)]]));
Example 1:
print_xv_form(x+y | format="png");
If the optional variable format="png" is set, png format will be used to generate an input for xv.
References:
print_tex_form,print_gif_form
poly_degreeDescription:
The weight is given by the optional variable weight w. It returns
Example:
poly_degree(x^2+y^2-4 |weight=[100,1],v=[x,y]);
poly_elimination_idealDescription:
If grobner_basis is "yes", I is assumed to be a Grobner basis. The optional variable v is a list of variables which defines the ring of polynomials.
Example 0:
poly_elimination_ideal([x^2+y^2-4,x*y-1],[x]);
Example 1:
A = poly_grobner_basis([x^2+y^2-4,x*y-1]|order=2,v=[y,x]);
poly_elimination_ideal(A,[x]|grobner_basis="yes");
References:
gr,hgr,gr_mod,dp_*
poly_expandReferences:
poly_sort
poly_factorExample:
poly_factor(x^10-y^10);
poly_gcdExample:
poly_gcd(x^10-y^10,x^25-y^25);
poly_grobner_basisDescription:
The optional variable v is a list of variables which defines the ring of polynomials.
Example:
A = poly_grobner_basis([x^2+y^2-4,x*y-1]|order=2,v=[y,x]);
poly_hilbert_polynomialDescription:
The optional variable v is a list of variables.
Example:
poly_hilbert_polynomial([x1*y1,x1*y2,x2*y1,x2*y2]|s=k,v=[x1,x2,y1,y2]);
poly_initialDescription:
The optional variable v is a list of variables. This function computes
Example:
poly_initial([x^2+y^2-4,x*y-1]|order=0,v=[x,y]);
poly_initial_coefficientsDescription:
The optional variable v is a list of variables. The order is specified by the optional variable order
Example:
poly_initial_coefficients([x^2+y^2-4,x*y-1]|order=0,v=[x,y]);
poly_initial_termDescription:
The weight is given by the optional variable weight w. It returns
Example:
poly_initial_term( x^2+y^2-4 |weight=[100,1],v=[x,y]);
poly_solve_linearExample:
poly_solve_linear([2*x+3*y-z-2, x+y+z-1], [x,y,z]);
poly_sortExample:
poly_sort((x-y-a)^3 | v=[x,y], w=[-1,-1])
returns a series expansion in terms of x and y.
ライブラリ glib は, Risa/Asir の グラフィック基本関数 (draw_obj) に対する, 昔の BASIC のような単純なインタフェースを提供する.
glib_clearglib_flushglib_lineExample:
glib_line(0,0,5,3/2 | color=0xff00ff);
glib_line(0,0,10,0 | shape=arrow);
glib_openglib_plotExample 0:
glib_plot([[0,1],[0.1,0.9],[0.2,0.7],[0.3,0.5],[0.4,0.8]]);
Example 1:
glib_plot(tan(x));
glib_printExample:
glib_print(100,100,"Hello Worlds" | color=0xff0000);
glib_ps_formExample 0:
glib_ps_form(quote( glib_line(0,0,100,100) ));
Example 1:
glib_ps_form(quote([glib_line(0,0,100,100),glib_line(100,0,0,100)]));
References:
glib_tops
glib_putpixelExample:
glib_putpixel(1,2 | color=0xffff00);
glib_remove_lastglib_set_pixel_sizeglib_topsReferences:
print_output
glib_windowExample:
glib_window(-1,-1,10,10);
ox_check_errors2[219] P=sm1.start(); 0 [220] sm1.sm1(P," 0 get "); 0 [221] ox_check_errors2(P); [error([7,4294967295,executeString: Usage:get])] Error on the server of the process number = 1 To clean the stack of the ox server, type in ox_pops(P,N) (P: process number, N: the number of data you need to pop) out of the debug mode. If you like to automatically clean data on the server stack, set XM_debug=0;
OXshell はシステムのコマンドを ox server より実行する仕組みである. 詳しくは OpenXM/src/kan96xx/Doc/oxshell.oxw および OpenXM/doc/Papers/rims-2003-12-16-ja.tex を見よ.
oxshell.get_valueExample:
oxshell.set_value("abc","Hello world!");
oxshell.oxshell(["cp", "stringIn://abc", "stringOut://result"]);
oxshell.get_value("result");
References:
oxshell.oxshell,oxshell.set_value
oxshell.oxshellExample:
oxshell.oxshell(["ls"]);
References:
ox_shell,oxshell.set_value,oxshell.get_value
oxshell.set_valueExample:
oxshell.set_value("abc","Hello world!");
oxshell.oxshell(["cat", "stringIn://abc"]);
References:
oxshell.oxshell,oxshell.get_value
システムの資源にアクセスするためおよび文字列処理の便利な関数を集めてある.
util_filterExample:
util_filter("sort","cat\ndog\ncentipede\n");
util_find_and_replaceutil_find_substrutil_indexExample:
util_index(x_2_3)
References:
util_v
util_load_file_as_a_stringutil_partutil_read_file_as_a_stringutil_remove_crutil_timingExample:
util_timing( quote( fctr(x^50-y^50) ));
util_vExample:
util_v("x",[1,3]);
References:
util_index
util_write_string_to_a_fileこの節では asir-contrib のその他のマニュアルを紹介する.
それからまだ分類がおわっていない関数を解説する. これらの関数は将来は別の独立した節へ移す予定である.
../ok_diff-html/ok_diff-ja.html
../ok_dmodule-html/ok_dmodule-ja.html
../plucker-html/plucker-ja.html
../gnuplot-html/gnuplot-ja.html
../mathematica-html/mathematica-ja.html
../mk_graph-html/mk_graph-ja.html
../noro_mwl-html/noro_mwl-ja.html
../nn_ndbf-html/nn_ndbf-ja.html
../todo_parametrize-html/todo_parametrize-ja.html
パッケージ todo_parametrize/todo_parametrize.rr をロードすることにより,
有理曲線のパラメータ表示を見付ける関数である,
paramerize が利用できるようになる.
詳しくは See section `概要' in Risa/Asir 代数曲線論用パッケージ説明書 を見よ
(Web 版 Risa/Asir 代数曲線論用パッケージ説明書).
このパッケージのマニュアルへの統合はまだできていない.
このパッケージはまだ module 構造を利用していないので, 既存のライブラリと
名前の衝突の可能性がある.
[1205] load("todo_parametrize/todo_parametrize.rr");
1
[1425] parametrize(y^2-x^3);
[155*t^2+20*t+1,720*t^4+1044*t^3+580*t^2,155*t^4+20*t^3+t^2,(-x)/(y)]
[1426] parametrize(y^2+x^3);
[-t,1,t^3,(-x)/(y)]
../taji_alc-html/taji_alc-ja.html
パッケージ taji_alc.rr をロードすることにより,
一変数代数的コホモロジ群に関連する関数をロードできる.
(Web 版 Risa/Asir 一変数代数的局所コホモロジー類に関する Risa/Aisr パッケージ説明書).
import("taji_alc.rr");
taji_alc.laurent_expansion(x,(x-1)^3);
OpenXM documents. には texinfo で書かれていない asir-contrib のファイルや関数のマニュアル, および 関連論文へのリンクがある.
(yang, fj_curve, nk_mora 等)
Jump to: b - g - m - n - o - p - u
@vfill @eject
This document was generated on 13 February 2010 using texi2html 1.56k.