Matrix Class Template Reference
[Vector and Matrix mathematics]

#include <Matrix.hpp>

Inheritance diagram for Matrix:

Inheritance graph
[legend]
Collaboration diagram for Matrix:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class gpstk::Matrix< T >

An implementation of a matrix class using Vector<T> as its internal basis.

This class is STL compliant with the iterator proceeding in row major order. Operators +=, -=, *= and /= are implemented in RefMatrixBase.

See also:
matvectest.cpp for examples

Definition at line 59 of file Matrix.hpp.

Public Types

typedef Vector< T >::value_type value_type
 STL value_type.
typedef Vector< T >::reference reference
 STL reference type.
typedef Vector< T >::const_reference const_reference
 STL const reference type.
typedef Vector< T >::iterator iterator
 STL iterator type.
typedef Vector< T >::const_iterator const_iterator
 STL const iterator type.

Public Member Functions

 Matrix ()
 default constructor
 Matrix (size_t rows, size_t cols)
 constructor given an initial size
 Matrix (size_t rows, size_t cols, T initialValue)
 constructor for an initial size and value
 Matrix (size_t rows, size_t cols, const T *vec)
 copies out the contents of vec to initialize the matrix
template<class BaseClass>
 Matrix (size_t rows, size_t cols, const ConstVectorBase< T, BaseClass > &vec)
 copies out the contents of vec to initialize the matrix
template<class BaseClass>
 Matrix (const ConstMatrixBase< T, BaseClass > &mat)
 constructor for a ConstMatrixBase object
template<class BaseClass>
 Matrix (const ConstMatrixBase< T, BaseClass > &mat, size_t topRow, size_t topCol, size_t numRows, size_t numCols)
 submatrix constructor
iterator begin ()
 STL begin.
const_iterator begin () const
 STL const begin.
iterator end ()
 STL end.
const_iterator end () const
 STL const end.
value_type front ()
 STL front.
const_reference front () const
 STL const front.
bool empty () const
 STL empty.
size_t size () const
 STL size.
size_t max_size () const
 STL max size.
size_t rows () const
 The number of rows in the matrix.
size_t cols () const
 The number of columns in the matrix.
MatrixRowSlice< T > rowRef (size_t rowNum, const std::slice &s)
 A reference slice of a row with a given std::slice.
MatrixRowSlice< T > rowRef (size_t rowNum, size_t colNum=0)
 A reference slice of a row with a starting column (i.e. sub-row).
ConstMatrixRowSlice< T > row (size_t rowNum, const std::slice &s) const
 A const reference slice of a row with a given std::slice.
ConstMatrixRowSlice< T > row (size_t rowNum, size_t colNum=0) const
 A const reference slice of a row with a starting column (i.e. sub-row).
MatrixColSlice< T > colRef (size_t colNum, const std::slice &s)
 A reference column with a given slice.
MatrixColSlice< T > colRef (size_t colNum, size_t rowNum=0)
 A reference column with a starting row number (i.e. sub-column).
ConstMatrixColSlice< T > col (size_t colNum, const std::slice &s) const
 A const reference column with a given slice.
ConstMatrixColSlice< T > col (size_t colNum, size_t rowNum=0) const
 A const reference column with a starting row number (i.e. sub-column).
T & operator() (size_t rowNum, size_t colNum)
 Non-const matrix operator(row,col).
operator() (size_t rowNum, size_t colNum) const
 Const matrix operator(row,col).
MatrixRowSlice< T > operator[] (size_t row)
 operator[] that returns a row slice
ConstMatrixRowSlice< T > operator[] (size_t rowNum) const
 const operator[] that returns a const row slice
Matrixresize (size_t rows, size_t cols)
 Resizes the matrix to rows*cols.
Matrixresize (size_t rows, size_t cols, const T initialValue)
Matrixoperator= (const T *array)
 Assigns this matrix to a T* in column major order.
Matrixoperator= (const std::valarray< T > array)
 Assigns the contents of this matrix to those in array in column major order.
Matrixoperator= (const T t)
 Assigns all elements of the matrix to t.
Matrixoperator= (const Matrix &mat)
 Copies the other matrix.
