CiftiLib
A C++ library for CIFTI-2 and CIFTI-1 files
cifti::FloatMatrix Class Reference

#include <FloatMatrix.h>

Public Member Functions

 FloatMatrix (const std::vector< std::vector< float > > &matrixIn)
 construct from a simple vector<vector<float> >
 
 FloatMatrix (const int64_t &rows, const int64_t &cols)
 construct uninitialized with given size
 
FloatMatrixRowRef operator[] (const int64_t &index)
 
ConstFloatMatrixRowRef operator[] (const int64_t &index) const
 
FloatMatrixoperator+= (const FloatMatrix &right)
 
FloatMatrixoperator-= (const FloatMatrix &right)
 
FloatMatrixoperator*= (const FloatMatrix &right)
 
FloatMatrixoperator+= (const float &right)
 
FloatMatrixoperator-= (const float &right)
 
FloatMatrixoperator*= (const float &right)
 
FloatMatrixoperator/= (const float &right)
 
FloatMatrix operator+ (const FloatMatrix &right) const
 
FloatMatrix operator- (const FloatMatrix &right) const
 
FloatMatrix operator- () const
 
FloatMatrix operator* (const FloatMatrix &right) const
 
bool operator== (const FloatMatrix &right) const
 
bool operator!= (const FloatMatrix &right) const
 
FloatMatrix inverse () const
 return the inverse
 
FloatMatrix reducedRowEchelon () const
 return the reduced row echelon form
 
FloatMatrix transpose () const
 return the transpose
 
void resize (const int64_t rows, const int64_t cols, const bool destructive=false)
 resize the matrix - keeps contents within bounds unless destructive is true (destructive is faster)
 
FloatMatrix getRange (const int64_t firstRow, const int64_t afterLastRow, const int64_t firstCol, const int64_t afterLastCol) const
 get the range of values from first until one before afterLast, as a new matrix
 
FloatMatrix concatHoriz (const FloatMatrix &right) const
 return a matrix formed by concatenating right to the right of this
 
FloatMatrix concatVert (const FloatMatrix &bottom) const
 returns a matrix formed by concatenating bottom to the bottom of this
 
void getDimensions (int64_t &rows, int64_t &cols) const
 get the dimensions
 
const std::vector< std::vector< float > > & getMatrix () const
 get the matrix as a vector<vector>
 
void getAffineVectors (Vector3D &xvec, Vector3D &yvec, Vector3D &zvec, Vector3D &offset) const
 separate 3x4 or 4x4 into Vector3Ds, throw on wrong dimensions
 
int64_t getNumberOfRows ()
 get number of rows
 
int64_t getNumberOfColumns ()
 get number of columns
 

Static Public Member Functions

static FloatMatrix zeros (const int64_t rows, const int64_t cols)
 return a matrix of zeros
 
static FloatMatrix ones (const int64_t rows, const int64_t cols)
 return a matrix of ones
 
static FloatMatrix identity (const int64_t rows)
 return square identity matrix
 

Detailed Description

class for using single precision matrices (insulates other code from the MatrixFunctions templated header) errors will result in a matrix of size 0x0, or an assertion failure if the underlying vector<vector> isn't rectangular


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