view mftoolbox/sqrtm_pd.m @ 7:e0817ccb2834 draft

Add square root matrix function file, rename atom at funm_files, modify old toolbox to run it inside GNU Octave. added funm_files/fun_atom.m added sqrtm2.m added toolbox/gecp.m toolbox/see.m: comment wrong call to subplot toolbox/tmtdemo.m: add a cast to double, as eig does not admit bool matrix input removed funm_files/funm_atom.m
author Antonio Pino Robles <data.script93@gmail.com>
date Tue, 26 May 2015 18:14:54 +0200
parents 8f23314345f4
children
line wrap: on
line source

function [X,k] = sqrtm_pd(A)
%SQRTM_PD    Square root of positive definite matrix via polar decomposition.
%   [X,K] = SQRT_PD(A) computes the Hermitian positive definite
%   square root X of the Hermitian positive definite matrix A.
%   It computes the Hermitian polar factor of the Cholesky factor of A.
%   K is the number of Newton polar iterations used.

R = chol(A);
[U,H,k] = polar_newton(R);
X = H;