Class : RealTriDiagonalSymmetricMatrix

class deriving from Matrix

RealTriDiagonalSymmetricMatrix :

prototype: RealTriDiagonalSymmetricMatrix ()

description:default constructor



RealTriDiagonalSymmetricMatrix :

prototype: RealTriDiagonalSymmetricMatrix (int , bool zero = false )

description:constructor for an empty matrix


input parameters:
dimension = matrix dimension
zero = true if matrix has to be filled with zeros



RealTriDiagonalSymmetricMatrix :

prototype: RealTriDiagonalSymmetricMatrix (double* , double* , int dimension )

description:constructor from matrix elements (without duplicating datas)


input parameters:
diagonal = pointer to diagonal element array
upperDiagonal = pointer to upper diagonal element arra
dimension = matrix dimension



RealTriDiagonalSymmetricMatrix :

prototype: RealTriDiagonalSymmetricMatrix (const RealTriDiagonalSymmetricMatrix& M )

description:copy constructor (without duplicating datas)


input parameters:
M = matrix to copy



~RealTriDiagonalSymmetricMatrix :

prototype: ~RealTriDiagonalSymmetricMatrix ()

description:destructor



operator = :

prototype: RealTriDiagonalSymmetricMatrix& operator = (const RealTriDiagonalSymmetricMatrix& M )

description:assignement (without duplicating datas)


input parameters:
M = matrix to copy


return value: reference on modified matrix



Clone :

prototype: Matrix* Clone ()

description:return pointer on a clone matrix (without duplicating datas)


input parameters:
retrun value = pointer on new matrix



SetMatrixElement :

prototype: void SetMatrixElement (int , int , double x )

description:set a matrix element


input parameters:
i = line position
j = column position
x = new value for matrix element



SetMatrixElement :

prototype: void SetMatrixElement (int , int , const Complex& x )

description:set a matrix element


input parameters:
i = line position
j = column position
x = new value for matrix element



AddToMatrixElement :

prototype: void AddToMatrixElement (int , int , double x )

description:add a value to a matrix element


input parameters:
i = line position
j = column position
x = value to add to matrix element



AddToMatrixElement :

prototype: void AddToMatrixElement (int , int , const Complex& x )

description:add a value a matrix element


input parameters:
i = line position
j = column position
x = value to add to matrix element



operator :

prototype: double& operator ( )

description:return refernce on real part of a given matrix element


input parameters:
i = line position
j = column position


return value: reference on real part



Resize :

prototype: void Resize (int , int nbrColumn )

description:Resize matrix


input parameters:
nbrRow = new number of rows
nbrColumn = new number of columns



ResizeAndClean :

prototype: void ResizeAndClean (int , int nbrColumn )

description:Resize matrix and set to zero all elements that have been added


input parameters:
nbrRow = new number of rows
nbrColumn = new number of columns



Copy :

prototype: RealTriDiagonalSymmetricMatrix& Copy (RealTriDiagonalSymmetricMatrix& M )

description:copy matrix


input parameters:
M = matrix to copy


return value: refence on current matrix



operator + :

prototype: friend RealTriDiagonalSymmetricMatrix operator + (const RealTriDiagonalSymmetricMatrix& , const RealTriDiagonalSymmetricMatrix& M2 )

description:add two matrices


input parameters:
M1 = first matrix
M2 = second matrix


return value: sum of the two matrices



operator - :

prototype: friend RealTriDiagonalSymmetricMatrix operator - (const RealTriDiagonalSymmetricMatrix& , const RealTriDiagonalSymmetricMatrix& M2 )

description:substract two matrices


input parameters:
M1 = first matrix
M2 = matrix to substract to M1


return value: difference of the two matrices



operator * :

prototype: friend RealTriDiagonalSymmetricMatrix operator * (const RealTriDiagonalSymmetricMatrix& , double x )

description:multiply a matrix by a real number (right multiplication)


input parameters:
M = source matrix
x = real number to use


return value: product result



operator * :

prototype: friend RealTriDiagonalSymmetricMatrix operator * (double , const RealTriDiagonalSymmetricMatrix& M )

description:multiply a matrix by a real number (left multiplication)


input parameters:
M = source matrix
x = real number to use


return value: product result



operator / :

prototype: friend RealTriDiagonalSymmetricMatrix operator / (const RealTriDiagonalSymmetricMatrix& , double x )

description:divide a matrix by a real number (right multiplication)


input parameters:
M = source matrix
x = real number to use


return value: division result



operator += :

prototype: RealTriDiagonalSymmetricMatrix& operator += (const RealTriDiagonalSymmetricMatrix& M )

description:add two matrices


input parameters:
M = matrix to add to current matrix


return value: reference on current matrix



operator -= :

prototype: RealTriDiagonalSymmetricMatrix& operator -= (const RealTriDiagonalSymmetricMatrix& M )

description:substract two matrices


input parameters:
M = matrix to substract to current matrix


return value: reference on current matrix



operator *= :

prototype: RealTriDiagonalSymmetricMatrix& operator *= (double x )

description:multiply a matrix by a real number


input parameters:
x = real number to use


return value: reference on current matrix



operator /= :

prototype: RealTriDiagonalSymmetricMatrix& operator /= (double x )

description:divide a matrix by a real number


input parameters:
x = real number to use


return value: reference on current matrix



GetElement :

prototype: double GetElement (int , int j )

description:get a matrix element


input parameters:
i = Row number
j = Column number


return value: matrix element M_(i,j)



DiagonalElement :

prototype: double& DiagonalElement (int i )

description:access to i-th diagonal element


input parameters:
i = position


return value: reference on i-th diagonal element



UpperDiagonalElement :

prototype: double& UpperDiagonalElement (int i )

description:access to i-th upper diagonal element


input parameters:
i = position


return value: reference on i-th upper diagonal element



Tr :

prototype: double Tr ()

description:evaluate matrix trace


input parameters:


return value: matrix trace



Det :

prototype: double Det ()

description:evaluate matrix determinant


input parameters:


return value: matrix determinant



CharacteristicEquation :

prototype: Polynomial& CharacteristicEquation ()

description:return matrix characteritic equation


input parameters:


return value: reference one polynomial corresponding to matrix characteritic equation



Diagonalize :

prototype: RealTriDiagonalSymmetricMatrix& Diagonalize (int maxIter = 50 )

description:Diagonalize RealTridiagonal Symmetric Matrix using QL algorithm with implicit shift
current matrix is replaced by its corresponding diagonalized matrix


input parameters:
maxIter = maximum number of iteration to fund an eigenvalue


return value: reference on current Matrix



Diagonalize :

prototype: RealTriDiagonalSymmetricMatrix& Diagonalize (ComplexMatrix& , int maxIter = 50 )

description:Diagonalize RealTridiagonal Symmetric Matrix using QL algorithm with implicit shift, evaluating eigenvectors in a given base
current matrix is replaced by its corresponding diagonalized matrix


input parameters:
Q = matrix initialized with corresponding base in which eigenvectors have to be calculated
maxIter = maximum number of iteration to fund an eigenvalue


return value: reference on current Matrix



Diagonalize :

prototype: RealTriDiagonalSymmetricMatrix& Diagonalize (RealMatrix& , int maxIter = 50 )

description:Diagonalize RealTridiagonal Symmetric Matrix using QL algorithm with implicit shift, evaluating eigenvectors in a given base
current matrix is replaced by its corresponding diagonalized matrix


input parameters:
Q = matrix initialized with corresponding base in which eigenvectors have to be calculated
maxIter = maximum number of iteration to fund an eigenvalue


return value: reference on current Matrix



QRFactorization :

prototype: RealUpperTriangularMatrix QRFactorization (RealMatrix& Q )

description:find QR factorization


input parameters:
Q = matrix initialized with corresponding base in which unitary matrix of QR factorization has to be calculated


return value: upper triangular matrix corresponding to the QR factorization of the matrix



QLFactorization :

prototype: RealLowerTriangularMatrix QLFactorization (RealMatrix& Q )

description:find QL factorization


input parameters:
Q = matrix initialized with corresponding base in which unitary matrix of QR factorization has to be calculated


return value: lower triangular matrix corresponding to the QL factorization of the matrix



QLFactorization :

prototype: RealLowerTriangularMatrix QLFactorization (RealMatrix& , double shift )

description:find QL factorization with shift (aka M - x 1)


input parameters:
Q = matrix initialized with corresponding base in which unitary matrix of QR factorization has to be calculated
shift = shift value


return value: lower triangular matrix corresponding to the QL factorization of the matrix



QLConjugaison :

prototype: RealTriDiagonalSymmetricMatrix QLConjugaison (RealMatrix& Q )

description:find QL factorization and evaluate LQ (ie Qt H Q)


input parameters:
Q = matrix initialized with corresponding base in which unitary matrix of QR factorization has to be calculated


return value: Qt H Q



QLConjugaison :

prototype: RealTriDiagonalSymmetricMatrix QLConjugaison (RealMatrix& , double shift )

description:find QL factorization and evaluate LQ (ie Qt H Q), shifting initial matrix diagonal elements and shifting back after evaluating RQ


input parameters:
Q = matrix initialized with corresponding base in which unitary matrix of QR factorization has to be calculated
shift = shift value


return value: Qt H Q



ConjugateQR :

prototype: RealTriDiagonalSymmetricMatrix ConjugateQR (RealMatrix& , double shift )

description:find QR factorization and evaluate RQ (ie Qt H Q), shifting initial matrix diagonal elements and shifting back after evaluating RQ


input parameters:
Q = matrix initialized with corresponding base in which unitary matrix of QR factorization has to be calculated
shift = shift value


return value: Qt H Q



PolynomialFilterWithExactShift :

prototype: RealTriDiagonalSymmetricMatrix PolynomialFilterWithExactShift (RealMatrix& , double* , int nbrShift )

description:apply polynomial filter assumuing shifts are exacte shift (i.e. eigenvalues of the initial matrix)


input parameters:
Q = unitary matrix encoding the transformation
shift = array of shift values
nbrShift = number of shifts


return value: filtered matrix stored as [[H 0], [0 D]] where D is a diagonal matrix with shifts as element and H a real tridiagonal matrix



Eigenvector :

prototype: RealVector& Eigenvector (double , RealVector& eigenvector )

description:evaluate a normalized eigenvector for a given eigenvalue (supposing the eigenvalue is non-degenerate)


input parameters:
eigenvalue = eigenvalue to use
eigenvector = vector where the eigenvector has to be stored


return value: reference on eigenvector



Eigenvector :

prototype: ComplexVector& Eigenvector (double , ComplexVector& eigenvector )

description:evaluate a normalized eigenvector for a given eigenvalue (supposing the eigenvalue is non-degenerate)


input parameters:
eigenvalue = eigenvalue to use
eigenvector = vector where the eigenvector has to be stored


return value: reference on eigenvector



SortMatrixUpOrder :

prototype: RealTriDiagonalSymmetricMatrix& SortMatrixUpOrder ()

description:Sort Matrix such that diagnonal elements are sort in increasing order (offdiagonal elements left unchanged)


input parameters:


return value: reference on current Matrix



SortMatrixUpOrder :

prototype: RealTriDiagonalSymmetricMatrix& SortMatrixUpOrder (RealMatrix& matrix )

description:Sort Matrix such that diagnonal elements are sort in increasing order (offdiagonal elements left unchanged)
and apply corresponding transformation to column of a given real matrix


input parameters:
matrix = matrix on which transformation has to be applied


return value: reference on current Matrix



SortMatrixUpOrder :

prototype: RealTriDiagonalSymmetricMatrix& SortMatrixUpOrder (ComplexMatrix& matrix )

description:Sort Matrix such that diagnonal elements are sort in increasing order (offdiagonal elements left unchanged)
and apply corresponding transformation to column of a given complex matrix


input parameters:
matrix = matrix on which transformation has to be applied


return value: reference on current Matrix



SortMatrixDownOrder :

prototype: RealTriDiagonalSymmetricMatrix& SortMatrixDownOrder ()

description:Sort Matrix such that diagnonal elements are sort in decreasing order (offdiagonal elements left unchanged)


input parameters:


return value: reference on current Matrix



SortMatrixDownOrder :

prototype: RealTriDiagonalSymmetricMatrix& SortMatrixDownOrder (RealMatrix& matrix )

description:Sort Matrix such that diagnonal elements are sort in decreasing order (offdiagonal elements left unchanged)
and apply corresponding transformation to column of a given real matrix


input parameters:
matrix = matrix on which transformation has to be applied


return value: reference on current Matrix



SortMatrix :

prototype: RealTriDiagonalSymmetricMatrix& SortMatrix (ComplexMatrix& Q )

description:Sort Matrix such that diagnonal elements are sort in increasing order and apply corresponding transformation to column
of a given complex matrix (offdiagonal elements left unchanged)


input parameters:
Q = matrix on which transformation has to be applied


return value: reference on current Matrix



operator << :

prototype: friend ostream& operator << (ostream& , const RealTriDiagonalSymmetricMatrix& P )

description:Output Stream overload


input parameters:
Str = reference on output stream
P = matrix to print


return value: reference on output stream



operator << :

prototype: friend MathematicaOutput& operator << (MathematicaOutput& , const RealTriDiagonalSymmetricMatrix& P )

description:Mathematica Output Stream overload


input parameters:
Str = reference on Mathematica output stream
P = matrix to print


return value: reference on output stream



Back to index.