NPL
Neurological Programs and Libraries
npl::Matrix< D1, D2 > Class Template Reference

#include <matrix_deprecated.h>

Inherits npl::MatrixP.

Public Member Functions

 Matrix ()
 Default constructor, sets the matrix to the identity matrix. More...
 
 Matrix (double v)
 Constructor, sets the entire matrix to the given constant. More...
 
 Matrix (size_t l, const double *v)
 Initialize a matrix from array of length l, made up of an array at v*. Missing values are assumed to be 0, extra values ignored. More...
 
 Matrix (size_t l, const int64_t *v)
 Initialize a matrix from array of length l, made up of an array at v*. Missing values are assumed to be 0, extra values ignored. More...
 
 Matrix (std::initializer_list< double > v)
 Initialize matrix with vector, any missing values will be assumed zero, extra values are ignored. More...
 
 Matrix (const std::vector< double > &v)
 Initialize matrix with vector, any missing values will be assumed zero, extra values are ignored. More...
 
 Matrix (const std::vector< size_t > &v)
 Initialize matrix with vector, any missing values will be assumed zero, extra values are ignored. More...
 
 Matrix (const std::vector< int64_t > &v)
 Initialize matrix with vector, any missing values will be assumed zero, extra values are ignored. More...
 
 Matrix (const Matrix &m)
 Copy constructor, copies all the elements of the other vector. More...
 
double & operator[] (size_t row)
 Returns row in column 0. More...
 
double & operator() (size_t row, size_t col=0)
 Returns value at given row/column. More...
 
const double & operator[] (size_t row) const
 Returns row in column 0. More...
 
const double & operator() (size_t row, size_t col=0) const
 Returns value at given row/column. More...
 
void mvproduct (const MatrixP *rhs, MatrixP *out) const
 Performs matrix-vector product of right hand side (rhs) and the current matrix, writing the result in out. RHS and OUT are cast to the appropriate types (dimensions). Will throw if the dimension requirements are not met. More...
 
void mvproduct (const MatrixP &rhs, MatrixP &out) const
 Performs matrix-vector product of right hand side (rhs) and the current matrix, writing the result in out. RHS and OUT are cast to the appropriate types (dimensions). Will throw if the dimension requirements are not met. More...
 
virtual double det () const
 
virtual double norm () const
 
virtual double sum () const
 
size_t rows () const
 
size_t cols () const
 
bool operator== (const MatrixP &rhs)
 
bool operator!= (const MatrixP &rhs)
 

Detailed Description

template<int D1, int D2>
class npl::Matrix< D1, D2 >

Definition at line 119 of file matrix_deprecated.h.

Constructor & Destructor Documentation

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( )
inline

Default constructor, sets the matrix to the identity matrix.

Definition at line 126 of file matrix_deprecated.h.

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( double  v)
inline

Constructor, sets the entire matrix to the given constant.

Parameters
vconstant to set all elements to

Definition at line 140 of file matrix_deprecated.h.

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( size_t  l,
const double *  v 
)
inline

Initialize a matrix from array of length l, made up of an array at v*. Missing values are assumed to be 0, extra values ignored.

Parameters
llength of v
vvector of data

Definition at line 155 of file matrix_deprecated.h.

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( size_t  l,
const int64_t *  v 
)
inline

Initialize a matrix from array of length l, made up of an array at v*. Missing values are assumed to be 0, extra values ignored.

Parameters
llength of v
vvector of data

Definition at line 174 of file matrix_deprecated.h.

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( std::initializer_list< double >  v)
inline

Initialize matrix with vector, any missing values will be assumed zero, extra values are ignored.

Parameters
vInput data vector

Definition at line 192 of file matrix_deprecated.h.

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( const std::vector< double > &  v)
inline

Initialize matrix with vector, any missing values will be assumed zero, extra values are ignored.

Parameters
vInput data vector

Definition at line 212 of file matrix_deprecated.h.

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( const std::vector< size_t > &  v)
inline

Initialize matrix with vector, any missing values will be assumed zero, extra values are ignored.

Parameters
vInput data vector

Definition at line 230 of file matrix_deprecated.h.

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( const std::vector< int64_t > &  v)
inline

