Haptic Controller
Loading...
Searching...
No Matches
Matrix Class Reference

Class that treats a std::vector as a matrix and implements simple operations. More...

Public Member Functions

 Matrix ()=default
 
 ~Matrix ()=default
 
 Matrix (size_t rows, size_t cols)
 
 Matrix (size_t rows, size_t cols, std::vector< float > data)
 
float & operator() (size_t i, size_t j)
 
float operator() (size_t i, size_t j) const
 
Matrix transpose () const
 Gets the transpose of the matrix.
 
Matrix T () const
 Alias for transpose()
 
std::vector< float > operator* (const std::vector< float > &v) const
 Overloaded multiplication operator for matrix-matrix multiplication.
 
std::vector< float > getData () const
 Gets the data vector of the matrix.
 
bool operator== (const Matrix &rhs) const
 Overloaded equality operator that returns true if matrices are equal value-wise.
 

Detailed Description

Class that treats a std::vector as a matrix and implements simple operations.

Definition at line 7 of file matrix.hpp.

Constructor & Destructor Documentation

◆ Matrix() [1/3]

Matrix::Matrix ( )
default

◆ ~Matrix()

Matrix::~Matrix ( )
default

◆ Matrix() [2/3]

Matrix::Matrix ( size_t rows,
size_t cols )
inline

Definition at line 13 of file matrix.hpp.

◆ Matrix() [3/3]

Matrix::Matrix ( size_t rows,
size_t cols,
std::vector< float > data )
inline

Definition at line 19 of file matrix.hpp.

Member Function Documentation

◆ getData()

std::vector< float > Matrix::getData ( ) const
inline

Gets the data vector of the matrix.

Definition at line 72 of file matrix.hpp.

Referenced by operator==().

◆ operator()() [1/2]

float & Matrix::operator() ( size_t i,
size_t j )
inline

Definition at line 25 of file matrix.hpp.

◆ operator()() [2/2]

float Matrix::operator() ( size_t i,
size_t j ) const
inline

Definition at line 30 of file matrix.hpp.

◆ operator*()

std::vector< float > Matrix::operator* ( const std::vector< float > & v) const
inline

Overloaded multiplication operator for matrix-matrix multiplication.

Definition at line 54 of file matrix.hpp.

◆ operator==()

bool Matrix::operator== ( const Matrix & rhs) const
inline

Overloaded equality operator that returns true if matrices are equal value-wise.

Definition at line 78 of file matrix.hpp.

References getData().

◆ T()

Matrix Matrix::T ( ) const
inline

Alias for transpose()

Definition at line 48 of file matrix.hpp.

References transpose().

◆ transpose()

Matrix Matrix::transpose ( ) const
inline

Gets the transpose of the matrix.

Definition at line 36 of file matrix.hpp.

Referenced by T().


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