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.
|
| rootpm_schur_newton(A,p)
|
function [X,Y] = rootpm_schur_newton(A,p)
%ROOTPM_SCHUR_NEWTON Matrix pth root by Schur-Newton method.
% [X,Y] = ROOTPM_SCHUR_NEWTON(A,p) computes the principal pth root
% X of the real matrix A using the Schur-Newton algorithm.
% It also returns Y = INV(X).
if norm(imag(A),1), error('A must be real.'), end
A = real(A); % Discard any zero imaginary part.
[Q,R] = schur(A,'real'); % Quasitriangular R.
e = eig(R);
if any (e(find(e == real(e))) < 0 )
error('A has a negative real eigenvalue: principal pth root not defined')
end
f = factor(p);
k0 = length(find(f == 2)); % Number of factors 2.
q = p/2^(k0);
k1 = k0;
if q > 1
emax = max(abs(e)); emin = min(abs(e));
if emax > emin % Avoid log(0).
k1 = max(k1, ceil( log2( log2(emax/emin) ) ));
end
max_arg = norm(angle(e),inf);
if max_arg > pi/8
k3 = 1;
if max_arg > pi/2
k3 = 3;
elseif max_arg > pi/4
k3 = 2;
end
k1 = max(k1,k3);
end
end
for i = 1:k1, R = sqrtm_real(R); end
if q ~= 1
pw = 2^(-k1); emax = emax^pw; emin = emin^pw;
if ~any(imag(e))
% Real eigenvalues.
if emax > emin
alpha = emax/emin;
c = ( (alpha^(1/q)*emax-emin)/( (alpha^(1/q)-1)*(q+1) ) )^(1/q);
else
c = emin^(1/q);
end
else
% Complex eigenvalues.
c = (( emax+emin)/2 )^(1/q);
end
X = rootpm_newton(R,q,c);
for i = 1:k1-k0
X = X*X;
end
else
X = R;
end
Y = Q*(X\Q'); % Return inverse pth root, too.
X = Q*X*Q';
|
|
Contact us at files@mathworks.com