Graphitti
A toolkit/software architecture to ease creating high-performance neural network simulators
Loading...
Searching...
No Matches
Matrix Class Referenceabstract
Inheritance diagram for Matrix:
Collaboration diagram for Matrix:

Public Member Functions

virtual ~Matrix ()=default
 Virtual Destructor.
 
virtual void Print (ostream &os) const =0
 Generate text representation of the Matrix to a stream.
 
template<class Archive >
void serialize (Archive &archive)
 Cereal serialization method.
 
- Public Member Functions inherited from RecordableBase
virtual int getNumElements () const =0
 Get the number of elements that needs to be recorded.
 
virtual variantTypes getElement (int index) const =0
 
virtual void startNewEpoch ()=0
 
virtual void setDataType ()=0
 Set up a string representing the basic data type.
 
virtual const string & getDataType () const =0
 
template<class Archive >
void serialize (Archive &archive)
 Cereal serialization method.
 

Protected Member Functions

 Matrix (string t="", string i="", int r=0, int c=0, BGFLOAT m=0.0)
 
void SetAttributes (string t, string i, int r, int c, BGFLOAT m, int d)
 Convenience mutator.
 
- Protected Member Functions inherited from RecordableBase
 RecordableBase ()=default
 prevents any code outside this class from creating a RecordableBase object
 

Protected Attributes

string type
 
string init
 
int rows
 Number of rows in Matrix (>0)
 
int columns
 Number of columns in Matrix (>0)
 
BGFLOAT multiplier
 Constant used for initialization.
 
int dimensions
 One or two dimensional.
 
- Protected Attributes inherited from RecordableBase
std::string basicDataType_
 the basic data type in the recorded variable
 

Friends

class cereal::access
 

Detailed Description

Definition at line 30 of file Matrix.h.

Constructor & Destructor Documentation

◆ Matrix()

Matrix::Matrix ( string t = "",
string i = "",
int r = 0,
int c = 0,
BGFLOAT m = 0.0 )
protected

Initialize attributes at construction time. This is protected to prevent construction of Matrix objects themselves. Would be nice if C++ just allowed one to declare a class abstract. Really obsoleted since the Print() method is pure virtual now.

Parameters
tMatrix type (subclasses add legal values; basically, cheapo reflection)
iMatrix initialization (subclasses can also add legal values to this)
rrows in Matrix
ccolumns in Matrix
mmultiplier used for initialization

Definition at line 24 of file Matrix.cpp.

Member Function Documentation

◆ Print()

virtual void Matrix::Print ( ostream & os) const
pure virtual

Generate text representation of the Matrix to a stream.

Implemented in CompleteMatrix, SparseMatrix, and VectorMatrix.

◆ serialize()

template<class Archive >
void Matrix::serialize ( Archive & archive)

Cereal serialization method.

Definition at line 97 of file Matrix.h.

◆ SetAttributes()

void Matrix::SetAttributes ( string t,
string i,
int r,
int c,
BGFLOAT m,
int d )
protected

Convenience mutator.

Parameters
tMatrix type (subclasses add legal values; basically, cheapo reflection)
iMatrix initialization (subclasses can also add legal values to this)
rrows in Matrix
ccolumns in Matrix
mmultiplier used for initialization
dindicates one or two dimensional

Definition at line 37 of file Matrix.cpp.

Friends And Related Symbol Documentation

◆ cereal::access

friend class cereal::access
friend

Definition at line 31 of file Matrix.h.

Member Data Documentation

◆ columns

int Matrix::columns
protected

Number of columns in Matrix (>0)

Definition at line 81 of file Matrix.h.

◆ dimensions

int Matrix::dimensions
protected

One or two dimensional.

Definition at line 83 of file Matrix.h.

◆ init

string Matrix::init
protected

"const" == nonzero values with a fixed constant, "random" == nonzero values with random numbers, or "implementation" == uses a built-in function of the specific subclass

Definition at line 78 of file Matrix.h.

◆ multiplier

BGFLOAT Matrix::multiplier
protected

Constant used for initialization.

Definition at line 82 of file Matrix.h.

◆ rows

int Matrix::rows
protected

Number of rows in Matrix (>0)

Definition at line 80 of file Matrix.h.

◆ type

string Matrix::type
protected

"complete" == all locations nonzero, "diag" == only diagonal elements nonzero, or "sparse" == nonzero values may be anywhere

Definition at line 73 of file Matrix.h.


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