matSup.hpp

Go to the documentation of this file.
00001 #ifndef _BAYES_FILTER_MATRIX_SUPPORT
00002 #define _BAYES_FILTER_MATRIX_SUPPORT
00003 
00004 /*
00005  * Bayes++ the Bayesian Filtering Library
00006  * Copyright (c) 2002 Michael Stevens
00007  * See accompanying Bayes++.htm for terms and conditions of use.
00008  *
00009  * $Id: matSup.hpp 562 2006-04-05 20:46:23 +0200 (Wed, 05 Apr 2006) mistevens $
00010  */
00011 
00012 /*
00013  * Matrix support functions for filter classes
00014  *  Members of the Bayesian_filter_matrix namespace are used in the
00015  *  interface of Bayesian_filter and for internal operations.
00016  *  Be aware! These functions and their implemenation are more likely to change
00017  *  then those in Bayesian_filter.
00018  */
00019 
00020 /* Filter Matrix Namespace */
00021 namespace Bayesian_filter_matrix
00022 {
00023 
00024 
00025 /*
00026  * Assertion support
00027  */
00028 #ifndef NDEBUG
00029 void assert_isPSD (const SymMatrix &M);
00030 #else
00031 inline void assert_isPSD (const SymMatrix &M) {}
00032 #endif
00033 
00034 /*
00035  * Local support functions
00036  */
00037 bool isPSD (const SymMatrix &M);
00038 bool isSymmetric (const Matrix &M);
00039 void forceSymmetric (Matrix &M, bool bUpperToLower = false);
00040 
00041 /*
00042  * UdU' and LdL' and UU' Cholesky Factorisation and function
00043  * Very important to manipulate PD and PSD matrices
00044  *
00045  * Return values:
00046  *  Many algorithms return a value_type which is a reciprocal condition number
00047  *  These values are documented for each algorithm and are important way to
00048  *  determine the validity of the results
00049  */
00050 Vec::value_type UdUrcond (const Vec& d);
00051 RowMatrix::value_type UdUrcond (const RowMatrix& UD);
00052 RowMatrix::value_type UdUrcond (const RowMatrix& UD, std::size_t n);
00053 UTriMatrix::value_type UCrcond (const UTriMatrix& UC);
00054 SymMatrix::value_type UdUdet (const SymMatrix& UD);
00055 
00056 // In-place factorisations
00057 RowMatrix::value_type UdUfactor_variant1 (RowMatrix& M, std::size_t n);
00058 RowMatrix::value_type UdUfactor_variant2 (RowMatrix& M, std::size_t n);
00059 inline RowMatrix::value_type UdUfactor (RowMatrix& M, std::size_t n)
00060 {   return UdUfactor_variant2(M,n);
00061 }
00062 LTriMatrix::value_type LdLfactor (LTriMatrix& M, std::size_t n);
00063 UTriMatrix::value_type UCfactor (UTriMatrix& M, std::size_t n);
00064 
00065 // Copy factorisations
00066 RowMatrix::value_type UdUfactor (RowMatrix& UD, const SymMatrix& M);
00067 LTriMatrix::value_type LdLfactor (LTriMatrix& LD, const SymMatrix& M);
00068 UTriMatrix::value_type UCfactor (UTriMatrix& UC, const SymMatrix& M);
00069 
00070 // Factor manipulations
00071 bool UdUinverse (RowMatrix& UD);
00072 bool UTinverse (UTriMatrix& U);
00073 void UdUrecompose_transpose (RowMatrix& M);
00074 void UdUrecompose (RowMatrix& M);
00075 void UdUrecompose (SymMatrix& X, const RowMatrix& M);
00076 void UdUfromUCholesky (RowMatrix& U);
00077 void UdUseperate (RowMatrix& U, Vec& d, const RowMatrix& UD);
00078 void Lzero (RowMatrix& M);
00079 void Uzero (RowMatrix& M);
00080 
00081 /*
00082  * Functions using UdU factorisation:
00083  *  inverse of Positive Definate matrix returning rcond
00084  */
00085 SymMatrix::value_type UdUinversePDignoreInfinity (SymMatrix& M);
00086 SymMatrix::value_type UdUinversePD (SymMatrix& M);
00087 SymMatrix::value_type UdUinversePD (SymMatrix& M, SymMatrix::value_type& detM);
00088 SymMatrix::value_type UdUinversePD (SymMatrix& MI, const SymMatrix& M);
00089 SymMatrix::value_type UdUinversePD (SymMatrix& MI, SymMatrix::value_type& detM, const SymMatrix& M);
00090 
00091 
00092 }//namespace
00093 
00094 #endif

Generated on Wed Oct 4 22:57:23 2006 for Bayes++ Bayesian Filtering Classes by  doxygen 1.4.6