Cypress  1.0
C++ Spiking Neural Network Simulation Framework
Public Member Functions | List of all members
cypress::Vector< T > Class Template Reference

#include <matrix.hpp>

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

Public Member Functions

 Vector ()
 
 Vector (size_t s, MatrixFlags flags=MatrixFlags::NONE)
 
 Vector (std::initializer_list< T > init)
 
void resize (size_t s)
 
 operator std::vector< T > () const
 
bool operator== (const Matrix< T > &o) const
 
Matrix< T > & fill (const T &val)
 
T * begin (size_t row=0)
 
const T * begin (size_t row=0) const
 
T * end ()
 
const T * end () const
 
const T * cbegin (size_t row=0) const
 
const T * cend () const
 
T & operator() (size_t row, size_t col)
 
const T & operator() (size_t row, size_t col) const
 
T & operator() (size_t i)
 
const T & operator() (size_t i) const
 
T & operator[] (size_t i)
 
const T & operator[] (size_t i) const
 
size_t rows () const
 
size_t cols () const
 
size_t size () const
 
void resize (size_t rows, size_t cols)
 
void reshape (size_t rows, size_t cols)
 
T * data ()
 
const T * data () const
 
bool empty () const
 
Matrix submatrix (size_t row, size_t col) const
 Returns the submatrix not containing specified row and column. More...
 
determinant () const
 Calculate the determinant of this matrix. Note that the type of the returned value is of the same type as the matrix, which might be a problem for unsigned types! Only valid for squared matrices! More...
 
Matrix adjugate () const
 Calculates the adjugate/adjunct matrix. As for the determinant, this runs into issues with unsigned types and works only for squared matrices! More...
 
Matrix< double > inverse () const
 Calculates the inverse of the matrix. As for the determinant, this runs into issues with unsigned types and works only for squared matrices! Note that the type of the returned matrix is always double! Throws if matrix is not invertible! More...
 

Constructor & Destructor Documentation

template<typename T >
cypress::Vector< T >::Vector ( )
inline
template<typename T >
cypress::Vector< T >::Vector ( size_t  s,
MatrixFlags  flags = MatrixFlags::NONE 
)
inline
template<typename T >
cypress::Vector< T >::Vector ( std::initializer_list< T >  init)
inline

Member Function Documentation

template<typename T>
Matrix cypress::Matrix< T >::adjugate ( ) const
inlineinherited

Calculates the adjugate/adjunct matrix. As for the determinant, this runs into issues with unsigned types and works only for squared matrices!

Returns
Matrix< T > Adjugate matrix.
template<typename T>
T* cypress::Matrix< T >::begin ( size_t  row = 0)
inlineinherited
template<typename T>
const T* cypress::Matrix< T >::begin ( size_t  row = 0) const
inlineinherited
template<typename T>
const T* cypress::Matrix< T >::cbegin ( size_t  row = 0) const
inlineinherited
template<typename T>
const T* cypress::Matrix< T >::cend ( ) const
inlineinherited
template<typename T>
size_t cypress::Matrix< T >::cols ( ) const
inlineinherited

Returns the height of the matrix.

template<typename T>
T* cypress::Matrix< T >::data ( )
inlineinherited

Returns a pointer at the raw data buffer.

template<typename T>
const T* cypress::Matrix< T >::data ( ) const
inlineinherited

Returns a const pointer at the raw data.

template<typename T>
T cypress::Matrix< T >::determinant ( ) const
inlineinherited

Calculate the determinant of this matrix. Note that the type of the returned value is of the same type as the matrix, which might be a problem for unsigned types! Only valid for squared matrices!

Returns
Value of the determinant.
template<typename T>
bool cypress::Matrix< T >::empty ( ) const
inlineinherited

Returns true if the matrix contains no data.

template<typename T>
T* cypress::Matrix< T >::end ( )
inlineinherited
template<typename T>
const T* cypress::Matrix< T >::end ( ) const
inlineinherited
template<typename T>
Matrix<T>& cypress::Matrix< T >::fill ( const T &  val)
inlineinherited

Fills the matrix with the given value.

template<typename T>
Matrix<double> cypress::Matrix< T >::inverse ( ) const
inlineinherited

Calculates the inverse of the matrix. As for the determinant, this runs into issues with unsigned types and works only for squared matrices! Note that the type of the returned matrix is always double! Throws if matrix is not invertible!

Returns
cypress::Matrix< double > The inverse.
template<typename T>
cypress::Matrix< T >::operator std::vector< T > ( ) const
inlineinherited

Conversion to a std::vector

template<typename T>
T& cypress::Matrix< T >::operator() ( size_t  row,
size_t  col 
)
inlineinherited

Returns a reference at the element at position row and col.

template<typename T>
const T& cypress::Matrix< T >::operator() ( size_t  row,
size_t  col 
) const
inlineinherited

Returns a const reference at the element at position row and col.

template<typename T>
T& cypress::Matrix< T >::operator() ( size_t  i)
inlineinherited

Returns a reference at the i-th element.

template<typename T>
const T& cypress::Matrix< T >::operator() ( size_t  i) const
inlineinherited

Returns a const reference at the i-th element.

template<typename T>
bool cypress::Matrix< T >::operator== ( const Matrix< T > &  o) const
inlineinherited

Tests equality between two matrices.

Parameters
ois the matrix to which this matrix should be compared.
template<typename T>
T& cypress::Matrix< T >::operator[] ( size_t  i)
inlineinherited

Returns a copy of the i-th element.

template<typename T>
const T& cypress::Matrix< T >::operator[] ( size_t  i) const
inlineinherited

Returns a copy of the i-th element.

template<typename T>
void cypress::Matrix< T >::reshape ( size_t  rows,
size_t  cols 
)
inlineinherited

Reshapes the matrix if rows * cols does not change. Otherwise flushes all previously stored data, does nothing if the dimensions do not change.

template<typename T>
void cypress::Matrix< T >::resize ( size_t  rows,
size_t  cols 
)
inlineinherited

Resizes the matrix, flushes all previously stored data, does nothing if the dimensions do not change.

template<typename T >
void cypress::Vector< T >::resize ( size_t  s)
inline
template<typename T>
size_t cypress::Matrix< T >::rows ( ) const
inlineinherited

Returns the width of the matrix.

template<typename T>
size_t cypress::Matrix< T >::size ( ) const
inlineinherited

Returns the size of the matrix.

template<typename T>
Matrix cypress::Matrix< T >::submatrix ( size_t  row,
size_t  col 
) const
inlineinherited

Returns the submatrix not containing specified row and column.

Parameters
rowrow to delete
colcolumn to delete
Returns
Matrix< T > submatrix with deleted row and column

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