bdm::chmat Class Reference

Symmetric matrix stored in square root decomposition using upper cholesky. More...


Detailed Description

Symmetric matrix stored in square root decomposition using upper cholesky.

This matrix represent $A=Ch' Ch$ where only the upper triangle $Ch$ is stored;

#include <chmat.h>

List of all members.

Public Member Functions

void opupdt (const vec &v, double w)
mat to_mat () const
 Conversion to full matrix.
void mult_sym (const mat &C)
 Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C'$.
void mult_sym (const mat &C, chmat &U) const
void mult_sym_t (const mat &C)
 Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C'*V*C$.
void mult_sym_t (const mat &C, chmat &U) const
double logdet () const
 Logarithm of a determinant.
vec sqrt_mult (const vec &v) const
 Multiplies square root of $V$ by vector $x$.
double qform (const vec &v) const
 Evaluates quadratic form $x= v'*V*v$;.
double invqform (const vec &v) const
 Evaluates quadratic form $x= v'*inv(V)*v$;.
void clear ()
 Clearing matrix so that it corresponds to zeros.
void add (const chmat &A2, double w=1.0)
 add another chmat A2 with weight w.
void inv (chmat &Inv) const
 Inversion in the same form, i.e. cholesky.
virtual ~chmat ()
 Destructor for future use;.
 chmat (const int dim0)
 Default constructor.
 chmat (const vec &v)
 Default constructor.
 chmat (const chmat &Ch0)
 Copy constructor.
 chmat (const mat &M)
 Default constructor (m3k:cholform).
 chmat (const chmat &M, const ivec &perm)
mat & _Ch ()
 Access function.
const mat & _Ch () const
 Access function.
void setD (const vec &nD)
 Access functions.
void setCh (const vec &chQ)
 Access functions.
void setD (const vec &nD, int i)
 Access functions.
chmatoperator+= (const chmat &A2)
 Operators.
chmatoperator-= (const chmat &A2)
 mapping of negative add operation to operators
chmatoperator* (const double &d)
chmatoperator= (const chmat &A2)
chmatoperator*= (double x)
int cols () const
 Reimplementing common functions of mat: cols().
int rows () const
 Reimplementing common functions of mat: rows().

Protected Attributes

mat Ch
 Upper triangle of the cholesky matrix.
int dim
 dimension of the square matrix

Constructor & Destructor Documentation

bdm::chmat::chmat ( const chmat M,
const ivec &  perm 
) [inline]

Some templates require this constructor to compile, but it shouldn't actually be called.

References bdm_error.


Member Function Documentation

void bdm::chmat::mult_sym ( const mat &  C  )  [virtual]

Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C'$.

Parameters:
C multiplying matrix,

Reimplemented from bdm::sqmat.

References bdm_assert_debug, bdm_warning, Ch, and bdm::sqmat::dim.

void bdm::chmat::mult_sym_t ( const mat &  C  )  [virtual]

Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C'*V*C$.

Parameters:
C multiplying matrix,

Reimplemented from bdm::sqmat.

References bdm_assert_debug, bdm_warning, Ch, and bdm::sqmat::dim.

chmat & bdm::chmat::operator+= ( const chmat A2  )  [inline]

Operators.

Operations: mapping of add operation to operators

References add().

void bdm::chmat::opupdt ( const vec &  v,
double  w 
) [virtual]

Perfroms a rank-1 update by outer product of vectors: $V = V + w v v'$.

Parameters:
v Vector forming the outer product to be added
w weight of updating; can be negative

BLAS-2b operation.

Reimplemented from bdm::sqmat.

References Ch.

vec bdm::chmat::sqrt_mult ( const vec &  v  )  const [virtual]

Multiplies square root of $V$ by vector $x$.

Used e.g. in generating normal samples.

Reimplemented from bdm::sqmat.

References Ch.


The documentation for this class was generated from the following files:

Generated on Mon Oct 12 19:37:21 2009 for mixpp by  doxygen 1.6.1