Public Member Functions | Private Attributes | List of all members
oomph::FixedSizeMatrix< T, NROW, NCOL > Class Template Reference

Class for fixed-size matrix storing NROW x NCOL objects of type T. More...

#include <fixed_size_vector.h>

Public Member Functions

 FixedSizeMatrix ()
 Default constructor.
 
 FixedSizeMatrix (const T &value)
 Construct and fill all entries with specified value.
 
void fill (const T &value)
 Fill all entries with specified value.
 
unsigned nrow () const
 Number of rows.
 
unsigned ncol () const
 Number of columns.
 
T & operator() (const unsigned &i, const unsigned &j)
 Read/write access to (i,j)-th entry.
 
const T & operator() (const unsigned &i, const unsigned &j) const
 Read access to (i,j)-th entry.
 
void initialise (const T &value)
 Fill all entries with specified value.
 

Private Attributes

T Data [NROW *NCOL]
 Matrix entries stored in row-major order.
 

Detailed Description

template<class T, unsigned NROW, unsigned NCOL>
class oomph::FixedSizeMatrix< T, NROW, NCOL >

Class for fixed-size matrix storing NROW x NCOL objects of type T.

No resize or other STL functionality but therefore much less run-time overhead.

Storage is row-major:

(0,0), (0,1), ..., (0,NCOL-1), (1,0), (1,1), ..., (1,NCOL-1), ... (NROW-1,NCOL-1)

Definition at line 166 of file fixed_size_vector.h.

Constructor & Destructor Documentation

◆ FixedSizeMatrix() [1/2]

template<class T , unsigned NROW, unsigned NCOL>
oomph::FixedSizeMatrix< T, NROW, NCOL >::FixedSizeMatrix ( )
inline

Default constructor.

Definition at line 170 of file fixed_size_vector.h.

◆ FixedSizeMatrix() [2/2]

template<class T , unsigned NROW, unsigned NCOL>
oomph::FixedSizeMatrix< T, NROW, NCOL >::FixedSizeMatrix ( const T &  value)
inline

Construct and fill all entries with specified value.

Definition at line 173 of file fixed_size_vector.h.

References oomph::FixedSizeMatrix< T, NROW, NCOL >::fill().

Member Function Documentation

◆ fill()

template<class T , unsigned NROW, unsigned NCOL>
void oomph::FixedSizeMatrix< T, NROW, NCOL >::fill ( const T &  value)
inline

Fill all entries with specified value.

Definition at line 181 of file fixed_size_vector.h.

References i.

Referenced by oomph::FixedSizeMatrix< T, NROW, NCOL >::FixedSizeMatrix().

◆ initialise()

template<class T , unsigned NROW, unsigned NCOL>
void oomph::FixedSizeMatrix< T, NROW, NCOL >::initialise ( const T &  value)
inline

Fill all entries with specified value.

Definition at line 246 of file fixed_size_vector.h.

References i.

◆ ncol()

template<class T , unsigned NROW, unsigned NCOL>
unsigned oomph::FixedSizeMatrix< T, NROW, NCOL >::ncol ( ) const
inline

Number of columns.

Definition at line 196 of file fixed_size_vector.h.

◆ nrow()

template<class T , unsigned NROW, unsigned NCOL>
unsigned oomph::FixedSizeMatrix< T, NROW, NCOL >::nrow ( ) const
inline

Number of rows.

Definition at line 190 of file fixed_size_vector.h.

◆ operator()() [1/2]

template<class T , unsigned NROW, unsigned NCOL>
T & oomph::FixedSizeMatrix< T, NROW, NCOL >::operator() ( const unsigned &  i,
const unsigned &  j 
)
inline

Read/write access to (i,j)-th entry.

Definition at line 202 of file fixed_size_vector.h.

References i.

◆ operator()() [2/2]

template<class T , unsigned NROW, unsigned NCOL>
const T & oomph::FixedSizeMatrix< T, NROW, NCOL >::operator() ( const unsigned &  i,
const unsigned &  j 
) const
inline

Read access to (i,j)-th entry.

Definition at line 224 of file fixed_size_vector.h.

References i.

Member Data Documentation

◆ Data

template<class T , unsigned NROW, unsigned NCOL>
T oomph::FixedSizeMatrix< T, NROW, NCOL >::Data[NROW *NCOL]
private

Matrix entries stored in row-major order.

Definition at line 256 of file fixed_size_vector.h.


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