=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/builtin/array.texi,v retrieving revision 1.6 retrieving revision 1.10 diff -u -p -r1.6 -r1.10 --- OpenXM/src/asir-doc/parts/builtin/array.texi 2003/04/19 15:44:58 1.6 +++ OpenXM/src/asir-doc/parts/builtin/array.texi 2005/02/10 04:59:21 1.10 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/array.texi,v 1.5 2002/08/08 05:24:37 noro Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/array.texi,v 1.9 2003/12/18 10:26:20 ohara Exp $ \BJP @node 配列,,, 組み込み函数 @section 配列 @@ -10,11 +10,13 @@ @menu * newvect:: -* newbytearray:: +* ltov:: * vtol:: +* newbytearray:: * newmat:: * size:: -* det invmat:: +* det nd_det invmat:: + * qsort:: @end menu @@ -144,9 +146,55 @@ separated simply by a `blank space', while those of a @table @t \JP @item 参照 \EG @item References -@fref{newmat}, @fref{size}, @fref{vtol}. +@fref{newmat}, @fref{size}, @fref{ltov}, @fref{vtol}. @end table +\JP @node ltov,,, 配列 +\EG @node ltov,,, Arrays +@subsection @code{ltov} +@findex ltov + +@table @t +@item ltov(@var{list}) +\JP :: リストをベクトルに変換する. +\EG :: Converts a list into a vector. +@end table + +@table @var +@item return +\JP ベクトル +\EG vector +@item list +\JP リスト +\EG list +@end table + +@itemize @bullet +\BJP +@item +リスト @var{list} を同じ長さのベクトルに変換する. +@item +この関数は @code{newvect(length(@var{list}), @var{list})} に等しい. +\E +\BEG +@item +Converts a list @var{list} into a vector of same length. +See also @code{newvect()}. +\E +@end itemize + +@example +[3] A=[1,2,3]; +[4] ltov(A); +[ 1 2 3 ] +@end example + +@table @t +\JP @item 参照 +\EG @item References +@fref{newvect}, @fref{vtol}. +@end table + \JP @node vtol,,, 配列 \EG @node vtol,,, Arrays @subsection @code{vtol} @@ -194,7 +242,7 @@ A conversion from a list to a vector is done by @code{ @table @t \JP @item 参照 \EG @item References -@fref{newvect}. +@fref{newvect}, @fref{ltov}. @end table \JP @node newbytearray,,, 配列 @@ -337,7 +385,7 @@ return to toplevel @table @t \JP @item 参照 \EG @item References -@fref{newvect}, @fref{size}, @fref{det invmat}. +@fref{newvect}, @fref{size}, @fref{det nd_det invmat}. @end table \JP @node size,,, 配列 @@ -371,9 +419,11 @@ or a list containing row size and column size of the g @itemize @bullet \BJP @item -@var{vect} 又は, @var{mat} のサイズをリストで出力する. +@var{vect} の長さ, または @var{mat} の大きさをリストで出力する. @item -@var{list} のサイズは @code{length()}を, 有理式に現れる単項式の数は @code{nmono()} を用いる. +@var{vect} の長さは @code{length()} で求めることもできる. +@item +@var{list} の長さは @code{length()}を, 有理式に現れる単項式の数は @code{nmono()} を用いる. \E \BEG @item @@ -392,10 +442,12 @@ in a rational expression. [ 0 0 0 0 ] [1] size(A); [4] -[2] B = newmat(2,3,[[1,2,3],[4,5,6]]); +[2] length(A); +4 +[3] B = newmat(2,3,[[1,2,3],[4,5,6]]); [ 1 2 3 ] [ 4 5 6 ] -[3] size(B); +[4] size(B); [2,3] @end example @@ -405,18 +457,19 @@ in a rational expression. @fref{car cdr cons append reverse length}, @fref{nmono}. @end table -\JP @node det invmat,,, 配列 -\EG @node det invmat,,, Arrays +\JP @node det nd_det invmat,,, 配列 +\EG @node det nd_det invmat,,, Arrays @subsection @code{det},@code{invmat} @findex det @findex invmat @table @t @item det(@var{mat}[,@var{mod}]) +@itemx nd_det(@var{mat}[,@var{mod}]) \JP :: @var{mat} の行列式を求める. \EG :: Determinant of @var{mat}. @item invmat(@var{mat}) -\JP :: @var{mat} の行列式を求める. +\JP :: @var{mat} の逆行列を求める. \EG :: Inverse matrix of @var{mat}. @end table @@ -435,7 +488,7 @@ in a rational expression. @itemize @bullet \BJP @item -@code{det} は行列 @var{mat} の行列式を求める. +@code{det} および @code{nd_det} は行列 @var{mat} の行列式を求める. @code{invmat} は行列 @var{mat} の逆行列を求める. 逆行列は @code{[分母, 分子]} の形で返され, @code{分母}が行列, @code{分母/分子} が逆行列となる. @item @@ -443,10 +496,15 @@ in a rational expression. @item 分数なしのガウス消去法によっているため, 多変数多項式を成分とする 行列に対しては小行列式展開による方法のほうが効率がよい場合もある. +@item +@code{nd_det} は有理数または有限体上の多項式行列の行列式 +計算専用である. アルゴリズムはやはり分数なしのガウス消去法だが, +データ構造および乗除算の工夫により, 一般に @code{det} より高速に +計算できる. \E \BEG @item -@code{det} computes the determinant of matrix @var{mat}. +@code{det} and @code{nd_det} compute the determinant of matrix @var{mat}. @code{invmat} computes the inverse matrix of matrix @var{mat}. @code{invmat} returns a list @code{[num,den]}, where @code{num} is a matrix and @code{num/den} represents the inverse matrix. @@ -456,6 +514,11 @@ The computation is done over GF(@var{mod}) if @var{mod The fraction free Gaussian algorithm is employed. For matrices with multi-variate polynomial entries, minor expansion algorithm sometimes is more efficient than the fraction free Gaussian algorithm. +@item +@code{nd_det} can be used for computing the determinant of a matrix with +polynomial entries over the rationals or finite fields. The algorithm +is an improved vesion of the fraction free Gaussian algorithm +and it computes the determinant faster than @code{det}. \E @end itemize @@ -471,8 +534,8 @@ is more efficient than the fraction free Gaussian algo [ 1 u u^2 u^3 u^4 ] [ 1 v v^2 v^3 v^4 ] [95] fctr(det(A)); -[[1,1],[u-v,1],[-z+v,1],[-z+u,1],[-y+u,1],[y-v,1],[-y+z,1],[-x+u,1],[-x+z,1], -[-x+v,1],[-x+y,1]] +[[1,1],[u-v,1],[-z+v,1],[-z+u,1],[-y+u,1],[y-v,1],[-y+z,1],[-x+u,1], +[-x+z,1],[-x+v,1],[-x+y,1]] [96] A = newmat(3,3)$ [97] for(I=0;I<3;I++)for(J=0,B=A[I],W=V[I];J<3;J++)B[J]=W^J; [98] A;