Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - Русский

Please note that the recommended version of Scilab is 6.0.2. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Sparses Matrix > Sparse Decompositions > spchol

spchol

疎行列コレスキー分解

呼び出し手順

[R,P] = spchol(X)

引数

X

対称正定実疎行列

P

順列行列

R

コレスキー分解

説明

[R,P] = spchol(X) は, P*R*R'*P' = Xとなるような 上三角行列R を出力します.

// Factorization:
Xfull = [
3.,  0.,  0.,  2.,  0.,  0.,  2.,  0.,  2.,  0.,  0.
0.,  5.,  4.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.
0.,  4.,  5.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.
2.,  0.,  0.,  3.,  0.,  0.,  2.,  0.,  2.,  0.,  0.
0.,  0.,  0.,  0. , 5.,  0.,  0.,  0.,  0.,  0.,  4.
0.,  0.,  0.,  0.,  0.,  4.,  0.,  3.,  0.,  3.,  0.
2.,  0.,  0.,  2.,  0.,  0.,  3.,  0.,  2.,  0.,  0.
0.,  0.,  0.,  0.,  0.,  3.,  0.,  4.,  0.,  3.,  0.
2.,  0.,  0.,  2.,  0.,  0.,  2.,  0.,  3.,  0.,  0.
0.,  0.,  0.,  0.,  0.,  3.,  0.,  3.,  0.,  4.,  0.
0.,  0.,  0.,  0.,  4.,  0.,  0.,  0.,  0.,  0.,  5.];
X = sparse(Xfull);

[R, P] = spchol(X);
max(P*R*R'*P'-X)

// Factorization and solve with backslash operator:
Afull = [
2 -1  0  0  0;
-1  2 -1  0  0;
0 -1  2 -1  0;
0  0 -1  2 -1;
0  0  0 -1  2
];
A = sparse(Afull);

[L, P] = spchol(A);
max(P*L*L'*P'-A)

n = size(A, "r"); e = (1:n)'; b = A * e;
x = P*(L'\(L\(P'*b)));
A*x-b

参照

  • sparse — 疎行列を定義
  • lusolve — 疎な線形システムの解を得る
  • luget — 疎行列LU分解の展開
  • chol — コレスキー分解
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:10:30 CET 2017