1#ifndef __FLOAT_MATRIX_H__
2#define __FLOAT_MATRIX_H__
39 const std::vector<float>& m_row;
44 const float& operator[](
const int64_t& index);
50 std::vector<float>& m_row;
58 float& operator[](
const int64_t& index);
65 std::vector<std::vector<float> > m_matrix;
66 bool checkDimensions()
const;
70 FloatMatrix(
const std::vector<std::vector<float> >& matrixIn);
72 FloatMatrix(
const int64_t& rows,
const int64_t& cols);
95 void resize(
const int64_t rows,
const int64_t cols,
const bool destructive =
false);
103 FloatMatrix getRange(
const int64_t firstRow,
const int64_t afterLastRow,
const int64_t firstCol,
const int64_t afterLastCol)
const;
111 const std::vector<std::vector<float> >&
getMatrix()
const;
119 if (m_matrix.size() == 0)
return 0;
120 return (int64_t)m_matrix[0].size();
Definition: FloatMatrix.h:38
Definition: FloatMatrix.h:49
Definition: FloatMatrix.h:64
const std::vector< std::vector< float > > & getMatrix() const
get the matrix as a vector<vector>
Definition: FloatMatrix.cxx:255
void getDimensions(int64_t &rows, int64_t &cols) const
get the dimensions
Definition: FloatMatrix.cxx:197
static FloatMatrix identity(const int64_t rows)
return square identity matrix
Definition: FloatMatrix.cxx:101
FloatMatrix inverse() const
return the inverse
Definition: FloatMatrix.cxx:108
static FloatMatrix zeros(const int64_t rows, const int64_t cols)
return a matrix of zeros
Definition: FloatMatrix.cxx:241
FloatMatrix concatVert(const FloatMatrix &bottom) const
returns a matrix formed by concatenating bottom to the bottom of this
Definition: FloatMatrix.cxx:87
int64_t getNumberOfRows()
get number of rows
Definition: FloatMatrix.h:115
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)
Definition: FloatMatrix.cxx:229
void getAffineVectors(Vector3D &xvec, Vector3D &yvec, Vector3D &zvec, Vector3D &offset) const
separate 3x4 or 4x4 into Vector3Ds, throw on wrong dimensions
Definition: FloatMatrix.cxx:260
FloatMatrix reducedRowEchelon() const
return the reduced row echelon form
Definition: FloatMatrix.cxx:222
int64_t getNumberOfColumns()
get number of columns
Definition: FloatMatrix.h:117
static FloatMatrix ones(const int64_t rows, const int64_t cols)
return a matrix of ones
Definition: FloatMatrix.cxx:248
FloatMatrix concatHoriz(const FloatMatrix &right) const
return a matrix formed by concatenating right to the right of this
Definition: FloatMatrix.cxx:80
FloatMatrix transpose() const
return the transpose
Definition: FloatMatrix.cxx:234
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
Definition: FloatMatrix.cxx:94
Definition: Vector3D.h:37
namespace for all CiftiLib functionality
Definition: CiftiBrainModelsMap.h:42