template<class BaseClass>
Matrixoperator= (const ConstMatrixBase< T, BaseClass > &mat)
 Copies from any matrix.
template<class BaseClass>
Matrixoperator= (const ConstVectorBase< T, BaseClass > &mat)
 Copies from any vector.


Member Typedef Documentation

typedef Vector<T>::const_iterator const_iterator
 

STL const iterator type.

Definition at line 71 of file Matrix.hpp.

typedef Vector<T>::const_reference const_reference
 

STL const reference type.

Definition at line 67 of file Matrix.hpp.

typedef Vector<T>::iterator iterator
 

STL iterator type.

Definition at line 69 of file Matrix.hpp.

typedef Vector<T>::reference reference
 

STL reference type.

Definition at line 65 of file Matrix.hpp.

typedef Vector<T>::value_type value_type
 

STL value_type.

Definition at line 63 of file Matrix.hpp.


Constructor & Destructor Documentation

Matrix size_t  rows,
size_t  cols,
const ConstVectorBase< T, BaseClass > &  vec
[inline]
 

copies out the contents of vec to initialize the matrix

Definition at line 83 of file Matrix.hpp.

Matrix const ConstMatrixBase< T, BaseClass > &  mat  )  [inline]
 

constructor for a ConstMatrixBase object

Definition at line 89 of file Matrix.hpp.

Matrix const ConstMatrixBase< T, BaseClass > &  mat,
size_t  topRow,
size_t  topCol,
size_t  numRows,
size_t  numCols
[inline]
 

submatrix constructor

Definition at line 100 of file Matrix.hpp.


Member Function Documentation

const_iterator begin  )  const [inline]
 

STL const begin.

Definition at line 128 of file Matrix.hpp.

iterator begin  )  [inline]
 

STL begin.

Definition at line 126 of file Matrix.hpp.

Referenced by HarrisPriesterDrag::getDensityCoeficentsByF107(), SolverGeneral::getSolution(), and SolverGeneral::getVariance().

size_t cols void   )  const [inline]
 

The number of columns in the matrix.

Reimplemented from RefMatrixBase< T, Matrix< T > >.

Definition at line 147 of file Matrix.hpp.

Referenced by SVD::backSub(), GeneralConstraint::changeState(), SphericalHarmonicGravity::computeVW(), ConstMatrixColSlice::ConstMatrixColSlice(), ConstMatrixRowSlice::ConstMatrixRowSlice(), ConstMatrixSlice::ConstMatrixSlice(), SphericalHarmonicGravity::gravity(), SphericalHarmonicGravity::gravityGradient(), ARLambda::lambda(), MatrixColSlice::MatrixColSlice(), MatrixRowSlice::MatrixRowSlice(), MatrixSlice::MatrixSlice(), MatrixTest1(), MatrixTest2(), MatrixTest3(), MatrixTest4(), MatrixTest5(), MatrixTest6(), MatrixTest7(), MatrixTest8(), MatrixTest9(), gpstk::operator<<(), PolyTest(), PRSolution::RAIMCompute(), SimpleKalmanFilter::Reset(), Matrix::row(), Matrix::rowRef(), ConstraintSystem::setConstraint(), and gpstk::SrifMU().

bool empty void   )  const [inline]
 

STL empty.

Definition at line 138 of file Matrix.hpp.

const_iterator end  )  const [inline]
 

STL const end.

Definition at line 132 of file Matrix.hpp.

iterator end  )  [inline]
 

STL end.

Definition at line 130 of file Matrix.hpp.

Referenced by GeneralConstraint::changeState(), HelmertTransform::dump(), HarrisPriesterDrag::getDensityCoeficentsByF107(), ForceModelList::getDerivatives(), GeneralConstraint::getSolution(), GeneralConstraint::getVariable(), GeneralConstraint::getVariables(), SolverGeneral::postCompute(), SolverGeneral::preCompute(), and SolverPPP::Process().

const_reference front  )  const [inline]
 

STL const front.

Definition at line 136 of file Matrix.hpp.

value_type front  )  [inline]
 

STL front.

Definition at line 134 of file Matrix.hpp.

size_t max_size  )  const [inline]
 

STL max size.

Definition at line 142 of file Matrix.hpp.

T operator() size_t  rowNum,
size_t  colNum
const [inline]
 

Const matrix operator(row,col).

Reimplemented from ConstMatrixBase< T, Matrix< T > >.

Definition at line 170 of file Matrix.hpp.

T& operator() size_t  rowNum,
size_t  colNum
[inline]
 

Non-const matrix operator(row,col).

Reimplemented from RefMatrixBase< T, Matrix< T > >.

Definition at line 167 of file Matrix.hpp.

Matrix& operator= const ConstVectorBase< T, BaseClass > &  mat  )  [inline]
 

Copies from any vector.

Definition at line 214 of file Matrix.hpp.

Matrix& operator= const ConstMatrixBase< T, BaseClass > &  mat  )  [inline]
 

Copies from any matrix.

Definition at line 204 of file Matrix.hpp.

Matrix& operator= const Matrix< T > &  mat  )  [inline]
 

Copies the other matrix.

Definition at line 200 of file Matrix.hpp.

Matrix& operator= const T  t  )  [inline]
 

Assigns all elements of the matrix to t.

Definition at line 197 of file Matrix.hpp.

Matrix& operator= const std::valarray< T >  array  )  [inline]
 

Assigns the contents of this matrix to those in array in column major order.

Definition at line 194 of file Matrix.hpp.

Matrix& operator= const T *  array  )  [inline]
 

Assigns this matrix to a T* in column major order.

Warning:
be careful that array is as large as the matrix is!

Definition at line 190 of file Matrix.hpp.

ConstMatrixRowSlice<T> operator[] size_t  rowNum  )  const [inline]
 

const operator[] that returns a const row slice

Definition at line 176 of file Matrix.hpp.

MatrixRowSlice<T> operator[] size_t  row  )  [inline]
 

operator[] that returns a row slice

Definition at line 173 of file Matrix.hpp.

size_t rows void   )  const [inline]
 

The number of rows in the matrix.

Reimplemented from RefMatrixBase< T, Matrix< T > >.

Definition at line 145 of file Matrix.hpp.

Referenced by PRSMemory::add(), Cholesky::backSub(), SVD::backSub(), GeneralConstraint::changeState(), Matrix::colRef(), SphericalHarmonicGravity::computeVW(), ConstMatrixColSlice::ConstMatrixColSlice(), ConstMatrixRowSlice::ConstMatrixRowSlice(), ConstMatrixSlice::ConstMatrixSlice(), SphericalHarmonicGravity::correctCSTides(), PRSolution::DOPCompute(), ARLambda::factorize(), ARLambda::gauss(), SphericalHarmonicGravity::gravity(), SphericalHarmonicGravity::gravityGradient(), gpstk::inverseUT(), KalmanFilter::KalmanTimeUpdate(), ARLambda::lambda(), gpstk::lowerCholesky(), MatrixColSlice::MatrixColSlice(), MatrixRowSlice::MatrixRowSlice(), MatrixSlice::MatrixSlice(), MatrixTest1(), MatrixTest2(), MatrixTest3(), MatrixTest4(), MatrixTest5(), MatrixTest6(), MatrixTest7(), MatrixTest8(), MatrixTest9(), CholeskyCrout::operator()(), LUDecomp::operator()(), SVD::operator()(), gpstk::operator<<(), ARLambda::permute(), PolyTest(), PRSolution::RAIMCompute(), ARLambda::reduction(), SRIFilter::Reset(), SimpleKalmanFilter::Reset(), ARBase::sd2ddMatrix(), ARMLambda::search(), ARLambda::search(), ConstraintSystem::setConstraint(), Spacecraft::setTransitionMatrix(), and gpstk::UTtimesTranspose().

size_t size void   )  const [inline]
 

STL size.

Reimplemented from RefMatrixBase< T, Matrix< T > >.

Definition at line 140 of file Matrix.hpp.

Referenced by PRSMemory::add(), MatrixTest1(), and PRSolution2::PrepareAutonomousSolution().


The documentation for this class was generated from the following files:
Generated on Sat May 18 03:31:47 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1