|
virtual unsigned int | getSize () const final |
|
virtual T & | at (const m_num, const m_num) final |
|
virtual T | get (const m_num, const m_num) const final |
|
virtual SNline< T, tp_size > | getSNline (m_num l) const |
|
template<class V , unsigned int s> |
void | subtract (const SNgeneric< V, s > &) |
|
template<class V , unsigned int s> |
void | subtract (const SNgaussian< V, s > &) |
|
SNgaussian< T, tp_size > | getGaussian (const m_num c) const |
|
template<class V , unsigned int s> |
bool | isNumericallyEqual (const SNgeneric< V, s > &A, const double &epsilon) const |
|
template<class T, unsigned int tp_size>
class SNgeneric< T, tp_size >
This is the base class for the other matrices types.
A matrix can be
- diagonal
- upper/lower triangular
- a gaussian transformation
- symmetric
- etc.
Each of these types have different implementations for storing the elements, perform equality tests (opertor==
), multiplication (operator*
) and so on.
What you need in your subclass :
- override
T _get
_get(i,j)
has to return the value of the element (i,j) of your matrix.
- override
T& _at
_at(i,j)
has to return a reference to the element (i,j) of your matrix.
- In consequence,
_at(i,j)
should throw 'SNchangeNotAllowedException' if the requested element cannot be modified. For example requesting the element (1,4) of a lower triangular matrix.
_at
is intended to populate the matrix.
As an example, on a lower diagonal matrix,
template<class T , unsigned int tp_size>
template<class V , unsigned int s>
bool SNgeneric< T, tp_size >::isNumericallyEqual |
( |
const SNgeneric< V, s > & |
A, |
|
|
const double & |
epsilon |
|
) |
| const |
numerical equality test 'up to epsilon'. If the max norm of "this-A" is strictly larger than epsilon, return false. Else return true.
For this reason, the template parameter T
has to support std::abs