=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/builtin/array.texi,v retrieving revision 1.11 retrieving revision 1.15 diff -u -p -r1.11 -r1.15 --- OpenXM/src/asir-doc/parts/builtin/array.texi 2009/03/24 08:00:50 1.11 +++ OpenXM/src/asir-doc/parts/builtin/array.texi 2011/12/09 05:18:41 1.15 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/array.texi,v 1.10 2005/02/10 04:59:21 noro Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/array.texi,v 1.14 2011/12/09 05:13:52 nisiyama Exp $ \BJP @node 配列,,, 組み込み函数 @section 配列 @@ -14,8 +14,10 @@ * vtol:: * newbytearray:: * newmat matrix:: +* mat matr matc:: * size:: * det nd_det invmat:: +* rowx rowm rowa colx colm cola:: * qsort:: @end menu @@ -167,7 +169,7 @@ separated simply by a `blank space', while those of a @table @t \JP @item 参照 \EG @item References -@fref{newmat}, @fref{size}, @fref{ltov}, @fref{vtol}. +@fref{newmat matrix}, @fref{size}, @fref{ltov}, @fref{vtol}. @end table \JP @node ltov,,, 配列 @@ -213,7 +215,7 @@ See also @code{newvect()}. @table @t \JP @item 参照 \EG @item References -@fref{newvect}, @fref{vtol}. +@fref{newvect vector vect}, @fref{vtol}. @end table \JP @node vtol,,, 配列 @@ -263,7 +265,7 @@ A conversion from a list to a vector is done by @code{ @table @t \JP @item 参照 \EG @item References -@fref{newvect}, @fref{ltov}. +@fref{newvect vector vect}, @fref{ltov}. @end table \JP @node newbytearray,,, 配列 @@ -319,7 +321,7 @@ similar to that of @code{newvect}. @table @t \JP @item 参照 \EG @item References -@fref{newvect}. +@fref{newvect vector vect}. @end table \JP @node newmat matrix,,, 配列 @@ -412,9 +414,70 @@ return to toplevel @table @t \JP @item 参照 \EG @item References -@fref{newvect}, @fref{size}, @fref{det nd_det invmat}. +@fref{newvect vector vect}, @fref{size}, @fref{det nd_det invmat}. @end table +\JP @node mat matr matc,,, 配列 +\EG @node mat matr matc,,, Arrays +@subsection @code{mat}, @code{matr}, @code{matc} +@findex mat +@findex matr +@findex matc + +@table @t +@item mat(@var{vector}[,...]) +@item matr(@var{vector}[,...]) +\JP :: 行ベクトルの並びから行列を生成する. +\EG :: Creates a new matrix by list of row vectors. +@item matc(@var{vector}[,...]) +\JP :: 列ベクトルの並びから行列を生成する. +\EG :: Creates a new matrix by list of column vectors. +@end table + +@table @var +@item return +\JP 行列 +\EG matrix +@item @var{vector} +\JP 配列またはリスト +\EG array or list +@end table + +@itemize @bullet +\BJP +@item +@code{mat} は @code{matr} の別名である. +@item +引数の各ベクトルは同じ長さをもつ. +各要素は, 先頭から順に使われ, 足りない分は 0 が埋められる. +\E +\BEG +@item +@code{mat} is an alias of @code{matr}. +@item +Each vector has same length. +Elements are used from the first through the last. +If the list is short, 0's are filled in the remaining matrix elements. +\E +@end itemize + +@example +[0] matr([1,2,3],[4,5,6],[7,8]); +[ 1 2 3 ] +[ 4 5 6 ] +[ 7 8 0 ] +[1] matc([1,2,3],[4,5,6],[7,8]); +[ 1 4 7 ] +[ 2 5 8 ] +[ 3 6 0 ] +@end example + +@table @t +\JP @item 参照 +\EG @item References +@fref{newmat matrix} +@end table + \JP @node size,,, 配列 \EG @node size,,, Arrays @subsection @code{size} @@ -517,8 +580,8 @@ in a rational expression. \BJP @item @code{det} および @code{nd_det} は行列 @var{mat} の行列式を求める. -@code{invmat} は行列 @var{mat} の逆行列を求める. 逆行列は @code{[分母, 分子]} -の形で返され, @code{分母}が行列, @code{分母/分子} が逆行列となる. +@code{invmat} は行列 @var{mat} の逆行列を求める. 逆行列は @code{[分子, 分母]} +の形で返され, @code{分子}が行列, @code{分子/分母} が逆行列となる. @item 引数 @var{mod} がある時, GF(@var{mod}) 上での行列式を求める. @item @@ -587,7 +650,7 @@ and it computes the determinant faster than @code{det} @table @t \JP @item 参照 \EG @item References -@fref{newmat}. +@fref{newmat matrix}. @end table \JP @node qsort,,, 配列 @@ -656,4 +719,86 @@ are exchanged. \JP @item 参照 \EG @item References @fref{ord}, @fref{vars}. +@end table + +\JP @node rowx rowm rowa colx colm cola,,, 配列 +\EG @node rowx rowm rowa colx colm cola,,, Arrays +@subsection @code{rowx}, @code{rowm}, @code{rowa}, @code{colx}, @code{colm}, @code{cola} +@findex rowx +@findex rowm +@findex rowa +@findex colx +@findex colm +@findex cola + +@table @t +@item rowx(@var{matrix},@var{i},@var{j}) +\JP :: 第 @var{i} 行と第 @var{j} 行を交換する. +\EG :: Exchanges the @var{i}-th and @var{j}-th rows. +@item rowm(@var{matrix},@var{i},@var{c}) +\JP :: 第 @var{i} 行を @var{c} 倍する. +\EG :: Multiplies the @var{i}-th row by @var{c}. +@item rowa(@var{matrix},@var{i},@var{c}) +\JP :: 第 @var{i} 行に第 @var{i} 行の @var{c} 倍を加える. +\EG :: Appends @var{c} times the @var{j}-th row to the @var{j}-th row. +@item colx(@var{matrix},@var{i},@var{j}) +\JP :: 第 @var{i} 行と第 @var{j} 行を交換する. +\EG :: Exchanges the @var{i}-th and @var{j}-th columns. +@item colm(@var{matrix},@var{i},@var{c}) +\JP :: 第 @var{i} 行を @var{c} 倍する. +\EG :: Multiplies the @var{i}-th column by @var{c}. +@item cola(@var{matrix},@var{i},@var{c}) +\JP :: 第 @var{i} 行に第 @var{i} 行の @var{c} 倍を加える. +\EG :: Appends @var{c} times the @var{j}-th column to the @var{j}-th column. +@end table + +@table @var +@item return +\JP 行列 +\EG matrix +@item @var{i}, @var{j} +\JP 整数 +\EG integers +@item @var{c} +\JP 係数 +\EG coefficient +@end table + +@itemize @bullet +\BJP +@item +行列の基本変形を行うための関数である. +@item +行列が破壊されることに注意する. +\E +\BEG +@item +These operations are destructive for the matrix. +\E +@end itemize + +@example +[0] A=newmat(3,3,[[1,2,3],[4,5,6],[7,8,9]]); +[ 1 2 3 ] +[ 4 5 6 ] +[ 7 8 9 ] +[1] rowx(A,1,2)$ +[2] A; +[ 1 2 3 ] +[ 7 8 9 ] +[ 4 5 6 ] +[3] rowm(A,2,x); +[ 1 2 3 ] +[ 7 8 9 ] +[ 4*x 5*x 6*x ] +[4] rowa(A,0,1,z); +[ 7*z+1 8*z+2 9*z+3 ] +[ 7 8 9 ] +[ 4*x 5*x 6*x ] +@end example + +@table @t +\JP @item 参照 +\EG @item References +@fref{newmat matrix} @end table