Hex  1.0
Hydrogen-electron collision solver
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions
RowMatrix< T > Class Template Reference

Dense (row-oriented) matrix. More...

#include <matrix.h>

Inheritance diagram for RowMatrix< T >:
Inheritance graph
[legend]
Collaboration diagram for RowMatrix< T >:
Collaboration graph
[legend]

Public Member Functions

 RowMatrix ()
 
 RowMatrix (int size)
 
 RowMatrix (int rows, int cols)
 
 RowMatrix (int rows, int cols, const ArrayView< Type > data)
 
 RowMatrix (ColMatrix< Type > const &m)
 
 RowMatrix (DenseMatrix< Type > const &M)
 
template<class Function >
void populate (Function f)
 Populator. More...
 
template<class Function >
void transform (Function f)
 Transformator. More...
 
ColMatrix< Type > T () const
 Matrix transpose. More...
 
Type operator() (const ArrayView< Type > u, const ArrayView< Type > v) const
 Bilinear form. More...
 
RowMatrix< Type > const & operator+= (DenseMatrix< Type > const &A)
 
RowMatrix< Type > const & operator-= (DenseMatrix< Type > const &A)
 
RowMatrix< Type > const & operator*= (Type x)
 
void write (std::ostream &out, std::string const &pre="", std::string const &pos="") const
 Output to file. More...
 
void plot_abs (std::ofstream &out) const
 Plot to PNG file. More...
 
ArrayView< Type > row (int i)
 Matrix row. More...
 
const ArrayView< Type > row (int i) const
 
Type operator() (int i, int j) const
 Element access. More...
 
Type & operator() (int i, int j)
 
- Public Member Functions inherited from DenseMatrix< Type >
 DenseMatrix ()
 
 DenseMatrix (int rows, int cols)
 
 DenseMatrix (int rows, int cols, const ArrayView< Type > data)
 
ArrayView< Type > data ()
 
const ArrayView< Type > data () const
 
size_t size () const
 
int cols () const
 
int rows () const
 
Type * begin ()
 
Typeconst * begin () const
 

Static Public Member Functions

static RowMatrix< Type > Eye (int size)
 Identity matrix. More...
 

Detailed Description

template<class T>
class RowMatrix< T >

This class represents a generally non-symmetric dense matrix. It is an encapsulation of the cArray class with some operators bundled to it.

Constructor & Destructor Documentation

template<class T>
RowMatrix< T >::RowMatrix ( )
inline
template<class T>
RowMatrix< T >::RowMatrix ( int  size)
inline
template<class T>
RowMatrix< T >::RowMatrix ( int  rows,
int  cols 
)
inline
template<class T>
RowMatrix< T >::RowMatrix ( int  rows,
int  cols,
const ArrayView< Type >  data 
)
inline
template<class T>
RowMatrix< T >::RowMatrix ( ColMatrix< Type > const &  m)
inline
template<class T>
RowMatrix< T >::RowMatrix ( DenseMatrix< Type > const &  M)
inlineexplicit

Member Function Documentation

template<class T>
static RowMatrix<Type> RowMatrix< T >::Eye ( int  size)
inlinestatic
template<class T>
Type RowMatrix< T >::operator() ( int  i,
int  j 
) const
inline
template<class T>
Type& RowMatrix< T >::operator() ( int  i,
int  j 
)
inline
template<class T>
Type RowMatrix< T >::operator() ( const ArrayView< Type >  u,
const ArrayView< Type >  v 
) const
inline

This function computes the scalar product

\[ u^T \mathsf{A} v \ . \]

template<class T>
RowMatrix<Type> const& RowMatrix< T >::operator*= ( Type  x)
inline
template<class T>
RowMatrix<Type> const& RowMatrix< T >::operator+= ( DenseMatrix< Type > const &  A)
inline
template<class T>
RowMatrix<Type> const& RowMatrix< T >::operator-= ( DenseMatrix< Type > const &  A)
inline
template<class T>
void RowMatrix< T >::plot_abs ( std::ofstream &  out) const
inline

This will write PNG file data to a supplied stream. The data written are the gray-scale representation of the absolute values of the dense matrix entries.

Note
This function uses PNG++ and can be disables if the macro NO_PNG is defined.
template<class T>
template<class Function >
void RowMatrix< T >::populate ( Function  f)
inline

This method accepts a function object that is called for every matrix element. Use functions with signature

double (*) (int i, int j);
template<class T>
ArrayView<Type> RowMatrix< T >::row ( int  i)
inline

Return shallow copy of a matrix row.

template<class T>
const ArrayView<Type> RowMatrix< T >::row ( int  i) const
inline
template<class T>
ColMatrix<Type> RowMatrix< T >::T ( ) const
inline

Return transposed matrix. The result is of the type ColMatrix, so that no reordering of the entries is necessary.

template<class T>
template<class Function >
void RowMatrix< T >::transform ( Function  f)
inline

This method accepts a function object that is called for every matrix element. Use functions with signature

void (*) (int i, int j, T& x);
template<class T>
void RowMatrix< T >::write ( std::ostream &  out,
std::string const &  pre = "",
std::string const &  pos = "" 
) const
inline

Write matrix to a text file. The format is influenced by the "pre" and "pos" characters supplied to the routine. The "pre" string will be present on the beginning of every row of the matrix, the "pos" string on the end. For example, the call

* 2, 2, rArray({1., 2., -2., 1.})
* ).write (std::cout, "[", "]")
*

will result in the following output to the STDOUT:

*     [ 1 2 ]
*     [-2 1 ]
* 

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