Scilab-Branch-5.3-GIT
- Scilab help
- Linear Algebra
- aff2ab
- balanc
- bdiag
- chfact
- chol
- chsolve
- classmarkov
- cmb_lin
- coff
- colcomp
- companion
- cond
- det
- eigenmarkov
- ereduc
- expm
- fstair
- fullrf
- fullrfk
- genmarkov
- givens
- glever
- gschur
- gspec
- hess
- householder
- im_inv
- inv
- kernel
- kroneck
- linsolve
- lsq
- lu
- lyap
- nlev
- orth
- pbig
- pencan
- penlaur
- pinv
- polar
- proj
- projspec
- psmall
- qr
- quaskro
- randpencil
- range
- rank
- rankqr
- rcond
- rowcomp
- rowshuff
- rref
- schur
- spaninter
- spanplus
- spantwo
- spec
- sqroot
- squeeze
- sva
- svd
- sylv
- trace
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
linsolve
線形方程式ソルバ
呼び出し手順
[x0,kerA]=linsolve(A,b [,x0])
パラメータ
- A
a
na x ma
実数行列 (疎行列の場合もあり)- b
na x 1
ベクトル (A
の行と同じ次元)- x0
実数ベクトル
- kerA
ma x k
実数行列
説明
linsolve
は,
A*x+b=0
の解を全て計算します.
x0
は特解 (存在する場合),
kerA
はA
のヌル空間です.
任意のw
についてx=x0+kerA*w
は,
A*x+b=0
を満たします.
互換性のある x0
がエントリに指定された場合, x0
が返されます.
そうでない場合,x0
と互換性のあるもの(存在する場合)が返されます.
例
A=rand(5,3)*rand(3,8); b=A*ones(8,1);[x,kerA]=linsolve(A,b);A*x+b //compatible b b=ones(5,1);[x,kerA]=linsolve(A,b);A*x+b //uncompatible b A=rand(5,5);[x,kerA]=linsolve(A,b), -inv(A)*b //x is unique // Benchmark with other linear sparse solver: [A,descr,ref,mtype] = ReadHBSparse(SCI+"/modules/umfpack/examples/bcsstk24.rsa"); b = 0*ones(size(A,1),1); tic(); res = umfpack(A,'\',b); printf('\ntime needed to solve the system with umfpack: %.3f\n',toc()); tic(); res = linsolve(A,b); printf('\ntime needed to solve the system with linsolve: %.3f\n',toc()); tic(); res = A\b; printf('\ntime needed to solve the system with the backslash operator: %.3f\n',toc());
参照
<< kroneck | Linear Algebra | lsq >> |