Cerata
A library to generate structural hardware designs
cerata::MappingMatrix< T > Class Template Reference

A matrix used for TypeMapper. More...

#include <flattype.h>

Public Member Functions

 MappingMatrix (int64_t height, int64_t width)
 Construct a mapping matrix. More...
 
int64_t height ()
 Return the height of the matrix.
 
int64_t width ()
 Return the width of the matrix.
 
T & get (int64_t y, int64_t x)
 Return a reference to a value in the matrix at some index.
 
const T & get (int64_t y, int64_t x) const
 Return a const references to a value in the matrix at some index.
 
T & operator() (int64_t y, int64_t x)
 Return a reference to a value in the matrix at some index.
 
const T & operator() (int64_t y, int64_t x) const
 Return a const references to a value in the matrix at some index.
 
bool IsIdentity () const
 Return true if this is an identity matrix.
 
MaxOfColumn (int64_t x) const
 Return the maximum of some column.
 
MaxOfRow (int64_t y) const
 Return the maximum of some row.
 
std::vector< std::pair< int64_t, T > > mapping_column (int64_t x)
 Obtain non-zero element indices and value from column x, sorted by value.
 
std::vector< std::pair< int64_t, T > > mapping_row (int64_t y)
 Obtain non-zero element indices and value from row y, sorted by value.
 
MappingMatrixSetNext (int64_t y, int64_t x)
 Set the next (existing maximum + 1) value in a matrix at some position.
 
MappingMatrix Transpose () const
 Transpose the matrix.
 
MappingMatrix Empty () const
 Create an empty matrix of the same size.
 
std::string ToString ()
 

Static Public Member Functions

static MappingMatrix Identity (int64_t dim)
 Return a square identity matrix.
 

Detailed Description

template<typename T>
class cerata::MappingMatrix< T >

A matrix used for TypeMapper.

Template Parameters
TThe type of matrix elements.

Definition at line 109 of file flattype.h.

Constructor & Destructor Documentation

◆ MappingMatrix()

template<typename T >
cerata::MappingMatrix< T >::MappingMatrix ( int64_t  height,
int64_t  width 
)
inline

Construct a mapping matrix.

Parameters
heightThe height of the matrix.
widthThe width of the matrix.

Definition at line 116 of file flattype.h.

Member Function Documentation

◆ ToString()

template<typename T >
std::string cerata::MappingMatrix< T >::ToString ( )
inline
Returns
Return a human-readable representation of the matrix.

Definition at line 248 of file flattype.h.


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