Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. 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 — コレスキー分解
Report an issue
<< lusolve Sparse Decompositions Linear Equations (Iterative Solvers) >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 15:02:13 CET 2019