Simbody
Classes | Namespaces | Functions

SymMat.h File Reference

This file declares class SymMat<M, ELEMENT_TYPE, ROW_SPACING>. More...

#include "SimTKcommon/internal/common.h"

Go to the source code of this file.

Classes

class  SimTK::SymMat< M, ELT, RS >
 RS is total spacing between rows in memory (default 1) More...
struct  SimTK::SymMat< M, ELT, RS >::EltResult< P >
struct  SimTK::SymMat< M, ELT, RS >::Result< P >
struct  SimTK::SymMat< M, ELT, RS >::Substitute< P >

Namespaces

namespace  SimTK
 

This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with other symbols.


Functions

template<int M, class E1 , int S1, class E2 , int S2>
SymMat< M, E1, S1 >::template
Result< SymMat< M, E2, S2 >
>::Add 
SimTK::operator+ (const SymMat< M, E1, S1 > &l, const SymMat< M, E2, S2 > &r)
template<int M, class E1 , int S1, class E2 , int S2>
SymMat< M, E1, S1 >::template
Result< SymMat< M, E2, S2 >
>::Sub 
SimTK::operator- (const SymMat< M, E1, S1 > &l, const SymMat< M, E2, S2 > &r)
template<int M, class E1 , int S1, class E2 , int S2>
SymMat< M, E1, S1 >::template
Result< SymMat< M, E2, S2 >
>::Mul 
SimTK::operator* (const SymMat< M, E1, S1 > &l, const SymMat< M, E2, S2 > &r)
template<int M, class E1 , int S1, class E2 , int S2>
bool SimTK::operator== (const SymMat< M, E1, S1 > &l, const SymMat< M, E2, S2 > &r)
template<int M, class E1 , int S1, class E2 , int S2>
bool SimTK::operator!= (const SymMat< M, E1, S1 > &l, const SymMat< M, E2, S2 > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< float >::Mul 
SimTK::operator* (const SymMat< M, E, S > &l, const float &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< float >::Mul 
SimTK::operator* (const float &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< double >::Mul 
SimTK::operator* (const SymMat< M, E, S > &l, const double &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< double >::Mul 
SimTK::operator* (const double &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< long double >::Mul 
SimTK::operator* (const SymMat< M, E, S > &l, const long double &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< long double >::Mul 
SimTK::operator* (const long double &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< typename CNT< E >
::Precision >::Mul 
SimTK::operator* (const SymMat< M, E, S > &l, int r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< typename CNT< E >
::Precision >::Mul 
SimTK::operator* (int l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Mul 
SimTK::operator* (const SymMat< M, E, S > &l, const std::complex< R > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Mul 
SimTK::operator* (const std::complex< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Mul 
SimTK::operator* (const SymMat< M, E, S > &l, const conjugate< R > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Mul 
SimTK::operator* (const conjugate< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< typename negator< R >
::StdNumber >::Mul 
SimTK::operator* (const SymMat< M, E, S > &l, const negator< R > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< typename negator< R >
::StdNumber >::Mul 
SimTK::operator* (const negator< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< float >::Dvd 
SimTK::operator/ (const SymMat< M, E, S > &l, const float &r)
template<int M, class E , int S>
CNT< float >::template Result
< SymMat< M, E, S > >::Dvd 
SimTK::operator/ (const float &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< double >::Dvd 
SimTK::operator/ (const SymMat< M, E, S > &l, const double &r)
template<int M, class E , int S>
CNT< double >::template Result
< SymMat< M, E, S > >::Dvd 
SimTK::operator/ (const double &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< long double >::Dvd 
SimTK::operator/ (const SymMat< M, E, S > &l, const long double &r)
template<int M, class E , int S>
CNT< long double >::template
Result< SymMat< M, E, S >
>::Dvd 
SimTK::operator/ (const long double &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< typename CNT< E >
::Precision >::Dvd 
SimTK::operator/ (const SymMat< M, E, S > &l, int r)
template<int M, class E , int S>
CNT< typename CNT< E >
::Precision >::template Result
< SymMat< M, E, S > >::Dvd 
SimTK::operator/ (int l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Dvd 
SimTK::operator/ (const SymMat< M, E, S > &l, const std::complex< R > &r)
template<int M, class E , int S, class R >
CNT< std::complex< R >
>::template Result< SymMat< M,
E, S > >::Dvd 
SimTK::operator/ (const std::complex< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Dvd 
SimTK::operator/ (const SymMat< M, E, S > &l, const conjugate< R > &r)
template<int M, class E , int S, class R >
CNT< std::complex< R >
>::template Result< SymMat< M,
E, S > >::Dvd 
SimTK::operator/ (const conjugate< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< typename negator< R >
::StdNumber >::Dvd 
SimTK::operator/ (const SymMat< M, E, S > &l, const negator< R > &r)
template<int M, class E , int S, class R >
CNT< R >::template Result
< SymMat< M, E, S > >::Dvd 
SimTK::operator/ (const negator< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< float >::Add 
SimTK::operator+ (const SymMat< M, E, S > &l, const float &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< float >::Add 
SimTK::operator+ (const float &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< double >::Add 
SimTK::operator+ (const SymMat< M, E, S > &l, const double &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< double >::Add 
SimTK::operator+ (const double &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< long double >::Add 
SimTK::operator+ (const SymMat< M, E, S > &l, const long double &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< long double >::Add 
SimTK::operator+ (const long double &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< typename CNT< E >
::Precision >::Add 
SimTK::operator+ (const SymMat< M, E, S > &l, int r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< typename CNT< E >
::Precision >::Add 
SimTK::operator+ (int l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Add 
SimTK::operator+ (const SymMat< M, E, S > &l, const std::complex< R > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Add 
SimTK::operator+ (const std::complex< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Add 
SimTK::operator+ (const SymMat< M, E, S > &l, const conjugate< R > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Add 
SimTK::operator+ (const conjugate< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< typename negator< R >
::StdNumber >::Add 
SimTK::operator+ (const SymMat< M, E, S > &l, const negator< R > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< typename negator< R >
::StdNumber >::Add 
SimTK::operator+ (const negator< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< float >::Sub 
SimTK::operator- (const SymMat< M, E, S > &l, const float &r)
template<int M, class E , int S>
CNT< float >::template Result
< SymMat< M, E, S > >::Sub 
SimTK::operator- (const float &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< double >::Sub 
SimTK::operator- (const SymMat< M, E, S > &l, const double &r)
template<int M, class E , int S>
CNT< double >::template Result
< SymMat< M, E, S > >::Sub 
SimTK::operator- (const double &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< long double >::Sub 
SimTK::operator- (const SymMat< M, E, S > &l, const long double &r)
template<int M, class E , int S>
CNT< long double >::template
Result< SymMat< M, E, S >
>::Sub 
SimTK::operator- (const long double &l, const SymMat< M, E, S > &r)
template<int M, class E , int S>
SymMat< M, E, S >::template
Result< typename CNT< E >
::Precision >::Sub 
SimTK::operator- (const SymMat< M, E, S > &l, int r)
template<int M, class E , int S>
CNT< typename CNT< E >
::Precision >::template Result
< SymMat< M, E, S > >::Sub 
SimTK::operator- (int l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Sub 
SimTK::operator- (const SymMat< M, E, S > &l, const std::complex< R > &r)
template<int M, class E , int S, class R >
CNT< std::complex< R >
>::template Result< SymMat< M,
E, S > >::Sub 
SimTK::operator- (const std::complex< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< std::complex< R >
>::Sub 
SimTK::operator- (const SymMat< M, E, S > &l, const conjugate< R > &r)
template<int M, class E , int S, class R >
CNT< std::complex< R >
>::template Result< SymMat< M,
E, S > >::Sub 
SimTK::operator- (const conjugate< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int S, class R >
SymMat< M, E, S >::template
Result< typename negator< R >
::StdNumber >::Sub 
SimTK::operator- (const SymMat< M, E, S > &l, const negator< R > &r)
template<int M, class E , int S, class R >
CNT< R >::template Result
< SymMat< M, E, S > >::Sub 
SimTK::operator- (const negator< R > &l, const SymMat< M, E, S > &r)
template<int M, class E , int RS, class CHAR , class TRAITS >
std::basic_ostream< CHAR,
TRAITS > & 
SimTK::operator<< (std::basic_ostream< CHAR, TRAITS > &o, const SymMat< M, E, RS > &m)
template<int M, class E , int RS, class CHAR , class TRAITS >
std::basic_istream< CHAR,
TRAITS > & 
SimTK::operator>> (std::basic_istream< CHAR, TRAITS > &is, SymMat< M, E, RS > &m)

Detailed Description

This file declares class SymMat<M, ELEMENT_TYPE, ROW_SPACING>.

This is logically a square MxM Hermitian matrix, but only the diagonal and *lower* triangle are stored. Elements above the diagonal are the Hermitan transpose of their mirrored elements below the diagonal.

The storage is packed by column, with an optional stride RS when going element- to-element. We use an unconventional storage scheme here which provides substantial conveniences and some performance advantage over the conventional (LAPACK) scheme which stores the matrix in packed columns. Instead, we store the diagonal first, as a Vec<M> and then store the lower triangle separately in the conventional columnwise form. This allows easy handling of the diagonal elements separately, which is very common in a symmetric matrix. The diagonals are "special"; for example they must be "self-Hermitian" meaning their imaginary parts must be zero. We could just store real elements for the diagonals, but we don't for a number of good reasons which I'll leave as an exercise for the reader. However, we will ensure that their imaginary parts are zero, although a determined user could screw this up.

Here is an example. Imagine a full 4x4 Hermitian matrix with complex elements. We'll use a' to mean conjugate(a). Then the elements are w a' b' c' a x d' e' b d y f' c e f z Note that it must be the case that w=w', x=x', y=y', and z=z' so the diagonal elements must be real. Here's how we store that as a SymMat: w x y z a b c d e f These are stored in consecutive memory locations (possibly separated by meaningless elements as indicated by the row spacing). Mere recasting allows us to view this as a 4x4 matrix, or a 4-element diagonal and 6-element "lower" vector, or as these vectors apparently containing the Hermitian types (i.e. one may cast the "lower" portion into what looks like the "upper" portion).

This is a "composite numerical type".

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines