Rosetta 3.3
Public Member Functions
numeric::MathMatrix< T > Class Template Reference

#include <MathMatrix.hh>

Collaboration diagram for numeric::MathMatrix< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MathMatrix ()
 default constructor
 MathMatrix (const core::Size NUMBER_ROWS, const core::Size NUMBER_COLS, const T &FILL_VALUE=T(0))
 construct from dimension and possible filler
 MathMatrix (const core::Size NUMBER_ROWS, const core::Size NUMBER_COLS, const T *DATA)
 construct from dimension and pointer to data
 MathMatrix (const MathMatrix< T > &MATRIX)
 copy constructor from Matrix
MathMatrix< T > * Clone () const
 Clone function.
 ~MathMatrix ()
 destructor
core::Size get_number_rows () const
 get number of rows
core::Size get_number_cols () const
 get number of columns
core::Size get_number_elements () const
 number of elements
core::Size size () const
 number of elements
const T * begin () const
 pointer to First Element
T * begin ()
 pointer to First Element
const T * end () const
 pointer to end of range
T * end ()
 pointer to end of range
MathVector< T > get_row (const core::Size ROW) const
MathVector< T > get_col (const core::Size COL) const
bool is_square () const
 is matrix a square matrix
bool is_diagonal () const
 is matrix a diagonal matrix
bool is_tri_diagonal () const
 is matrix a tridiagonal matrix
bool same_dimensions (const MathMatrix< T > &MATRIX_LHS, const MathMatrix< T > &MATRIX_RHS)
 check dimension agreement of two Matrices
bool inverse_dimensions (const MathMatrix< T > &MATRIX_LHS, const MathMatrix< T > &MATRIX_RHS)
 check inverse dimension agreement of two Matrices comapre number ros of lhs with number cols of rhs and number cols of lhs with number rows of rhs
bool multiplication_dimension (const MathMatrix< T > &MATRIX_LHS, const MathMatrix< T > &MATRIX_RHS)
 check dimensions for multiplication A*B compare number cols of lhs with number rows of rhs
MathMatrix< T > & set_zero ()
MathMatrix< T > transpose (const MathMatrix< T > &MATRIX)
MathMatrix< T > & inverse ()
MathMatrix< T > & transpose ()
MathMatrix< T > & inverse_rectangular_matrix ()
MathMatrix< T > inverse_square_matrix ()
 invert small square matrices exactly
MathMatrix< T > & inverse_diagonal_matrix ()
MathMatrix< T > & inverse_tridiagonal_matrix ()
MathMatrix< T > & set_unit ()
core::Size pivot (const core::Size ROW)
MathMatrix< T > & replace_row (const core::Size ROW, const MathVector< T > &VECTOR)
MathMatrix< T > & replace_col (const core::Size COL, const MathVector< T > &VECTOR)
MathMatrix< T > & swap_rows (const core::Size ROW_A, const core::Size ROW_B)
MathMatrix< T > & swap_cols (const core::Size COL_A, const core::Size COL_B)
bool IsValidPosition (const core::Size ROW, const core::Size COL) const
T & operator() (const core::Size ROW, const core::Size COL)
 return reference to changeable element ( ROW, COL)
const T & operator() (const core::Size ROW, const core::Size COL) const
 return reference to const element ( ROW, COL)
MathMatrix< T > & operator= (const MathMatrix< T > &MATRIX)
 assignment from Matrix
MathMatrix< T > & operator= (const T &VALUE)
 assignment from value
T * operator[] (const core::Size ROW)
 C-style data access with [] gives a pointer on a ROW.
const T * operator[] (const core::Size ROW) const
 C-style data access with [] gives a pointer on a ROW.
MathMatrix< T > & operator*= (const MathMatrix< T > &MATRIX)
 operator *= Matrix
MathMatrix< T > & operator*= (const MathVector< T > &VECTOR)
 operator *= VectorBase

template<typename T>
class numeric::MathMatrix< T >


Constructor & Destructor Documentation

template<typename T>
numeric::MathMatrix< T >::MathMatrix ( ) [inline]

default constructor

template<typename T>
numeric::MathMatrix< T >::MathMatrix ( const core::Size  NUMBER_ROWS,
const core::Size  NUMBER_COLS,
const T &  FILL_VALUE = T( 0) 
) [inline, explicit]

construct from dimension and possible filler

Parameters:
NUMBER_ROWSnumber of rows in matrix
NUMBER_COLSnumber of cols in matrix
FILL_VALUEassign every element to that value
template<typename T>
numeric::MathMatrix< T >::MathMatrix ( const core::Size  NUMBER_ROWS,
const core::Size  NUMBER_COLS,
const T *  DATA 
) [inline]

