OpenMEEG
Loading...
Searching...
No Matches
OpenMEEG::Matrix Class Reference

Matrix class Matrix class. More...

#include <matrix.h>

Inheritance diagram for OpenMEEG::Matrix:
Collaboration diagram for OpenMEEG::Matrix:

Public Member Functions

 Matrix ()
 
 Matrix (const char *fname)
 
 Matrix (const std::string &fname)
 
 Matrix (const Dimension M, const Dimension N)
 
 Matrix (const Matrix &A, const DeepCopy)
 
 Matrix (const SymMatrix &A)
 
 Matrix (const SparseMatrix &A)
 
 Matrix (const Vector &v, const Dimension M, const Dimension N)
 
void alloc_data ()
 
void reference_data (const double *vals)
 
bool empty () const
 Test if Matrix is empty.
 
size_t size () const
 Get Matrix size.
 
double * data () const
 Get Matrix data.
 
double operator() (const Index i, const Index j) const
 Get Matrix value.
 
double & operator() (const Index i, const Index j)
 Get Matrix value.
 
Matrix submat (const Index istart, const Index isize, const Index jstart, const Index jsize) const
 
void insertmat (const Index istart, const Index jstart, const Matrix &B)
 
Vector getcol (const Index j) const
 
void setcol (const Index j, const Vector &v)
 
Vector getlin (const Index i) const
 
void setlin (const Index i, const Vector &v)
 
const Matrixset (const double d)
 
Matrix operator* (const Matrix &B) const
 
Matrix operator* (const SymMatrix &B) const
 
Matrix operator* (const SparseMatrix &B) const
 
Matrix operator+ (const Matrix &B) const
 
Matrix operator- (const Matrix &B) const
 
Matrix operator* (double x) const
 
Matrix operator/ (double x) const
 
void operator+= (const Matrix &B)
 
void operator-= (const Matrix &B)
 
void operator*= (double x)
 
void operator/= (double x)
 
Vector operator* (const Vector &v) const
 
Vector tmult (const Vector &v) const
 
Matrix tmult (const Matrix &m) const
 
Matrix multt (const Matrix &m) const
 
Matrix tmultt (const Matrix &m) const
 
Matrix transpose () const
 
Matrix inverse () const
 
Matrix pinverse (const double reltol=0.0) const
 
void svd (Matrix &U, SparseMatrix &S, Matrix &V, const bool complete=true) const
 
double frobenius_norm () const
 Get Matrix Frobenius norm.
 
double dot (const Matrix &B) const
 
void save (const char *filename) const
 Save Matrix to file (Format set using file name extension)
 
void load (const char *filename)
 Load Matrix from file (Format set using file name extension)
 
void save (const std::string &s) const
 
void load (const std::string &s)
 
void info () const
 Print info on Matrix.
 
- Public Member Functions inherited from OpenMEEG::LinOp
 LinOp ()
 
 LinOp (const Dimension m, const Dimension n, const StorageType st, const unsigned d)
 
- Public Member Functions inherited from OpenMEEG::LinOpInfo
 LinOpInfo ()
 
 LinOpInfo (const Dimension m, const Dimension n, const StorageType st, const unsigned d)
 
virtual ~LinOpInfo ()
 
Dimension nlin () const
 
Dimensionnlin ()
 
virtual Dimension ncol () const
 
Dimensionncol ()
 
StorageType storageType () const
 
StorageTypestorageType ()
 
unsigned dimension () const
 
unsigned & dimension ()
 
IOdefault_io ()
 

Protected Member Functions

 Matrix (const Matrix &A, const Dimension M)
 

Protected Attributes

LinOpValue value
 
- Protected Attributes inherited from OpenMEEG::LinOpInfo
Dimension num_lines
 
Dimension num_cols
 
StorageType storage
 
unsigned dim
 
IO DefaultIO = nullptr
 

Friends

class Vector
 
class SparseMatrix
 
class SymMatrix
 

Additional Inherited Members

- Public Types inherited from OpenMEEG::LinOpInfo
enum  StorageType {
  FULL , SYMMETRIC , BLOCK , BLOCK_SYMMETRIC ,
  SPARSE
}
 
typedef maths::MathsIO * IO
 

Detailed Description

Matrix class Matrix class.

Definition at line 28 of file matrix.h.

Constructor & Destructor Documentation

◆ Matrix() [1/9]

OpenMEEG::Matrix::Matrix ( const Matrix & A,
const Dimension M )
inlineexplicitprotected

Definition at line 35 of file matrix.h.

◆ Matrix() [2/9]

OpenMEEG::Matrix::Matrix ( )
inline

Definition at line 39 of file matrix.h.

◆ Matrix() [3/9]

OpenMEEG::Matrix::Matrix ( const char * fname)
inline

Definition at line 40 of file matrix.h.

◆ Matrix() [4/9]

OpenMEEG::Matrix::Matrix ( const std::string & fname)
inline

Definition at line 41 of file matrix.h.

◆ Matrix() [5/9]

OpenMEEG::Matrix::Matrix ( const Dimension M,
const Dimension N )
inline

Definition at line 42 of file matrix.h.

◆ Matrix() [6/9]

OpenMEEG::Matrix::Matrix ( const Matrix & A,
const DeepCopy  )
inline

Definition at line 43 of file matrix.h.

◆ Matrix() [7/9]

OpenMEEG::Matrix::Matrix ( const SymMatrix & A)
explicit

◆ Matrix() [8/9]

OpenMEEG::Matrix::Matrix ( const SparseMatrix & A)
explicit

◆ Matrix() [9/9]

OpenMEEG::Matrix::Matrix ( const Vector & v,
const Dimension M,
const Dimension N )

Member Function Documentation

◆ alloc_data()

void OpenMEEG::Matrix::alloc_data ( )
inline

Definition at line 50 of file matrix.h.

◆ reference_data()

void OpenMEEG::Matrix::reference_data ( const double * vals)
inline

Definition at line 51 of file matrix.h.

◆ empty()

bool OpenMEEG::Matrix::empty ( ) const
inline

Test if Matrix is empty.

Returns
true if Matrix is empty

Definition at line 56 of file matrix.h.

◆ size()

size_t OpenMEEG::Matrix::size ( ) const
inlinevirtual

Get Matrix size.

Returns
number of values (nb lines x nb columns)

Implements OpenMEEG::LinOp.

Definition at line 61 of file matrix.h.

◆ data()

double * OpenMEEG::Matrix::data ( ) const
inline

Get Matrix data.

Returns
pointer to Matrix values

Definition at line 66 of file matrix.h.

◆ operator()() [1/2]

double OpenMEEG::Matrix::operator() ( const Index i,
const Index j ) const
inline

Get Matrix value.

Returns
value in Matrix

Definition at line 81 of file matrix.h.

◆ operator()() [2/2]

double & OpenMEEG::Matrix::operator() ( const Index i,
const Index j )
inline

Get Matrix value.

Returns
reference to value in Matrix

Definition at line 89 of file matrix.h.

◆ submat()

Matrix OpenMEEG::Matrix::submat ( const Index istart,
const Index isize,
const Index jstart,
const Index jsize ) const
inline

Definition at line 208 of file matrix.h.

◆ insertmat()

void OpenMEEG::Matrix::insertmat ( const Index istart,
const Index jstart,
const Matrix & B )
inline

Definition at line 225 of file matrix.h.

◆ getcol()

Vector OpenMEEG::Matrix::getcol ( const Index j) const
inline

Definition at line 233 of file matrix.h.

◆ setcol()

void OpenMEEG::Matrix::setcol ( const Index j,
const Vector & v )
inline

Definition at line 260 of file matrix.h.

◆ getlin()

Vector OpenMEEG::Matrix::getlin ( const Index i) const
inline

Definition at line 246 of file matrix.h.

◆ setlin()

void OpenMEEG::Matrix::setlin ( const Index i,
const Vector & v )
inline

Definition at line 271 of file matrix.h.

◆ set()

const Matrix & OpenMEEG::Matrix::set ( const double d)

◆ operator*() [1/5]

Matrix OpenMEEG::Matrix::operator* ( const Matrix & B) const
inline

Definition at line 333 of file matrix.h.

◆ operator*() [2/5]

Matrix OpenMEEG::Matrix::operator* ( const SymMatrix & B) const
inline

Definition at line 409 of file matrix.h.

◆ operator*() [3/5]

Matrix OpenMEEG::Matrix::operator* ( const SparseMatrix & B) const

◆ operator+()

Matrix OpenMEEG::Matrix::operator+ ( const Matrix & B) const
inline

Definition at line 109 of file matrix.h.

◆ operator-()

Matrix OpenMEEG::Matrix::operator- ( const Matrix & B) const
inline

Definition at line 115 of file matrix.h.

◆ operator*() [4/5]

Matrix OpenMEEG::Matrix::operator* ( double x) const

◆ operator/()

Matrix OpenMEEG::Matrix::operator/ ( double x) const

◆ operator+=()

void OpenMEEG::Matrix::operator+= ( const Matrix & B)
inline

Definition at line 432 of file matrix.h.

◆ operator-=()

void OpenMEEG::Matrix::operator-= ( const Matrix & B)
inline

Definition at line 445 of file matrix.h.

◆ operator*=()

void OpenMEEG::Matrix::operator*= ( double x)

◆ operator/=()

void OpenMEEG::Matrix::operator/= ( double x)

◆ operator*() [5/5]

Vector OpenMEEG::Matrix::operator* ( const Vector & v) const
inline

Definition at line 191 of file matrix.h.

◆ tmult() [1/2]

Vector OpenMEEG::Matrix::tmult ( const Vector & v) const
inline

Definition at line 284 of file matrix.h.

◆ tmult() [2/2]

Matrix OpenMEEG::Matrix::tmult ( const Matrix & m) const
inline

Definition at line 352 of file matrix.h.

◆ multt()

Matrix OpenMEEG::Matrix::multt ( const Matrix & m) const
inline

Definition at line 371 of file matrix.h.

◆ tmultt()

Matrix OpenMEEG::Matrix::tmultt ( const Matrix & m) const
inline

Definition at line 390 of file matrix.h.

◆ transpose()

Matrix OpenMEEG::Matrix::transpose ( ) const

◆ inverse()

Matrix OpenMEEG::Matrix::inverse ( ) const
inline

Definition at line 302 of file matrix.h.

◆ pinverse()

Matrix OpenMEEG::Matrix::pinverse ( const double reltol = 0.0) const

◆ svd()

void OpenMEEG::Matrix::svd ( Matrix & U,
SparseMatrix & S,
Matrix & V,
const bool complete = true ) const

◆ frobenius_norm()

double OpenMEEG::Matrix::frobenius_norm ( ) const
inline

Get Matrix Frobenius norm.

Returns
norm value

Definition at line 173 of file matrix.h.

◆ dot()

double OpenMEEG::Matrix::dot ( const Matrix & B) const
inline

Definition at line 458 of file matrix.h.

◆ save() [1/2]

void OpenMEEG::Matrix::save ( const char * filename) const

Save Matrix to file (Format set using file name extension)

◆ load() [1/2]

void OpenMEEG::Matrix::load ( const char * filename)

Load Matrix from file (Format set using file name extension)

◆ save() [2/2]

void OpenMEEG::Matrix::save ( const std::string & s) const
inline

Definition at line 153 of file matrix.h.

◆ load() [2/2]

void OpenMEEG::Matrix::load ( const std::string & s)
inline

Definition at line 154 of file matrix.h.

◆ info()

void OpenMEEG::Matrix::info ( ) const
virtual

Print info on Matrix.

Implements OpenMEEG::LinOp.

Friends And Related Symbol Documentation

◆ Vector

friend class Vector
friend

Definition at line 31 of file matrix.h.

◆ SparseMatrix

friend class SparseMatrix
friend

Definition at line 160 of file matrix.h.

◆ SymMatrix

friend class SymMatrix
friend

Definition at line 161 of file matrix.h.

Member Data Documentation

◆ value

LinOpValue OpenMEEG::Matrix::value
protected

Definition at line 33 of file matrix.h.


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