atlas  0.6
Public Member Functions | Private Types | List of all members
atlas::matrix::PID_Matrix< C > Class Template Reference

#include <Atlas.h>

Inheritance diagram for atlas::matrix::PID_Matrix< C >:
Inheritance graph
[legend]
Collaboration diagram for atlas::matrix::PID_Matrix< C >:
Collaboration graph
[legend]

Public Member Functions

 PID_Matrix ()
 
 PID_Matrix (const base &M)
 
 PID_Matrix (base &&M)
 
 PID_Matrix (size_t m, size_t n)
 
 PID_Matrix (size_t m, size_t n, const C &c)
 
 PID_Matrix (size_t n)
 
 PID_Matrix (const std::vector< Vector< C > > &cols, size_t n_rows)
 
template<typename I >
 PID_Matrix (I begin, I end, size_t n_rows, tags::IteratorTag)
 
PID_Matrixoperator+= (const Matrix< C > &M)
 
PID_Matrixoperator-= (const Matrix< C > &M)
 
PID_Matrixoperator*= (const Matrix< C > &Q)
 
PID_MatrixleftMult (const Matrix< C > &P)
 
PID_Matrixoperator/= (const C &c) throw (std::runtime_error)
 
PID_Matrixnegate ()
 
PID_Matrixtranspose ()
 
PID_Matrixinvert ()
 
PID_Matrixinvert (C &d)
 
PID_Matrix transposed () const
 
PID_Matrix negative_transposed () const
 
PID_Matrix inverse () const
 
PID_Matrix inverse (C &d) const
 
PID_Matrix operator* (const Matrix< C > &Q) const
 
PID_Matrix on_basis (const std::vector< Vector< C > > &basis) const
 
bool divisible (C) const
 
PID_Matrix block (size_t i0, size_t j0, size_t i1, size_t j1) const
 
- Public Member Functions inherited from atlas::matrix::Matrix< C >
 Matrix ()
 
 Matrix (const base &M)
 
 Matrix (base &&M)
 
 Matrix (size_t m, size_t n)
 
 Matrix (size_t m, size_t n, const C &c)
 
 Matrix (const std::vector< Vector< C > > &cols, size_t n_rows)
 
template<typename I >
 Matrix (I begin, I end, size_t n_rows, tags::IteratorTag)
 
 Matrix (size_t n)
 : Construct the identity matrix of size n. More...
 
Matrix transposed () const
 
Matrix negative_transposed () const
 
template<typename C1 >
Vector< C1 > operator* (const Vector< C1 > &) const
 
template<typename C1 >
Vector< C1 > right_prod (const Vector< C1 > &) const
 
template<typename C1 >
void apply_to (Vector< C1 > &v) const
 
template<typename C1 >
void right_mult (Vector< C1 > &v) const
 
Matrix operator* (const Matrix &) const
 
Matrixoperator+= (const Matrix &)
 
Matrixoperator-= (const Matrix &)
 
Matrixoperator*= (const Matrix &Q)
 
MatrixleftMult (const Matrix &P)
 
Matrixnegate ()
 
Matrixtranspose ()
 
void rowOperation (size_t, size_t, const C &)
 
void columnOperation (size_t j, size_t k, const C &c)
 
void rowMultiply (size_t i, C f)
 
void columnMultiply (size_t j, C f)
 
void swapColumns (size_t, size_t)
 Interchange columns. More...
 
void swapRows (size_t, size_t)
 Interchanges rows. More...
 
- Public Member Functions inherited from atlas::matrix::Matrix_base< C >
 Matrix_base ()
 
 Matrix_base (size_t m, size_t n)
 
 Matrix_base (size_t m, size_t n, const C &c)
 
 Matrix_base (const std::vector< Vector< C > > &, size_t n_rows)
 This constructor constructs a matrix from a list of vectors, column-wise. It is assumed that all elements of |b| (possibly none) have size |n_rows|. More...
 
template<typename I >
 Matrix_base (I begin, I end, size_t n_rows, tags::IteratorTag)
 
void swap (Matrix_base &)
 
size_t numRows () const
 
size_t numColumns () const
 
size_t rowSize () const
 
size_t columnSize () const
 
const C & operator() (size_t i, size_t j) const
 
void get_row (Vector< C > &, size_t) const
 
void get_column (Vector< C > &, size_t) const
 
Vector< C > row (size_t i) const
 
std::vector< Vector< C > > rows () const
 
Vector< C > column (size_t j) const
 
std::vector< Vector< C > > columns () const
 
bool operator== (const Matrix_base< C > &) const
 
bool operator!= (const Matrix_base< C > &m) const
 
bool is_zero () const
 
bool isEmpty () const
 
C & operator() (size_t i, size_t j)
 
void set_row (size_t, const Vector< C > &)
 Puts v in the i-th row of the matrix. More...
 
void set_column (size_t, const Vector< C > &)
 Puts v in the j-th column of the matrix. More...
 
