=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/builtin/array.texi,v retrieving revision 1.10 retrieving revision 1.12 diff -u -p -r1.10 -r1.12 --- OpenXM/src/asir-doc/parts/builtin/array.texi 2005/02/10 04:59:21 1.10 +++ OpenXM/src/asir-doc/parts/builtin/array.texi 2009/03/24 08:21:45 1.12 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/array.texi,v 1.9 2003/12/18 10:26:20 ohara Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/array.texi,v 1.11 2009/03/24 08:00:50 ohara Exp $ \BJP @node 配列,,, 組み込み函数 @section 配列 @@ -9,26 +9,33 @@ \E @menu -* newvect:: +* newvect vector vect:: * ltov:: * vtol:: * newbytearray:: -* newmat:: +* newmat matrix:: +* mat matr matc:: * size:: * det nd_det invmat:: * qsort:: @end menu -\JP @node newvect,,, 配列 -\EG @node newvect,,, Arrays -@subsection @code{newvect} +\JP @node newvect vector vect,,, 配列 +\EG @node newvect vector vect,,, Arrays +@subsection @code{newvect}, @code{vector}, @code{vect} @findex newvect +@findex vector +@findex vect @table @t @item newvect(@var{len}[,@var{list}]) +@item vector(@var{len}[,@var{list}]) \JP :: 長さ @var{len} のベクトルを生成する. \EG :: Creates a new vector object with its length @var{len}. +@item vect([@var{elements}]) +\JP :: @var{elements} を要素とするベクトルを生成する. +\EG :: Creates a new vector object by @var{elements}. @end table @table @var @@ -41,12 +48,19 @@ @item list \JP リスト \EG list +@item elements +\JP 要素の並び +\EG elements of the vector @end table @itemize @bullet \BJP @item -長さ @var{len} のベクトルを生成する. 第 2 引数がない場合, +@code{vect} は要素の並びからベクトルを生成する. +@item +@code{vector} は @code{newvect} の別名である. +@item +@code{newvect} は長さ @var{len} のベクトルを生成する. 第 2 引数がない場合, 各成分は 0 に初期化される. 第 2 引数がある場合, インデックスの小さい成分から, リストの 各要素により初期化される. 各要素は, 先頭から順に @@ -72,8 +86,12 @@ を書き換えることができる. \E \BEG +@item +@code{vect} creates a new vector object by its elements. +@item +@code{vector} is an alias of @code{newvect}. @item -Creates a new vector object with its length @var{len} and its elements +@code{newvect} creates a new vector object with its length @var{len} and its elements all cleared to value 0. If the second argument, a list, is given, the vector is initialized by the list elements. @@ -137,16 +155,20 @@ separated simply by a `blank space', while those of a [5,6] [4] size(A); [5] -[5] def afo(V) @{ V[0] = x; @} -[6] afo(A)$ -[7] A; +[5] length(A); +5 +[6] vect(1,2,3,4,[5,6]); +[ 1 2 3 4 [5,6] ] +[7] def afo(V) @{ V[0] = x; @} +[8] afo(A)$ +[9] A; [ x 2 3 4 [5,6] ] @end example @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,,, 配列 @@ -192,7 +214,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,,, 配列 @@ -242,7 +264,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,,, 配列 @@ -298,16 +320,18 @@ similar to that of @code{newvect}. @table @t \JP @item 参照 \EG @item References -@fref{newvect}. +@fref{newvect vector vect}. @end table -\JP @node newmat,,, 配列 -\EG @node newmat,,, Arrays -@subsection @code{newmat} +\JP @node newmat matrix,,, 配列 +\EG @node newmat matrix,,, Arrays +@subsection @code{newmat}, @code{matrix} @findex newmat +@findex matrix @table @t @item newmat(@var{row},@var{col} [,[[@var{a},@var{b},...],[@var{c},@var{d},...],...]]) +@item matrix(@var{row},@var{col} [,[[@var{a},@var{b},...],[@var{c},@var{d},...],...]]) \JP :: @var{row} 行 @var{col} 列の行列を生成する. \EG :: Creates a new matrix with @var{row} rows and @var{col} columns. @end table @@ -327,6 +351,8 @@ similar to that of @code{newvect}. @itemize @bullet \BJP @item +@code{matrix} は @code{newmat} の別名である. +@item @var{row} 行 @var{col} 列の行列を生成する. 第 3 引数がない場合, 各成分は 0 に初期化される. 第 3 引数がある場合, インデックスの小さい成分から, 各行が, リストの @@ -343,6 +369,8 @@ similar to that of @code{newvect}. を書き換えることができる. \E \BEG +@item +@code{matrix} is an alias of @code{newmat}. @item If the third argument, a list, is given, the newly created matrix is initialized so that each element of the list (again a list) @@ -385,9 +413,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} @@ -459,8 +548,9 @@ in a rational expression. \JP @node det nd_det invmat,,, 配列 \EG @node det nd_det invmat,,, Arrays -@subsection @code{det},@code{invmat} +@subsection @code{det}, @code{nd_det}, @code{invmat} @findex det +@findex nd_det @findex invmat @table @t @@ -559,7 +649,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,,, 配列