hdnum::Matrix< T > Class Template Reference

A flexible matrix class. More...

#include <matrix.hh>

List of all members.

Public Types

typedef T value_type
 Remember the storage type.
typedef value_typereference
 Reference to an object.
typedef const value_typeconst_reference
 Const reference to an object.
typedef std::size_t size_type
 Type used for array indices.
typedef std::ptrdiff_t difference_type
 Difference type.

Public Member Functions

 Matrix ()
 make empty matrix
 Matrix (size_type _m, size_type _n)
 make _m x _n matrix uninitialized
 Matrix (size_type _m, size_type _n, const T &_t)
 make _m x _n matrix initialized
 Matrix (const Matrix &A)
 copy constructor with reference semantics
Matrixoperator= (const Matrix &A)
 assignment operator with reference semantics
Matrixoperator= (const T &t)
 assignment from scalar
Matrix< T > sub (size_type i, size_type j, size_type rows, size_type cols)
 submatrix extraction
T * operator[] (size_type i)
 Component access.
const T * operator[] (size_type i) const
 Component access.
Matrixoperator+= (const Matrix &B)
 Addition assignment.
Matrixoperator-= (const Matrix &B)
 Subtraction assignment.
Matrixoperator*= (const T &s)
 Scalar multiplication assignment.
Matrixoperator/= (const T &s)
 Scalar division assignment.
void update (const T &s, const Matrix &B)
 Scaled update of a Matrix.
template<class V>
void mv (Vector< V > &y, const Vector< V > &x) const
 matrix vector product y = A*x
template<class V>
void umv (Vector< V > &y, const Vector< V > &x) const
 update matrix vector product y += A*x
template<class V>
void umv (Vector< V > &y, const V &s, const Vector< V > &x) const
 update matrix vector product y += A*x
void mm (const Matrix< T > &A, const Matrix< T > &B)
 matrix matrix product C = A*B
void umm (const Matrix< T > &A, const Matrix< T > &B)
 matrix matrix product C += A*B
void sc (const Vector< T > &x, size_type k)
 set column: make x the k'th column of A
void sr (const Vector< T > &x, size_type k)
 set row: make x the k'th row of A
norm_infty () const
 compute row sum norm
norm_1 () const
 compute column sum norm
size_type rowsize () const
 get number of rows
size_type colsize () const
 get number of columns
int iwidth () const
 get index field width for pretty-printing
int width () const
 get data field width for pretty-printing
int precision () const
 get data precision for pretty-printing
void iwidth (int i) const
 set index field width for pretty-printing
void width (int i) const
 set data field width for pretty-printing
void precision (int i) const
 set data precision for pretty-printing


Detailed Description

template<class T>
class hdnum::Matrix< T >

A flexible matrix class.

Matrix is implemented as a handle to a dynamically allocated array. Copy and assignement operators have reference semantics. In order to make a true copy the function "copy" can be used.


Member Function Documentation

template<class T>
Matrix& hdnum::Matrix< T >::operator+= ( const Matrix< T > &  B  )  [inline]

Addition assignment.

Implements A += B matrix addition

Parameters:
[in] B another Matrix

template<class T>
Matrix& hdnum::Matrix< T >::operator-= ( const Matrix< T > &  B  )  [inline]

Subtraction assignment.

Implements A -= B matrix subtraction

Parameters:
[in] B another matrix

template<class T>
Matrix& hdnum::Matrix< T >::operator*= ( const T &  s  )  [inline]

Scalar multiplication assignment.

Implements A *= s where s is a scalar

Parameters:
[in] s scalar value to multiply with vector scalar multiplication

template<class T>
Matrix& hdnum::Matrix< T >::operator/= ( const T &  s  )  [inline]

Scalar division assignment.

Implements A /= s where s is a scalar

Parameters:
[in] s scalar value to multiply with vector scalar multiplication

template<class T>
void hdnum::Matrix< T >::update ( const T &  s,
const Matrix< T > &  B 
) [inline]

Scaled update of a Matrix.

Implements A += s*B where s is a scalar and B a matrix

Parameters:
[in] s scalar value to multiply with
[in] B another matrix


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

Generated on Thu Nov 5 11:47:02 2009 for Heidelberg Educational Numerics Library by  doxygen 1.5.5