![]() |
CPP Linear Algebra ToolBox
0.1.0
|
#include <squareMatrix.h>
Public Member Functions | |
SquareMatrix () | |
SquareMatrix (uint16_t) | |
SquareMatrix (const SquareMatrix &) | |
~SquareMatrix () | |
SquareMatrix & | operator= (const SquareMatrix &) |
SquareMatrix | operator- () const |
SquareMatrix | transpose () const |
![]() | |
Matrix () | |
Construct a Matrix object. Default constructor. Set number of rows and number of columns to 0. Set data pointer to NULL. More... | |
Matrix (uint16_t, uint16_t) | |
Construct a Matrix object. Construct a matrix of size n rows times m columns. More... | |
Matrix (const Matrix &) | |
Construct a Matrix object. Copy contructor. More... | |
virtual | ~Matrix () |
Destroy the Matrix object. More... | |
uint16_t | get_n_rows () const |
Accessor to the number of rows. More... | |
uint16_t | get_n_cols () const |
Accessor to the number of columns. More... | |
uint32_t | get_n_elements () const |
Accessor to the number of elements. More... | |
bool | is_square () const |
Test if a matrix has a square shape. More... | |
Vector | row (uint16_t) const |
Extract row from Matrix. More... | |
Vector | col (uint16_t) const |
Extract column from Matrix. More... | |
double | norm1 () const |
Compute the norm-1 of a Matrix object. For a Matrix M of dimension \(n\times m\), its norm-1 is given by the maximum colum sum (in absolute value) More... | |
double | normInf () const |
Compute the norm-Infinity of a Matrix object. For a Matrix M of dimension \(n\times m\), its norm-Infinity is given by the maximum row sum (in absolute value) More... | |
double | normFrob () const |
Compute the Frobenius norm of a Matrix object. For a Matrix M of dimension \(n\times m\), its Frobenius norm is given by the sum of its coefficient squared. More... | |
Matrix | transpose () const |
Compute the transpose Matrix of a Matrix object. More... | |
double & | operator() (uint32_t) const |
Overload operator (i) More... | |
double & | operator() (uint16_t, uint16_t) const |
Overload operator (i,j). More... | |
Matrix & | operator= (const Matrix &) |
Overload assignement operator. More... | |
Matrix & | operator+= (const Matrix &) |
Overload operator +=. More... | |
Matrix & | operator-= (const Matrix &) |
Overload operator -=. More... | |
Matrix | operator- () const |
Overload unary operator -. More... | |
Static Public Member Functions | |
static SquareMatrix | eye (uint16_t) |
static SquareMatrix | diag (const Vector &) |
static Vector | diag (const SquareMatrix &) |
static double | tr (const SquareMatrix &) |
static SquareMatrix | zeros (uint16_t) |
static SquareMatrix | ones (uint16_t) |
static SquareMatrix | rand (uint16_t) |
static SquareMatrix | hilbert (uint16_t) |
static SquareMatrix | vandermonde (const Vector &) |
static SquareMatrix | outer (const Vector &, const Vector &) |
static SquareMatrix | matmul (const SquareMatrix &, MATRIX_TRANSPOSE, const SquareMatrix &, MATRIX_TRANSPOSE) |
![]() | |
static Matrix | zeros (uint16_t, uint16_t) |
Construct a matrix object of dimension n times m filled with zeros. More... | |
static Matrix | ones (uint16_t, uint16_t) |
Construct a matrix object of dimension n times m filled with ones. More... | |
static Matrix | rand (uint16_t, uint16_t) |
Construct a matrix object of dimension n times m filled with random values sampled from 0. to 1. More... | |
static Matrix | hilbert (uint16_t, uint16_t) |
Construct an Hilbert matrix. More... | |
static Matrix | vandermonde (const Vector &, uint16_t) |
Construct a Vandermonde matrix. See https://en.wikipedia.org/wiki/Vandermonde_matrix. More... | |
static Matrix | outer (const Vector &, const Vector &) |
Overload operator * between two vectors to compute their outer product. More... | |
static Matrix | matmul (const Matrix &, MATRIX_TRANSPOSE, const Matrix &, MATRIX_TRANSPOSE) |
Compute the product of two matrices combined with their transposition. More... | |
Friends | |
SquareMatrix | operator* (const SquareMatrix &, const SquareMatrix &) |
SquareMatrix | operator* (const double, const SquareMatrix &) |
SquareMatrix | operator* (const SquareMatrix &, const double) |
SquareMatrix | operator+ (const SquareMatrix &, const SquareMatrix &) |
SquareMatrix | operator+ (const double, const SquareMatrix &) |
SquareMatrix | operator+ (const SquareMatrix &, const double) |
SquareMatrix | operator- (const SquareMatrix &, const SquareMatrix &) |
SquareMatrix | operator- (const SquareMatrix &, const double) |
SquareMatrix | operator- (const double, const SquareMatrix &) |
SquareMatrix | operator/ (const SquareMatrix &, const double) |
Additional Inherited Members | |
![]() | |
double & | at (uint32_t) const |
Helper to access the n-th stored value of a Matrix object. More... | |
double & | at (uint16_t, uint16_t) const |
Access given element of a matrix. More... | |
void | show () const |
Helper to display a Matrix object to the standart output stream. More... | |
void | default_data () |
Fill the data array with zeros. More... | |
![]() | |
uint16_t | n_rows |
uint16_t | n_cols |
uint32_t | n_elements |
double * | data |
SquareMatrix::SquareMatrix | ( | ) |
SquareMatrix::SquareMatrix | ( | uint16_t | n | ) |
SquareMatrix::SquareMatrix | ( | const SquareMatrix & | in | ) |
SquareMatrix::~SquareMatrix | ( | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
SquareMatrix SquareMatrix::operator- | ( | ) | const |
SquareMatrix & SquareMatrix::operator= | ( | const SquareMatrix & | A | ) |
|
static |
|
static |
|
static |
SquareMatrix SquareMatrix::transpose | ( | ) | const |
|
static |
|
static |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |