| [nm,n,b,dl,m,z]=rebakb(nm,n,b,dl,m,z); |
function [nm,n,b,dl,m,z]=rebakb(nm,n,b,dl,m,z);
%***BEGIN PROLOGUE REBAKB
%***PURPOSE Form the eigenvectors of a generalized symmetric
% eigensystem from the eigenvectors of derived matrix output
% from REDUC2.
%***LIBRARY SLATEC (EISPACK)
%***CATEGORY D4C4
%***TYPE SINGLE PRECISION (REBAKB-S)
%***KEYWORDS EIGENVALUES, EIGENVECTORS, EISPACK
%***AUTHOR Smith, B. T., et al.
%***DESCRIPTION
%
% This subroutine is a translation of the ALGOL procedure REBAKB,
% NUM. MATH. 11, 99-110(1968) by Martin and Wilkinson.
% HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 303-314(1971).
%
% This subroutine forms the eigenvectors of a generalized
% SYMMETRIC eigensystem by back transforming those of the
% derived symmetric matrix determined by REDUC2.
%
% On Input
%
% NM must be set to the row dimension of the two-dimensional
% array parameters, B and Z, as declared in the calling
% program dimension statement. NM is an INTEGER variable.
%
% N is the order of the matrix system. N is an INTEGER
% variable. N must be less than or equal to NM.
%
% B contains information about the similarity transformation
% (Cholesky decomposition) used in the reduction by REDUC2
% in its strict lower triangle. B is a two-dimensional
% REAL array, dimensioned B(NM,N).
%
% DL contains further information about the transformation.
% DL is a one-dimensional REAL array, dimensioned DL(N).
%
% M is the number of eigenvectors to be back transformed.
% M is an INTEGER variable.
%
% Z contains the eigenvectors to be back transformed in its
% first M columns. Z is a two-dimensional REAL array
% dimensioned Z(NM,M).
%
% On Output
%
% Z contains the transformed eigenvectors in its first
% M columns.
%
% Questions and comments should be directed to B. S. Garbow,
% APPLIED MATHEMATICS DIVISION, ARGONNE NATIONAL LABORATORY
% ------------------------------------------------------------------
%
%***REFERENCES B. T. Smith, J. M. Boyle, J. J. Dongarra, B. S. Garbow,
% Y. Ikebe, V. C. Klema and C. B. Moler, Matrix Eigen-
% system Routines - EISPACK Guide, Springer-Verlag,
% 1976.
%***ROUTINES CALLED (NONE)
%***REVISION HISTORY (YYMMDD)
% 760101 DATE WRITTEN
% 890831 Modified array declarations. (WRB)
% 890831 REVISION DATE from Version 3.2
% 891214 Prologue converted to Version 4.0 format. (BAB)
% 920501 Reformatted the REFERENCES section. (WRB)
%***end PROLOGUE REBAKB
%
persistent i i1 ii j k x ;
if isempty(i), i=0; end;
if isempty(j), j=0; end;
if isempty(k), k=0; end;
if isempty(i1), i1=0; end;
if isempty(ii), ii=0; end;
b_shape=size(b);b=reshape([b(:).',zeros(1,ceil(numel(b)./prod([nm])).*prod([nm])-numel(b))],nm,[]);
dl_shape=size(dl);dl=reshape(dl,1,[]);
z_shape=size(z);z=reshape([z(:).',zeros(1,ceil(numel(z)./prod([nm])).*prod([nm])-numel(z))],nm,[]);
if isempty(x), x=0; end;
%
%***FIRST EXECUTABLE STATEMENT REBAKB
if( m~=0 )
%
for j = 1 : m;
% .......... FOR I=N STEP -1 UNTIL 1 DO -- ..........
for ii = 1 : n;
i1 = fix(n - ii);
i = fix(i1 + 1);
x = dl(i).*z(i,j);
if( i~=1 )
%
for k = 1 : i1;
x = x + b(i,k).*z(k,j);
end; k = fix(i1+1);
end;
%
z(i,j) = x;
end; ii = fix(n+1);
end; j = fix(m+1);
end;
%
b_shape=zeros(b_shape);b_shape(:)=b(1:numel(b_shape));b=b_shape;
dl_shape=zeros(dl_shape);dl_shape(:)=dl(1:numel(dl_shape));dl=dl_shape;
z_shape=zeros(z_shape);z_shape(:)=z(1:numel(z_shape));z=z_shape;
end
%DECK REBAK
|
|