MechSys  1.0
Computing library for simulations in continuum and discrete mechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Public Attributes
LinAlg::Matrix< Value_T > Class Template Reference

#include <matrix.h>

List of all members.

Public Member Functions

 Matrix ()
 Default constructor.
 Matrix (int Rows, int Cols)
 Constructor setting Rows and Cols.
 Matrix (Matrix< Value_T > const &Other)
 Copy constructor.
 ~Matrix ()
int Rows () const
 Returns the number of rows of this matrix.
int Cols () const
 Returns the number of columns of this matrix.
size_t num_rows () const
size_t num_cols () const
Value_T const * GetPtr () const
 Returns a pointer to the values, that cannot be modified, of this matrix.
Value_T * GetPtr ()
 Returns a pointer to the values of this matrix.
void Resize (int Rows, int Cols)
 Resize this matrix AND fill with ZERO values.
void change_dim (int Rows, int Cols)
void SetValues (Value_T Value)
 Set all values equal to a given Value.
void operator= (Matrix< Value_T > const &R)
 Assignment operator.
void operator+= (Matrix< Value_T > const &R)
 Plus-assignment operator.
void operator-= (Matrix< Value_T > const &R)
 Minus-assignment operator.
void operator/= (Value_T const &Scalar)
 Division operator.
void operator*= (Value_T const &Scalar)
 Multiplication operator.
Value_T & operator() (int i, int j)
 Write ij value of matrix.
const Value_T & operator() (int i, int j) const
 Read ij value of matrix.

Public Attributes

Value_T * data

Detailed Description

template<typename Value_T>
class LinAlg::Matrix< Value_T >

Dense matrix.

Note: The values are internally saved in Column-Major order, thus, the method GetPtr() may be passed to a FORTRAN-style routine with no problems.

Examples:


Constructor & Destructor Documentation

template<typename Value_T>
LinAlg::Matrix< Value_T >::Matrix ( ) [inline]

Default constructor.

template<typename Value_T >
LinAlg::Matrix< Value_T >::Matrix ( int  Rows,
int  Cols 
) [inline]

Constructor setting Rows and Cols.

template<typename Value_T>
LinAlg::Matrix< Value_T >::Matrix ( Matrix< Value_T > const &  Other) [inline]

Copy constructor.

template<typename Value_T>
LinAlg::Matrix< Value_T >::~Matrix ( ) [inline]

Destructor.


Member Function Documentation

template<typename Value_T>
void LinAlg::Matrix< Value_T >::change_dim ( int  Rows,
int  Cols 
) [inline]
template<typename Value_T >
int LinAlg::Matrix< Value_T >::Cols ( ) const [inline]

Returns the number of columns of this matrix.

template<typename Value_T >
const Value_T * LinAlg::Matrix< Value_T >::GetPtr ( ) const [inline]

Returns a pointer to the values, that cannot be modified, of this matrix.

template<typename Value_T >
Value_T * LinAlg::Matrix< Value_T >::GetPtr ( ) [inline]

Returns a pointer to the values of this matrix.

template<typename Value_T>
size_t LinAlg::Matrix< Value_T >::num_cols ( ) const [inline]
template<typename Value_T>
size_t LinAlg::Matrix< Value_T >::num_rows ( ) const [inline]
template<typename Value_T >
Value_T & LinAlg::Matrix< Value_T >::operator() ( int  i,
int  j 
) [inline]

Write ij value of matrix.

template<typename Value_T >
const Value_T & LinAlg::Matrix< Value_T >::operator() ( int  i,
int  j 
) const [inline]

Read ij value of matrix.

template<typename Value_T>
void LinAlg::Matrix< Value_T >::operator*= ( Value_T const &  Scalar) [inline]

Multiplication operator.

template<typename Value_T>
void LinAlg::Matrix< Value_T >::operator+= ( Matrix< Value_T > const &  R) [inline]

Plus-assignment operator.

template<typename Value_T>
void LinAlg::Matrix< Value_T >::operator-= ( Matrix< Value_T > const &  R) [inline]

Minus-assignment operator.

template<typename Value_T>
void LinAlg::Matrix< Value_T >::operator/= ( Value_T const &  Scalar) [inline]

Division operator.

template<typename Value_T>
void LinAlg::Matrix< Value_T >::operator= ( Matrix< Value_T > const &  R) [inline]

Assignment operator.

template<typename Value_T >
void LinAlg::Matrix< Value_T >::Resize ( int  Rows,
int  Cols 
) [inline]

Resize this matrix AND fill with ZERO values.

template<typename Value_T >
int LinAlg::Matrix< Value_T >::Rows ( ) const [inline]

Returns the number of rows of this matrix.

template<typename Value_T>
void LinAlg::Matrix< Value_T >::SetValues ( Value_T  Value) [inline]

Set all values equal to a given Value.


Member Data Documentation

template<typename Value_T>
Value_T* LinAlg::Matrix< Value_T >::data

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