void add_row (const Vector< C > &)
 
void add_column (const Vector< C > &)
 
void eraseColumn (size_t)
 
void eraseRow (size_t)
 
void reset ()
 

Private Types

typedef Matrix< C > base
 

Additional Inherited Members

- Protected Types inherited from atlas::matrix::Matrix< C >
typedef Matrix_base< C > base
 
- Protected Member Functions inherited from atlas::matrix::Matrix_base< C >
const C * at (size_t i, size_t j) const
 
C * at (size_t i, size_t j)
 
- Protected Attributes inherited from atlas::matrix::Matrix_base< C >
Vector< C > d_data
 

Member Typedef Documentation

template<typename C>
typedef Matrix<C> atlas::matrix::PID_Matrix< C >::base
private

Constructor & Destructor Documentation

template<typename C>
atlas::matrix::PID_Matrix< C >::PID_Matrix ( )
inline
template<typename C>
atlas::matrix::PID_Matrix< C >::PID_Matrix ( const base M)
inline
template<typename C>
atlas::matrix::PID_Matrix< C >::PID_Matrix ( base &&  M)
inline
template<typename C>
atlas::matrix::PID_Matrix< C >::PID_Matrix ( size_t  m,
size_t  n 
)
inline
template<typename C>
atlas::matrix::PID_Matrix< C >::PID_Matrix ( size_t  m,
size_t  n,
const C &  c 
)
inline
template<typename C>
atlas::matrix::PID_Matrix< C >::PID_Matrix ( size_t  n)
inlineexplicit
template<typename C>
atlas::matrix::PID_Matrix< C >::PID_Matrix ( const std::vector< Vector< C > > &  cols,
size_t  n_rows 
)
inline
template<typename C>
template<typename I >
atlas::matrix::PID_Matrix< C >::PID_Matrix ( begin,
end,
size_t  n_rows,
tags::IteratorTag   
)
inline

Member Function Documentation

template<typename C >
PID_Matrix< C > atlas::matrix::PID_Matrix< C >::block ( size_t  i0,
size_t  j0,
size_t  i1,
size_t  j1 
) const

Synopsis: constructs the matrix corresponding to the block [i0,i1[ x [j0,j1[ of source. This implementation uses that storage is by rows.

template<typename C>
bool atlas::matrix::PID_Matrix< C >::divisible ( c) const

Tells if all coefficients of the matrix are divisible by c.

template<typename C>
PID_Matrix atlas::matrix::PID_Matrix< C >::inverse ( ) const
inline
template<typename C>
PID_Matrix atlas::matrix::PID_Matrix< C >::inverse ( C &  d) const
inline
template<typename C >
PID_Matrix< C > & atlas::matrix::PID_Matrix< C >::invert ( )

Here we invert the matrix without catching the denominator. The intent is that it should be used for invertible matrices only.

template<typename C>
PID_Matrix< C > & atlas::matrix::PID_Matrix< C >::invert ( C &  d)

This function inverts the matrix M. It is assumed that the coefficents are in an integral domain. At the conclusion of the process, d will contain the denominator for the inverted matrix (so that the true result is M/d).

If the matrix is not invertible, the resulting matrix is undefined, and d is set to 0.

We have chosen here to avoid divisions as much as possible. So in fact we take the matrix to diagonal form through elementary operations; from there we deduce the smallest possible denominator for the inverse, and the inverse matrix. We have to keep track of both row and column operations.

template<typename C>
PID_Matrix& atlas::matrix::PID_Matrix< C >::leftMult ( const Matrix< C > &  P)
inline
template<typename C>
PID_Matrix& atlas::matrix::PID_Matrix< C >::negate ( )
inline
template<typename C>
PID_Matrix atlas::matrix::PID_Matrix< C >::negative_transposed ( ) const
inline
template<typename C>
PID_Matrix< C > atlas::matrix::PID_Matrix< C >::on_basis ( const std::vector< Vector< C > > &  b) const

This function constructs expresses our square matrix on the basis b.

template<typename C>
PID_Matrix atlas::matrix::PID_Matrix< C >::operator* ( const Matrix< C > &  Q) const
inline
template<typename C>
PID_Matrix& atlas::matrix::PID_Matrix< C >::operator*= ( const Matrix< C > &  Q)
inline
template<typename C>
PID_Matrix& atlas::matrix::PID_Matrix< C >::operator+= ( const Matrix< C > &  M)
inline
template<typename C>
PID_Matrix& atlas::matrix::PID_Matrix< C >::operator-= ( const Matrix< C > &  M)
inline
template<typename C>
PID_Matrix& atlas::matrix::PID_Matrix< C >::operator/= ( const C &  c)
throw (std::runtime_error
)
inline
template<typename C>
PID_Matrix& atlas::matrix::PID_Matrix< C >::transpose ( )
inline
template<typename C>
PID_Matrix atlas::matrix::PID_Matrix< C >::transposed ( ) const
inline

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