|
Imagine++
|
Symmetric Matrix of variable size. More...
#include "Imagine/LinAlg.h"
Public Types | |
| typedef Base::const_iterator | const_iterator |
| Const iterator type. | |
| typedef Base::iterator | iterator |
| Iterator type. | |
Public Types inherited from Imagine::Array< T > | |
| typedef const T * | const_iterator |
| Const iterator type. | |
| typedef T * | iterator |
| Iterator type. | |
Public Member Functions | |
| SymMatrix () | |
| Empty constructor. | |
| SymMatrix (const Matrix< T > &A) | |
| Conversion from Matrix. | |
| SymMatrix (const SymMatrix &A) | |
| Copy constructor. | |
| SymMatrix (int N) | |
| Constructor (known size). | |
| SymMatrix (T *t, int N, bool handleDelete=false) | |
| Constructor (pre-allocated). | |
| ~SymMatrix () | |
| Destructor. | |
| SymMatrix | clone () const |
| Cloning. | |
| SymMatrix & | fill (T x) |
| Filling. | |
| Vector< T > | getDiagonal () const |
| Get diagonal. | |
| Matrix< T > | getSubMat (int i0, int m, int j0, int n) const |
| Get sub matrix. | |
| int | ncol () const |
| Number of columns. | |
| int | nrow () const |
| Number of rows. | |
| T & | operator() (int i, int j) |
| Write access. | |
| const T & | operator() (int i, int j) const |
| Read access. | |
| Matrix< T > | operator* (const Matrix< T > &B) const |
| Product. | |
| Matrix< T > | operator* (const SymMatrix &B) const |
| Product. | |
| Vector< T > | operator* (const Vector< T > &v) const |
| Product with vector. | |
| SymMatrix | operator* (T x) const |
| Scalar multiplication. | |
| SymMatrix & | operator*= (T x) |
| Scalar in place multiplication. | |
| SymMatrix | operator+ (const SymMatrix &B) const |
| Addition. | |
| SymMatrix & | operator+= (const SymMatrix &B) |
| In place Addition. | |
| SymMatrix | operator- () const |
| Opposite. | |
| SymMatrix | operator- (const SymMatrix &B) const |
| Substraction. | |
| SymMatrix & | operator-= (const SymMatrix &B) |
| In place Substraction. | |
| SymMatrix | operator/ (T x) const |
| Scalar division. | |
| SymMatrix & | operator/= (T x) |
| Scalar in place division. | |
| SymMatrix & | operator= (const SymMatrix &A) |
| Assignment. | |
| void | read (std::istream &in) |
| Binary read. | |
| void | setSize (int n) |
| Change sizes. | |
| void | write (std::ostream &out) const |
| Binary write. | |
Public Member Functions inherited from Imagine::Array< T > | |
| Array () | |
| Empty constructor. | |
| Array (const Array &A) | |
| Copy constructor. | |
| template<typename T2> | |
| Array (const Array< T2 > &A) | |
| Constructor (different type). | |
| Array (const std::list< T > &L) | |
| Constructor (from list). | |
| Array (size_t size) | |
| Constructor (known size). | |
| Array (T *ptr, size_t size, bool handleDelete=false) | |
| Constructor (pre-allocated). | |
| virtual | ~Array () |
| Destructor. | |
| iterator | begin () |
| Begin iterator. | |
| const_iterator | begin () const |
| Begin const iterator. | |
| Array | clone () const |
| Cloning. | |
| T * | data () |
| Data pointer (read/write). | |
| const T * | data () const |
| Data pointer (read). | |
| bool | empty () const |
| Is empty. | |
| iterator | end () |
| End iterator. | |
| const_iterator | end () const |
| End const iterator. | |
| Array & | fill (const T &x) |
| Filling. | |
| Array | getSubArray (size_t offset, size_t size) const |
| Sub array. | |
| bool | operator!= (const Array &A) const |
| Inequality test. | |
| Array & | operator= (const Array &A) |
| Assignment. | |
| template<typename T2> | |
| Array & | operator= (const Array< T2 > &A) |
| Assignment (different type). | |
| bool | operator== (const Array &A) const |
| Equality test. | |
| T & | operator[] (size_t i) |
| Write access. | |
| const T & | operator[] (size_t i) const |
| Read access. | |
| void | setSize (size_t size) |
| Change size. | |
| size_t | size () const |
| Size. | |
Static Public Member Functions | |
| static SymMatrix | Identity (int n) |
| Identity. | |
| static SymMatrix | Zero (int n) |
| Zero matrix. | |
Friends | |
| T | det (const SymMatrix &A) |
| Determinant. | |
| void | EVD (const SymMatrix &A, Matrix< T > &Q, Vector< T > &Lambda) |
| Eigen values. | |
| SymMatrix | inverse (const SymMatrix &A) |
| Inverse. | |
| Vector< T > | linSolve (const SymMatrix &A, const Vector< T > &b) |
| Linear system. | |
| SymMatrix | operator* (T x, const SymMatrix &B) |
| Scalar multiplication. | |
| std::ostream & | operator<< (std::ostream &out, const SymMatrix &A) |
| ASCII write. | |
| std::istream & | operator>> (std::istream &in, SymMatrix &A) |
| ASCII read. | |
| SymMatrix | posDefInverse (const SymMatrix &A) |
| Inverse (variant). | |
Symmetric Matrix of variable size. Memory is reference counted, i.e.:
| T | value type |
|
inline |
Constructs an unallocated symmetric matrix of variables of type T
|
inlineexplicit |
Constructs an allocated symmetric matrix of variables of type T
| N | matrix size |
|
inline |
Constructs a symmetric matrix from another one (sharing memory!)
| A | matrix to copy |
|
inline |
Constructs an symmetric matrix from variables type T stored at an already allocated memory. t contains partial rows (0,0), (1,0), (1,1), (2,0), ... Does not allocate fresh memory. Does not free given memory at object destruction unless handleDelete=true. This memory must indeed stay available during object life.
| t | address of memory |
| N | matrix size |
| handleDelete | delete memory at destruction? (default=false) |
|
inline |
Constructs a symmetric matrix from a plain one, using upper part.
| A | matrix to copy |
|
inline |
Reference counted desctructor: frees memory if the object is the last one to use it.
|
inline |
Clones: creates a new symmetric matrix, with fresh memory, copying values to it
|
inline |
Fills with constant value
| x | value to be copied to each element |
|
inline |
|
inline |
Constructs a new matrix a copies a part of *this into it.
| i0 | starting row |
| m | number of rows |
| j0 | starting column |
| n | number of columns |
|
inlinestatic |
|
inline |
Number of columns
|
inline |
Number of rows
|
inline |
Writes element (i,j)
| i | row index |
| j | column index |
|
inline |
Reads element (i,j)
| i | row index |
| j | column index |
|
inline |
sym matrix * matrix product.
| B | right operand |
|
inline |
sym matrix * sym matrix product. NB: result is not symmetric!
| B | right operand |
|
inline |
|
inline |
Multiplies each element by a scalar
| x | The scalar |
|
inline |
Multiplies each element by a scalar
| x | The scalar |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Divides each element by a scalar
| x | The scalar |
|
inline |
Divides each element by a scalar
| x | The scalar |
|
inline |
Assigns from another symmetric matrix (sharing its memory)
| A | symmetric to be assigned to |
|
inline |
Reads SymMatrix from binary stream
| in | input stream |
|
inline |
Resize symmetric matrix:
| n | new size |
|
inline |
Writes SymMatrix to binary stream
| out | output stream |
|
inlinestatic |
Matrix with constant 0 value
| n | size |
|
friend |
Determinant.
| A | argument |
remplacer le calcul du det par eigen? (plutot que bunch)
|
friend |
Eigen values. Value Lambda[i] is associated with vector stored at ith column of Q. Thus Q is orthonormal and A=Q*diag(Lambda)*Q^T
| A | argument |
| Q | Eigen vectors |
| Lambda | Eigen values in increasing order |
Inverse matrix. If non invertible, ouptuts a message to cerr and returns a matrix with zeroed elements.
| A | argument |
|
friend |
Solves symmetric system. Returns x such that Ax=b
| A | argument |
| b | right term |
Multiplies each element by a scalar
| x | The scalar |
| B | The SymMatrix |
|
friend |
|
friend |
Inverse matrix if positive-definite. If not the case invertible, ouptuts a message to cerr and returns a matrix with zeroed elements.
| A | argument |