|
AGX Dynamics
2.35.0.1
|
A class to distinguish between various types of matrices, both in terms of storage properties, i.e., dense or sparse, or lower or upper triangular in the case of symmetric matrices. More...
#include <MatrixTypes.h>
Public Types | |
| enum | Storage { DENSE = 2 , UPPER_TRIANGLE = 4 , LOWER_TRIANGLE = 8 } |
| How the matrix is stored. More... | |
| enum | Type { GENERIC = 0 , SQUARE = 2 , SYMMETRIC = 4 , POSITIVE_DEFINITE = 8 , SADDLE_POINT = 16 } |
| The kind of matrix we are dealing with. More... | |
Public Member Functions | |
| MatrixType () | |
| MatrixType (int type, int storage) | |
| bool | isDense () const |
| bool | isGeneric () const |
| bool | isLowerTriangle () const |
| bool | isPositiveDefinite () const |
| bool | isSaddlePoint () const |
| bool | isSparse () const |
| bool | isSquare () const |
| bool | isSymmetric () const |
| bool | isUpperTriangle () const |
| MatrixType & | setDense (bool t=true) |
| MatrixType & | setGeneric (bool t=true) |
| MatrixType & | setLowerTriangle (bool t=true) |
| MatrixType & | setPositiveDefinite (bool t=true) |
| MatrixType & | setSaddlePoint (bool t=true) |
| MatrixType & | setSparse (bool t=true) |
| MatrixType & | setSquare (bool t=true) |
| MatrixType & | setSymmetric (bool t=true) |
| MatrixType & | setUpperTriangle (bool t=true) |
A class to distinguish between various types of matrices, both in terms of storage properties, i.e., dense or sparse, or lower or upper triangular in the case of symmetric matrices.
These storage types should include banded storage in the future.
The matrix type itself refers to mathematical properties, such as whether or not it is square, symmetric, positive definite, or a saddle point matrix.
The set functions here all take a boolean argument which defaults to true, and they return a reference to *this. This means that one can do things like t.setSaddlePoint().t.setPositiveDefinite(false).setDense(false).setUpperTriangle();
The MatrixType class holds little data and that is directly on the stack in any case. Thus, it is possible to create such objects on the fly inside constructors of matrices. For instance, one could do int n = 100; SparseMatrix m(n, MatrixType().setSaddlePoint().t.setPositiveDefinite(false).setDense(false).setUpperTriangle()); to get a square sparse matrix of saddle point type stored as upper triangle only. In this example, the default solver library would be used. The class SolverLibs is defined in another file because it is part of our own specific matrix library class hierarchy.
Definition at line 48 of file MatrixTypes.h.
How the matrix is stored.
If not dense, then, it is sparse. Dense or sparse, it is possible that only upper or lower triangles are stores, as is the case for symmetric matrices.
| Enumerator | |
|---|---|
| DENSE | The entire matrix is stored, or it is sparse. |
| UPPER_TRIANGLE | Only upper triangle is stored, dense or sparse. |
| LOWER_TRIANGLE | Only lower triangle is stored, dense or sparse. |
Definition at line 56 of file MatrixTypes.h.
The kind of matrix we are dealing with.
Users of these classes are not to worry much about these enums since the inline methods below do the work.
Definition at line 67 of file MatrixTypes.h.
|
inline |
Definition at line 77 of file MatrixTypes.h.
|
inline |
Definition at line 80 of file MatrixTypes.h.
|
inline |
|
inline |
Definition at line 136 of file MatrixTypes.h.
References GENERIC.
|
inline |
Definition at line 143 of file MatrixTypes.h.
References LOWER_TRIANGLE.
|
inline |
Definition at line 137 of file MatrixTypes.h.
References POSITIVE_DEFINITE.
|
inline |
Definition at line 138 of file MatrixTypes.h.
References SADDLE_POINT.
|
inline |
Definition at line 141 of file MatrixTypes.h.
References isDense().
|
inline |
Definition at line 144 of file MatrixTypes.h.
References SQUARE.
|
inline |
Definition at line 139 of file MatrixTypes.h.
References SYMMETRIC.
|
inline |
Definition at line 142 of file MatrixTypes.h.
References UPPER_TRIANGLE.
|
inline |
|
inline |
Definition at line 109 of file MatrixTypes.h.
References GENERIC.
Referenced by setPositiveDefinite(), setSaddlePoint(), setSquare(), and setSymmetric().
|
inline |
Definition at line 130 of file MatrixTypes.h.
References LOWER_TRIANGLE, and setSquare().
Referenced by setUpperTriangle().
|
inline |
Definition at line 103 of file MatrixTypes.h.
References POSITIVE_DEFINITE, setGeneric(), and setSquare().
|
inline |
Definition at line 97 of file MatrixTypes.h.
References SADDLE_POINT, setGeneric(), and setSquare().
|
inline |
Definition at line 120 of file MatrixTypes.h.
References setDense().
|
inline |
Definition at line 91 of file MatrixTypes.h.
References setGeneric(), and SQUARE.
Referenced by setLowerTriangle(), setPositiveDefinite(), and setSaddlePoint().
|
inline |
Definition at line 85 of file MatrixTypes.h.
References setGeneric(), and SYMMETRIC.
|
inline |
Definition at line 124 of file MatrixTypes.h.
References setLowerTriangle(), and UPPER_TRIANGLE.