⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pd_check.m

📁 模式识别工具箱,本人毕业论文时用到的,希望对大家有用!
💻 M
字号:
%function posdef = pd_check( a)% golub version of cholesky, with nonpos. test% input: a  ... sym. matrix% output: posdef% call: posdef = pd_check( a)% posdef = 1 if a is safely pos.def, ie each diag > tol in chol.faktor% otherwise posdef = 0;[n, n1] = size( a); posdef = 0; tol = 1e-15;for j = 1:n        if j > 1,        a( j:n,j) = a( j:n,j) - a( j:n,1:j-1) * a(j, 1:j-1)';        end;        if a(j,j) < tol, return, end;        a( j:n,j) = a( j:n,j) / sqrt( a(j,j) );end;posdef = 1;   %G = tril( a);  this could be used as cholesky factor

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -