Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

UTRRealMatrix Class Reference

#include <Matrix.h>

Inheritance diagram for UTRRealMatrix:

Matrix< Real, UpperTriangular< Real > > UpperTriangular< Real > List of all members.

Detailed Description

Real upper triangular matrix. Index base for rows and columns must be equal. To make the subscripting operator as fast as possible it is limited to access elements on or above the diagonal (where the marix is known to be zero). Out of bounds error below the diagonal

Subscripting speed is crucial. For this reason upper triangular matrices often stand in for symmetric matrices which have a slower subscripting operator. The upper triangular matrix then represents the symmetric matrix of which it is the upper half. This expalains why we implement operations for upper triangular matrics which make sense for symmetric matrices (eigen value analysis, pseudo square roots,...).

Definition at line 1335 of file Matrix.h.

Public Member Functions

 UTRRealMatrix (int d, int b=0)
template<int n>  UTRRealMatrix (Real A[n][n], int b=0)
RealMatrixsymmetricCompletion () const
UTRRealMatrix & inverse () const
LTRRealMatrixltrRoot () const
UTRRealMatrix & utrRoot () const
RealMatrixrankReducedRoot (int r) const
UTRRealMatrix & exp () const
RealMatrixmatrixFunction (Real(*f)(Real))
void analyseFactors (int r) const
void testFactorization (int r, string message="") const

Constructor & Destructor Documentation

UTRRealMatrix::UTRRealMatrix int    d,
int    b = 0

Constructor, initializes all components with zeroes.

d dimension of square matrix
b index base: b<=i,j<b+d

Definition at line 1343 of file Matrix.h.

References Matrix< Real, UpperTriangular< Real > >::b, and Real.

template<int n>
UTRRealMatrix::UTRRealMatrix Real    A[n][n],
int    b = 0

Construct from data array, only upper triangular half is used.

A data array
b index base (default 0).

Definition at line 1351 of file Matrix.h.

References Matrix< Real, UpperTriangular< Real > >::b, and Real.

Member Function Documentation

RealMatrix& UTRRealMatrix::symmetricCompletion   const

The symmetric matrix of which this is the upper half. Return by value is deliberate.

UTRRealMatrix& UTRRealMatrix::inverse   const

The matrix inverse. This is upper triangular of the same size.

LTRRealMatrix& UTRRealMatrix::ltrRoot   const

Cholesky root L (lower triangular, LL'=A where A is the symmetric matrix with upper half this). Terminates with error message if this is not positive definite.

UTRRealMatrix& UTRRealMatrix::utrRoot   const

Upper triangular root U of A, where A is the symmetric matrix of which this) is the upper half. Satisfies UU'=A. Differs from the Cholesky root as it is upper triangular instead of lower triangular. Terminates with error message if this is not positive definite.

RealMatrix& UTRRealMatrix::rankReducedRoot int    r const

Let C be the symmetric matrix with upper half this. This function computes the matrix R which best approximates D as a product RR' and has rank r. The matrix R is computed by diagonalizing D, setting all but the r largest eigenvalues equal to zero and taking the square root of the remaining eigenvalues.

The row index base remains the same, columns of the root are indexed from zero.

UTRRealMatrix& UTRRealMatrix::exp   const

Matrix exponential.

Reimplemented from Matrix< Real, UpperTriangular< Real > >.

RealMatrix& UTRRealMatrix::matrixFunction Real(*    f)(Real)

Computes the function f(A) of the symmetric matrix A of which this is the upper half. The matrix funtion f(A) is computed as follows: diagonalize A as

is the diagonal matrix with the eigenvalues of A on the diagonal the columns of U are associated eigenvectors. Set (f is applied to each eigenvalue). Then

void UTRRealMatrix::analyseFactors int    r const

Matrix is interpreted as the upper half of a multinormal covariance matrix. This method prints how much variability is captured by the r largest eigenvalues of C.

void UTRRealMatrix::testFactorization int    r,
string    message = ""

Let C be the symmetric matrix with upper half this. C must be positive semidefinite. Computes the best approximate factorization , where R has rank r and returns the relative error in the trace norm

message put test in context.

The documentation for this class was generated from the following file:
Generated on Mon Sep 22 02:16:33 2003 for Libor-Library by doxygen1.3-rc3