Initialize matrix with vector, any missing values will be assumed zero, extra values are ignored.

Parameters
vInput data vector

Definition at line 248 of file matrix_deprecated.h.

template<int D1, int D2>
npl::Matrix< D1, D2 >::Matrix ( const Matrix< D1, D2 > &  m)
inline

Copy constructor, copies all the elements of the other vector.

Parameters
m

Definition at line 265 of file matrix_deprecated.h.

Member Function Documentation

template<int D1, int D2>
size_t npl::Matrix< D1, D2 >::cols ( ) const
inlinevirtual

Implements npl::MatrixP.

Definition at line 361 of file matrix_deprecated.h.

template<int D1, int D2>
double npl::Matrix< D1, D2 >::det ( ) const
virtual

Implements npl::MatrixP.

Definition at line 708 of file matrix_deprecated.h.

template<int D1, int D2>
void npl::Matrix< D1, D2 >::mvproduct ( const MatrixP rhs,
MatrixP out 
) const
virtual

Performs matrix-vector product of right hand side (rhs) and the current matrix, writing the result in out. RHS and OUT are cast to the appropriate types (dimensions). Will throw if the dimension requirements are not met.

Parameters
rhsRight hand side of matrix-vector product
outOutput of matrix-vector product

Implements npl::MatrixP.

Definition at line 377 of file matrix_deprecated.h.

template<int D1, int D2>
void npl::Matrix< D1, D2 >::mvproduct ( const MatrixP rhs,
MatrixP out 
) const
virtual

Performs matrix-vector product of right hand side (rhs) and the current matrix, writing the result in out. RHS and OUT are cast to the appropriate types (dimensions). Will throw if the dimension requirements are not met.

Parameters
rhsRight hand side of matrix-vector product
outOutput of matrix-vector product

Implements npl::MatrixP.

Definition at line 398 of file matrix_deprecated.h.

template<int D1, int D2>
double npl::Matrix< D1, D2 >::norm ( ) const
virtual

Implements npl::MatrixP.

Definition at line 702 of file matrix_deprecated.h.

bool npl::MatrixP::operator!= ( const MatrixP rhs)
inlineinherited

Definition at line 112 of file matrix_deprecated.h.

template<int D1, int D2>
double& npl::Matrix< D1, D2 >::operator() ( size_t  row,
size_t  col = 0 
)
inlinevirtual

Returns value at given row/column.

Parameters
rowRow to lookup
colCol to lookup
Returns
Value at (row,col)

Implements npl::MatrixP.

Definition at line 295 of file matrix_deprecated.h.

template<int D1, int D2>
const double& npl::Matrix< D1, D2 >::operator() ( size_t  row,
size_t  col = 0 
) const
inlinevirtual

Returns value at given row/column.

Parameters
rowRow to lookup
colCol to lookup
Returns
Value at (row,col)

Implements npl::MatrixP.

Definition at line 322 of file matrix_deprecated.h.

bool npl::MatrixP::operator== ( const MatrixP rhs)
inlineinherited

Definition at line 98 of file matrix_deprecated.h.

template<int D1, int D2>
double& npl::Matrix< D1, D2 >::operator[] ( size_t  row)
inlinevirtual

Returns row in column 0.

Parameters
rowRow to lookup
Returns
Value at (row,0)

Implements npl::MatrixP.

Definition at line 281 of file matrix_deprecated.h.

template<int D1, int D2>
const double& npl::Matrix< D1, D2 >::operator[] ( size_t  row) const
inlinevirtual

Returns row in column 0.

Parameters
rowRow to lookup
Returns
Value at (row,0)

Implements npl::MatrixP.

Definition at line 308 of file matrix_deprecated.h.

template<int D1, int D2>
size_t npl::Matrix< D1, D2 >::rows ( ) const
inlinevirtual

Implements npl::MatrixP.

Definition at line 360 of file matrix_deprecated.h.

template<int D1, int D2>
double npl::Matrix< D1, D2 >::sum ( ) const
virtual

Implements npl::MatrixP.

Definition at line 722 of file matrix_deprecated.h.


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