RepastHPC  2.3.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
repast::Matrix< T > Class Template Referenceabstract

Base class for matrix implementations. More...

#include <matrix.h>

Inheritance diagram for repast::Matrix< T >:
repast::DenseMatrix< T > repast::SparseMatrix< T >

Public Member Functions

 Matrix (const Point< int > &size, const T &defaultValue=T())
 Creates a matrix of the specified size and with the specified default value. More...
 
virtual T & get (const Point< int > &index)=0
 Gets the value at the specified index.
 
virtual void set (const T &value, const Point< int > &index)=0
 Sets the value at the specified index.
 
T & operator[] (const Point< int > &index)
 
const T & operator[] (const Point< int > &index) const
 
const T & defaultValue () const
 Gets the default value of any unset matrix cell.
 
const Point< int > shape () const
 Gets the shape (i.e. More...
 

Protected Member Functions

int calcIndex (const Point< int > &index)
 
void boundsCheck (const Point< int > &index)
 
void create ()
 

Protected Attributes

int * stride
 
defValue
 
Point< int > _size
 
int dCount
 

Detailed Description

template<typename T>
class repast::Matrix< T >

Base class for matrix implementations.

Constructor & Destructor Documentation

◆ Matrix()

template<typename T >
repast::Matrix< T >::Matrix ( const Point< int > &  size,
const T &  defaultValue = T() 
)
explicit

Creates a matrix of the specified size and with the specified default value.

Parameters
sizethe size of the matrix in each dimension

Member Function Documentation

◆ shape()

template<typename T >
const Point<int> repast::Matrix< T >::shape ( ) const
inline

Gets the shape (i.e.

the length of each dimensions) of the matrix.


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