casacore
Public Member Functions | List of all members
casacore::MatrixMathLA_global_functions_Linear_Algebra Struct Reference

More...

#include <MatrixMathLA.h>

Public Member Functions

template<class T >
void invert (Matrix< T > &out, T &determinate, const Matrix< T > &in)
 Routines which calculate the inverse of a matrix. More...
 
template<class T >
Matrix< T > invert (const Matrix< T > &in)
 
template<class T >
determinate (const Matrix< T > &in)
 
template<class T >
void invertSymPosDef (Matrix< T > &out, T &determinate, const Matrix< T > &in)
 This function inverts a symmetric positive definite matrix. More...
 
template<class T >
Matrix< T > invertSymPosDef (const Matrix< T > &in)
 

Detailed Description

Linear algebra functions on Vectors and Matrices.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tLinAlgebra


Definition at line 52 of file MatrixMathLA.h.

Member Function Documentation

◆ determinate()

template<class T >
T casacore::MatrixMathLA_global_functions_Linear_Algebra::determinate ( const Matrix< T > &  in)

◆ invert() [1/2]

template<class T >
Matrix<T> casacore::MatrixMathLA_global_functions_Linear_Algebra::invert ( const Matrix< T > &  in)

◆ invert() [2/2]

template<class T >
void casacore::MatrixMathLA_global_functions_Linear_Algebra::invert ( Matrix< T > &  out,
T &  determinate,
const Matrix< T > &  in 
)

Routines which calculate the inverse of a matrix.

The inverse is very often the worst way to do a calculation. Nevertheless it is often convenient. The present implementation uses LU decomposition implemented by LAPACK. The determinate can be calculated "for free" as it is the product of the diagonal terms after decomposition. If the input matrix is singular, a matrix with no rows or columns is returned. in must be a square matrix.

Warning: This function will only work for complex types if Complex and DComplex map onto their FORTRAN counterparts;

◆ invertSymPosDef() [1/2]

template<class T >
Matrix<T> casacore::MatrixMathLA_global_functions_Linear_Algebra::invertSymPosDef ( const Matrix< T > &  in)

◆ invertSymPosDef() [2/2]

template<class T >
void casacore::MatrixMathLA_global_functions_Linear_Algebra::invertSymPosDef ( Matrix< T > &  out,
T &  determinate,
const Matrix< T > &  in 
)

This function inverts a symmetric positive definite matrix.

It is written in C++, so it should work with any data type for which operators +, -, *, /, =, and sqrt are defined. The function uses the Cholesky decomposition method to invert the matrix. Cholesky decomposition is about a factor of 2 better than LU decomposition where symmetry is ignored.


The documentation for this struct was generated from the following file: