=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/builtin/array.texi,v retrieving revision 1.4 retrieving revision 1.5 diff -u -p -r1.4 -r1.5 --- OpenXM/src/asir-doc/parts/builtin/array.texi 2000/11/13 00:16:36 1.4 +++ OpenXM/src/asir-doc/parts/builtin/array.texi 2002/08/08 05:24:37 1.5 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/array.texi,v 1.3 2000/02/05 12:01:09 takayama Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/array.texi,v 1.4 2000/11/13 00:16:36 noro Exp $ \BJP @node 配列,,, 組み込み函数 @section 配列 @@ -14,7 +14,7 @@ * vtol:: * newmat:: * size:: -* det:: +* det invmat:: * qsort:: @end menu @@ -337,7 +337,7 @@ return to toplevel @table @t \JP @item 参照 \EG @item References -@fref{newvect}, @fref{size}, @fref{det}. +@fref{newvect}, @fref{size}, @fref{det invmat}. @end table \JP @node size,,, 配列 @@ -405,21 +405,25 @@ in a rational expression. @fref{car cdr cons append reverse length}, @fref{nmono}. @end table -\JP @node det,,, 配列 -\EG @node det,,, Arrays -@subsection @code{det} +\JP @node det invmat,,, 配列 +\EG @node det invmat,,, Arrays +@subsection @code{det},@code{invmat} @findex det +@findex invmat @table @t @item det(@var{mat}[,@var{mod}]) \JP :: @var{mat} の行列式を求める. \EG :: Determinant of @var{mat}. +@item invmat(@var{mat}) +\JP :: @var{mat} の行列式を求める. +\EG :: Inverse matrix of @var{mat}. @end table @table @var @item return -\JP 式 -\EG expression +\JP @code{det}: 式, @code{invmat}: リスト +\EG @code{det}: expression, @code{invmat}: list @item mat \JP 行列 \EG matrix @@ -431,7 +435,9 @@ in a rational expression. @itemize @bullet \BJP @item -行列 @var{mat} の行列式を求める. +@code{det} は行列 @var{mat} の行列式を求める. +@code{invmat} は行列 @var{mat} の逆行列を求める. 逆行列は @code{[分母, 分子]} +の形で返され, @code{分母}が行列, @code{分母/分子} が逆行列となる. @item 引数 @var{mod} がある時, GF(@var{mod}) 上での行列式を求める. @item @@ -440,7 +446,10 @@ in a rational expression. \E \BEG @item -Determinant of matrix @var{mat}. +@code{det} computes 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. @item The computation is done over GF(@var{mod}) if @var{mod} is specitied. @item @@ -464,6 +473,24 @@ is more efficient than the fraction free Gaussian algo [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]] +[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; +[ 1 x x^2 ] +[ 1 y y^2 ] +[ 1 z z^2 ] +[99] invmat(A); +[[ -z*y^2+z^2*y z*x^2-z^2*x -y*x^2+y^2*x ] +[ y^2-z^2 -x^2+z^2 x^2-y^2 ] +[ -y+z x-z -x+y ],(-y+z)*x^2+(y^2-z^2)*x-z*y^2+z^2*y] +[100] A*B[0]; +[ (-y+z)*x^2+(y^2-z^2)*x-z*y^2+z^2*y 0 0 ] +[ 0 (-y+z)*x^2+(y^2-z^2)*x-z*y^2+z^2*y 0 ] +[ 0 0 (-y+z)*x^2+(y^2-z^2)*x-z*y^2+z^2*y ] +[101] map(red,A*B[0]/B[1]); +[ 1 0 0 ] +[ 0 1 0 ] +[ 0 0 1 ] @end example @table @t