casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::MatrixMathLA_global_functions_Linear_Algebra Struct Reference

Linear algebra functions on Vectors and Matrices. 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

template<class T >
T casacore::MatrixMathLA_global_functions_Linear_Algebra::determinate ( const Matrix< T > &  in)
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;

template<class T >
Matrix<T> casacore::MatrixMathLA_global_functions_Linear_Algebra::invert ( const Matrix< T > &  in)
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.

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

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