construct from dimension and pointer to data

Parameters:
NUMBER_ROWSnumber of rows in matrix
NUMBER_COLSnumber of cols in matrix
DATApointer to field of data
template<typename T>
numeric::MathMatrix< T >::MathMatrix ( const MathMatrix< T > &  MATRIX) [inline]

copy constructor from Matrix

Parameters:
MATRIXmatrix to be copied from
template<typename T>
numeric::MathMatrix< T >::~MathMatrix ( ) [inline]

destructor


Member Function Documentation

template<typename T>
const T* numeric::MathMatrix< T >::begin ( ) const [inline]

pointer to First Element

Returns:
const pointer to first element in range containing all elements of Matrix

Referenced by numeric::operator!=(), numeric::operator*=(), numeric::operator+=(), numeric::operator-=(), numeric::operator/=(), and numeric::operator==().

template<typename T>
T* numeric::MathMatrix< T >::begin ( ) [inline]

pointer to First Element

Returns:
pointer to first element in range containing all elements of Matrix
template<typename T>
MathMatrix< T>* numeric::MathMatrix< T >::Clone ( ) const [inline]

Clone function.

Returns:
pointer to new MatrixInterface< T>
template<typename T>
const T* numeric::MathMatrix< T >::end ( ) const [inline]

pointer to end of range

Returns:
const pointer to address one after last element in Matrix

Referenced by numeric::operator!=(), numeric::operator*=(), numeric::operator+=(), numeric::operator-=(), numeric::operator/=(), and numeric::operator==().

template<typename T>
T* numeric::MathMatrix< T >::end ( ) [inline]

pointer to end of range

Returns:
pointer to address one after last element in Matrix
template<typename T>
MathVector< T> numeric::MathMatrix< T >::get_col ( const core::Size  COL) const [inline]
Returns:
Col of Matrix

Referenced by numeric::interpolation::spline::BicubicSpline::train().

template<typename T>
core::Size numeric::MathMatrix< T >::get_number_cols ( ) const [inline]
template<typename T>
core::Size numeric::MathMatrix< T >::get_number_elements ( ) const [inline]

number of elements

Returns:
total number of elements in matrix

Referenced by numeric::MathMatrix< core::Real >::is_diagonal().

template<typename T>
core::Size numeric::MathMatrix< T >::get_number_rows ( ) const [inline]
template<typename T>
MathVector< T> numeric::MathMatrix< T >::get_row ( const core::Size  ROW) const [inline]
Returns:
Row of Matrix

Referenced by numeric::interpolation::spline::BicubicSpline::train().

template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::inverse ( ) [inline]
template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::inverse_diagonal_matrix ( ) [inline]
template<typename T>
bool numeric::MathMatrix< T >::inverse_dimensions ( const MathMatrix< T > &  MATRIX_LHS,
const MathMatrix< T > &  MATRIX_RHS 
) [inline]

check inverse dimension agreement of two Matrices comapre number ros of lhs with number cols of rhs and number cols of lhs with number rows of rhs

Parameters:
MATRIX_LHSrhs matrix
MATRIX_RHSlhs matrix
Returns:
true if number rows with cols and cols with rows agree between both Matrices
template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::inverse_rectangular_matrix ( ) [inline]
Returns:
invert rectangular matrices exactly

Referenced by numeric::MathMatrix< core::Real >::inverse().

template<typename T>
MathMatrix< T> numeric::MathMatrix< T >::inverse_square_matrix ( ) [inline]
template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::inverse_tridiagonal_matrix ( ) [inline]
Returns:
this algorithm was found on this page: http://www.csit.fsu.edu/~burkardt/math2071/math2071.html invert tridiagonal matrix for all diagonal elements

Referenced by numeric::MathMatrix< core::Real >::inverse_square_matrix().

template<typename T>
bool numeric::MathMatrix< T >::is_diagonal ( ) const [inline]

is matrix a diagonal matrix

Returns:
true if all but the elements in the diagonal are 0

Referenced by numeric::MathMatrix< core::Real >::inverse_square_matrix().

template<typename T>
bool numeric::MathMatrix< T >::is_square ( ) const [inline]

is matrix a square matrix

Returns:
true if number of cols and rows are idnetical

Referenced by numeric::MathMatrix< core::Real >::inverse(), numeric::MathMatrix< core::Real >::is_diagonal(), and numeric::MathMatrix< core::Real >::is_tri_diagonal().

template<typename T>
bool numeric::MathMatrix< T >::is_tri_diagonal ( ) const [inline]

is matrix a tridiagonal matrix

Returns:
if diagonal and adjecent diagonals are filled and the rest is 0

Referenced by numeric::MathMatrix< core::Real >::inverse_square_matrix().

template<typename T>
bool numeric::MathMatrix< T >::IsValidPosition ( const core::Size  ROW,
const core::Size  COL 
) const [inline]
template<typename T>
bool numeric::MathMatrix< T >::multiplication_dimension ( const MathMatrix< T > &  MATRIX_LHS,
const MathMatrix< T > &  MATRIX_RHS 
) [inline]

check dimensions for multiplication A*B compare number cols of lhs with number rows of rhs

Parameters:
MATRIX_LHSrhs matrix
MATRIX_RHSlhs matrix
Returns:
true if number cols rhs and number cols lhs agree
template<typename T>
const T& numeric::MathMatrix< T >::operator() ( const core::Size  ROW,
const core::Size  COL 
) const [inline]

return reference to const element ( ROW, COL)

Parameters:
ROWthe row number, starting with 0
COLthe col number, starting with 0
Returns:
const element defined bey ROW and COL number
template<typename T>
T& numeric::MathMatrix< T >::operator() ( const core::Size  ROW,
const core::Size  COL 
) [inline]
template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::operator*= ( const MathMatrix< T > &  MATRIX) [inline]

operator *= Matrix

template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::operator*= ( const MathVector< T > &  VECTOR) [inline]

operator *= VectorBase

template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::operator= ( const T &  VALUE) [inline]

assignment from value

Parameters:
VALUEall elements are set to that value
Returns:
reference to this assigned Matrix
template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::operator= ( const MathMatrix< T > &  MATRIX) [inline]

assignment from Matrix

Parameters:
MATRIXthe matrix used as source
Returns:
reference to this Matrix
template<typename T>
T* numeric::MathMatrix< T >::operator[] ( const core::Size  ROW) [inline]

C-style data access with [] gives a pointer on a ROW.

Referenced by numeric::MathMatrix< core::Real >::get_row(), and numeric::MathMatrix< core::Real >::operator*=().

template<typename T>
const T* numeric::MathMatrix< T >::operator[] ( const core::Size  ROW) const [inline]

C-style data access with [] gives a pointer on a ROW.

template<typename T>
core::Size numeric::MathMatrix< T >::pivot ( const core::Size  ROW) [inline]
Returns:
private helper function for computing the determinante / inverting a square matrix

Referenced by numeric::MathMatrix< core::Real >::inverse_square_matrix().

template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::replace_col ( const core::Size  COL,
const MathVector< T > &  VECTOR 
) [inline]
Returns:
copies elements of argument VECTOR into this object at position (COL)

Referenced by numeric::interpolation::spline::BicubicSpline::train().

template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::replace_row ( const core::Size  ROW,
const MathVector< T > &  VECTOR 
) [inline]
Returns:
copies elements of argument VECTOR into this object at position (ROW)

Referenced by numeric::interpolation::spline::BicubicSpline::train().

template<typename T>
bool numeric::MathMatrix< T >::same_dimensions ( const MathMatrix< T > &  MATRIX_LHS,
const MathMatrix< T > &  MATRIX_RHS 
) [inline]

check dimension agreement of two Matrices

Parameters:
MATRIX_LHSrhs matrix
MATRIX_RHSlhs matrix
Returns:
true if number rows and cols are the same between both Matrices
template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::set_unit ( ) [inline]
Returns:
set all elements in matrix to T( 0) but diagonal elements to T( 1)

Referenced by numeric::MathMatrix< core::Real >::inverse_square_matrix().

template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::set_zero ( ) [inline]
template<typename T>
core::Size numeric::MathMatrix< T >::size ( ) const [inline]

number of elements

Returns:
total number of elements in matrix

Referenced by numeric::operator-(), and numeric::operator/().

template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::swap_cols ( const core::Size  COL_A,
const core::Size  COL_B 
) [inline]
Returns:
swap columns COL_A and COL_B
template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::swap_rows ( const core::Size  ROW_A,
const core::Size  ROW_B 
) [inline]
template<typename T>
MathMatrix< T> numeric::MathMatrix< T >::transpose ( const MathMatrix< T > &  MATRIX) [inline]
Returns:
Transposed of Matrix

Referenced by numeric::MathMatrix< core::Real >::inverse_rectangular_matrix().

template<typename T>
MathMatrix< T>& numeric::MathMatrix< T >::transpose ( ) [inline]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines