Jpp
18.2.0
the software that should make you happy
|
N x N symmetric matrix. More...
#include <JMatrixNS.hh>
Public Member Functions | |
JMatrixNS () | |
Default constructor. More... | |
JMatrixNS (const size_t size) | |
Constructor (identity matrix). More... | |
JMatrixNS (const JMatrixND &A) | |
Contructor. More... | |
JMatrixNS & | operator= (const JMatrixNS &A) |
Assignment operator. More... | |
void | invert () |
Invert matrix according LDU decomposition. More... | |
template<class JVectorND_t > | |
void | solve (JVectorND_t &u) |
Get solution of equation A x = b . More... | |
void | update (const size_t k, const double value) |
Update inverted matrix at given diagonal element. More... | |
void | resize (const size_t size) |
Resize matrix. More... | |
JMatrixND & | reset () |
Set matrix to the null matrix. More... | |
JMatrixND & | setIdentity () |
Set to identity matrix. More... | |
JMatrixND & | negate () |
Negate matrix. More... | |
JMatrixND & | add (const JMatrixND &A) |
Matrix addition. More... | |
JMatrixND & | sub (const JMatrixND &A) |
Matrix subtraction. More... | |
JMatrixND & | mul (const double factor) |
Scale matrix. More... | |
JMatrixND & | mul (const JMatrixND &A, const JMatrixND &B) |
Matrix multiplication. More... | |
JMatrixND & | mul (const JNullType &object) |
Multiply with object. More... | |
JMatrixND & | div (const double factor) |
Scale matrix. More... | |
bool | equals (const JMatrixND &A, const double eps=std::numeric_limits< double >::min()) const |
Equality. More... | |
bool | isIdentity (const double eps=std::numeric_limits< double >::min()) const |
Test identity. More... | |
bool | isSymmetric (const double eps=std::numeric_limits< double >::min()) const |
Test symmetry. More... | |
double | getDot (const JVectorND &v) const |
Get dot product. More... | |
void | clear () |
Clear memory. More... | |
void | set (const JMatrixND_t &A) |
Set matrix. More... | |
void | swap (JMatrixND_t &A) |
Swap matrices. More... | |
JMatrixND_t & | transpose () |
Transpose. More... | |
size_t | size () const |
Get dimension of matrix. More... | |
size_t | capacity () const |
Get capacity of dimension. More... | |
bool | empty () const |
Check emptyness. More... | |
const double * | data () const |
Get pointer to data. More... | |
double * | data () |
Get pointer to data. More... | |
const double * | operator[] (size_t row) const |
Get row data. More... | |
double * | operator[] (size_t row) |
Get row data. More... | |
double | operator() (const size_t row, const size_t col) const |
Get matrix element. More... | |
double & | operator() (const size_t row, const size_t col) |
Get matrix element. More... | |
double | at (size_t row, size_t col) const |
Get matrix element. More... | |
double & | at (size_t row, size_t col) |
Get matrix element. More... | |
Protected Member Functions | |
JMatrixND_t & | getInstance () |
Get work space. More... | |
void | rswap (size_t r1, size_t r2) |
void | cswap (size_t c1, size_t c2) |
Swap columns. More... | |
Protected Attributes | |
JMatrixND_t | ws |
double * | __p |
pointer to data More... | |
size_t | __n |
dimension of matrix More... | |
size_t | __m |
capacity of matrix More... | |
Private Attributes | |
std::vector< int > | P |
permutation matrix More... | |
N x N symmetric matrix.
Definition at line 28 of file JMatrixNS.hh.
|
inline |
|
inline |
|
inline |
|
inline |
Invert matrix according LDU decomposition.
Definition at line 75 of file JMatrixNS.hh.
|
inline |
Get solution of equation A x = b
.
u | column vector; b on input, x on output(I/O) |
Definition at line 308 of file JMatrixNS.hh.
|
inline |
Update inverted matrix at given diagonal element.
If A is the original matrix and A' is such that for each (i,j) != (k,k)
:
A'[i][j] = A[i][j] A'[k][k] = A[k][k] + value
then JMatrixNS::update(k, value)
will modify the already inverted matrix of A such that it will be the inverse of A'.
See also arXiv.
This algorithm can be considered a special case of the Sherman–Morrison formula.
k | index of diagonal element |
value | value to add |
Definition at line 446 of file JMatrixNS.hh.
|
inlineprotectedinherited |
|
inlineinherited |
Resize matrix.
Note that this method does not maintain data in the matrix.
size | dimension |
Definition at line 443 of file JMatrixND.hh.
|
inlineinherited |
Set matrix to the null matrix.
Definition at line 456 of file JMatrixND.hh.
|
inlineinherited |
Set to identity matrix.
Definition at line 473 of file JMatrixND.hh.
|
inlineinherited |
Negate matrix.
Definition at line 490 of file JMatrixND.hh.
Matrix addition.
A | matrix |
Definition at line 508 of file JMatrixND.hh.
Matrix subtraction.
A | matrix |
Definition at line 533 of file JMatrixND.hh.
|
inlineinherited |
Scale matrix.
factor | factor |
Definition at line 558 of file JMatrixND.hh.
Matrix multiplication.
A | matrix |
B | matrix |
Definition at line 595 of file JMatrixND.hh.
|
inlineinherited |
|
inlineinherited |
Scale matrix.
factor | factor |
Definition at line 576 of file JMatrixND.hh.
|
inlineinherited |
Equality.
A | matrix |
eps | numerical precision |
Definition at line 692 of file JMatrixND.hh.
|
inlineinherited |
Test identity.
eps | numerical precision |
Definition at line 723 of file JMatrixND.hh.
|
inlineinherited |
Test symmetry.
eps | numerical precision |
Definition at line 748 of file JMatrixND.hh.
|
inlineinherited |
Get dot product.
The dot product corresponds to
.
v | vector |
Definition at line 770 of file JMatrixND.hh.
|
inlineprotectedinherited |
Definition at line 870 of file JMatrixND.hh.
|
inlineprotectedinherited |
Swap columns.
c1 | column |
c2 | column |
Definition at line 888 of file JMatrixND.hh.
|
inlineinherited |
|
inlineinherited |
Set matrix.
A | matrix |
Definition at line 152 of file JMatrixND.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Get row data.
row | row number |
Definition at line 255 of file JMatrixND.hh.
|
inlineinherited |
Get row data.
row | row number |
Definition at line 267 of file JMatrixND.hh.
|
inlineinherited |
Get matrix element.
row | row number |
col | column number |
Definition at line 280 of file JMatrixND.hh.
|
inlineinherited |
Get matrix element.
row | row number |
col | column number |
Definition at line 293 of file JMatrixND.hh.
|
inlineinherited |
Get matrix element.
row | row number |
col | column number |
Definition at line 306 of file JMatrixND.hh.
|
inlineinherited |
Get matrix element.
row | row number |
col | column number |
Definition at line 324 of file JMatrixND.hh.
|
private |
permutation matrix
Definition at line 486 of file JMatrixNS.hh.
|
protectedinherited |
Definition at line 351 of file JMatrixND.hh.
|
protectedinherited |
pointer to data
Definition at line 336 of file JMatrixND.hh.
|
protectedinherited |
dimension of matrix
Definition at line 337 of file JMatrixND.hh.
|
protectedinherited |
capacity of matrix
Definition at line 338 of file JMatrixND.hh.