No BSD License
-
arnoldi(A,q1,m)
ARNOLDI Arnoldi iteration
-
ascent_seq(A)
ASCENT_SEQ Ascent sequence for square (singular) matrix.
-
cosm(A)
COSM Matrix cosine by double angle algorithm.
-
cosm_pade(A,m,sq)
COSM_PADE Evaluate Pade approximation to the matrix cosine.
-
cosmsinm(A)
COSMSINM Matrix cosine and sine by double angle algorithm.
-
cosmsinm_pade(A,m)
COSMSINM_PADE Evaluate Pade approximations to matrix cosine and sine.
-
expm_cond(A)
EXPM_COND Relative condition number of matrix exponential.
-
expm_frechet_pade(A,E,k)
EXPM_FRECHET_PADE Frechet derivative of matrix exponential via Pade approx.
-
expm_frechet_quad(A,E,theta,r...
EXPM_FRECHET_QUAD Frechet derivative of matrix exponential via quadrature.
-
fab_arnoldi(A,b,fun,m)
FAB_ARNOLDI f(A)*b approximated by Arnoldi method.
-
funm_condest1(A,fun,fun_frech...
FUNM_CONDEST1 Estimate of 1-norm condition number of matrix function.
-
funm_condest_fro(A,fun,fun_fr...
FUNM_CONDEST_FRO Estimate of Frobenius norm condition number of matrix function.
-
funm_ev(A,fun)
FUNM_EV Evaluate general matrix function via eigensystem.
-
funm_simple(A,fun)
FUNM_SIMPLE Simplified Schur-Parlett method for function of a matrix.
-
logm_cond(A)
LOGM_COND Relative condition number of matrix logarithm.
-
logm_frechet_pade(A,E)
LOGM_FRECHET_PADE Frechet derivative of matrix logarithm via Pade approx.
-
logm_iss(A)
LOGM_ISS Matrix logarithm by inverse scaling and squaring method.
-
logm_pade_pf(A,m)
LOGM_PADE_PF Evaluate Pade approximant to matrix log by partial fractions.
-
mft_test(n)
MFT_TEST Test the Matrix Function Toolbox.
-
mft_tolerance(A)
MFT_TOLERANCE Convergence tolerance for matrix iterations.
-
polar_newton(A)
POLAR_NEWTON Polar decomposition by scaled Newton iteration.
-
polar_svd(A)
POLAR_SVD Canonical polar decomposition via singular value decomposition.
-
polyvalm_ps(c,A,s)
POLYVALM_PS Evaluate polynomial at matrix argument by Paterson-Stockmeyer alg.
-
power_binary(A,m)
POWER_BINARY Power of matrix by binary powering (repeated squaring).
-
quasitriang_struct(R)
QUASITRIANG_STRUCT Block structure of upper quasitriangular matrix.
-
riccati_xaxb(A,B)
RICCATI_XAXB Solve Riccati equation XAX = B in positive definite matrices.
-
rootpm_newton(A,p,c)
ROOTPM_NEWTON Coupled Newton iteration for matrix pth root.
-
rootpm_real(A,p)
ROOTPM_REAL Pth root of real matrix via real Schur form.
-
rootpm_schur_newton(A,p)
ROOTPM_SCHUR_NEWTON Matrix pth root by Schur-Newton method.
-
rootpm_sign(A,p)
ROOTPM_SIGN Matrix Pth root via matrix sign function.
-
signm(A)
SIGNM Matrix sign decomposition.
-
signm_newton(A,scal)
SIGNM_NEWTON Matrix sign function by Newton iteration.
-
sqrtm_db(A,scale)
SQRTM_DB Matrix square root by Denman-Beavers iteration.
-
sqrtm_dbp(A,scale)
SQRTM_DBP Matrix square root by product form of Denman-Beavers iteration.
-
sqrtm_newton(A,scal,maxit)
SQRTM_NEWTON Matrix square root by Newton iteration (unstable).
-
sqrtm_newton_full(A, X0)
SQRTM_NEWTON_FULL Matrix square root by full Newton method.
-
sqrtm_pd(A)
SQRTM_PD Square root of positive definite matrix via polar decomposition.
-
sqrtm_pulay(A,D)
SQRTM_PULAY Matrix square root by Pulay iteration.
-
sqrtm_real(A)
SQRTM_REAL Square root of real matrix by real Schur method.
-
sqrtm_triang_min_norm(T)
SQRTM_TRIANG_MIN_NORM Estimated min norm square root of triangular matrix.
-
sylvsol(A,B,C)
SYLVSOL Solve Sylvester equation.
-
Contents.m
-
readme.m
-
View all files
from
The Matrix Function Toolbox
by Nick Higham
A MATLAB toolbox connected with functions of matrices.
|
| sqrtm_pulay(A,D)
|
function [X,k] = sqrtm_pulay(A,D)
%SQRTM_PULAY Matrix square root by Pulay iteration.
% [X,K] = SQRTM_PULAY(A,D) computes the principal square root of the
% matrix A using the Pulay iteration with diagonal matrix D
% (default: D = DIAG(DIAG(A))). D must have positive diagonal entries.
% K is the number of iterations.
% Note: this iteration is linearly converent and converges only when
% SQRTM(D) sufficiently well approximates SQRTM(A).
if nargin < 2, D = diag(diag(A)); end
if any(diag(D)<0) || ~isreal(D)
error('D must have positive, real diagonal.')
end
n = length(A);
dhalf = sqrt(diag(D));
Dhalf = diag(dhalf);
B = zeros(n);
maxit = 50;
tol = mft_tolerance(A);
for k = 1:maxit
Bold = B;
B = (A - D - Bold^2) ./ (dhalf(:,ones(1,n)) + dhalf(:,ones(1,n))');
X = Dhalf + B;
reldiff = norm(B - Bold,inf)/norm(X,inf);
if reldiff <= tol, return, end
end
error('Not converged after %2.0f iterations', maxit)
|
|
Contact us at files@mathworks.com