Symmetric sparse matrix indices management. More...
#include <matrixss.h>
Public Member Functions | |
| void | noteIdx (int i, int j) |
| Reserves space for the given pair of indices in the matrix. | |
| void | clearIdx () |
| Erases all the space reservations. | |
| int | getNValues () const |
| Returns the number of values in the matrix. | |
| int | getI (int n) const |
| Returns the first index of the specified value. | |
| int | getJ (int n) const |
| Returns the second index of the specified value. | |
| bool | isSymmetric () const |
| Checks if this matrix is symmetric. | |
| void | reduce () |
| Reduces the number of stored elements by using the symmetry. This must be called once, after all elements are registered. In principle, the reduction can be done during the registration (as it will be done in future). Making this a separate function allows to assert that the matrix is indeed symmetric. This is useful for internal check of the program. | |
| double | product (matrixValues cl, matrixValues cr, matrixValues vals) const |
| Calculates the product of two vectors with this matrix. This evaluates L x M x R, where R is a column vector, M is the matrix (sparse, with element indices, represented by this object), L is a row vector. | |
| int | getMatIndicesStorageSize () |
| Returns the amount of RAM, occupied by this object. | |
| ~matrixss () | |
| Frees resources, associated with this object. | |
Symmetric sparse matrix indices management.
| int matrixss::getI | ( | int | n | ) | const [inline] |
Returns the first index of the specified value.
| n | value number |
Referenced by nanomagn::mesh::calculateNearIntMat(), nanomagn::group::checkGroupCoverage(), and nanomagn::mesh::printMesh().
| int matrixss::getJ | ( | int | n | ) | const [inline] |
Returns the second index of the specified value.
| n | value number |
Referenced by nanomagn::mesh::calculateNearIntMat(), nanomagn::group::checkGroupCoverage(), and nanomagn::mesh::printMesh().
| int matrixss::getMatIndicesStorageSize | ( | ) |
Returns the amount of RAM, occupied by this object.
Referenced by nanomagn::mesh::getMatSSStorageSize(), nanomagn::mesh::getMatVFStorageSize(), and nanomagn::mesh::getMatVSStorageSize().
| int matrixss::getNValues | ( | ) | const [inline] |
Returns the number of values in the matrix.
Referenced by nanomagn::mesh::calculateNearIntMat(), nanomagn::group::checkGroupCoverage(), nanomagn::mesh::getMatSSStorageSize(), nanomagn::mesh::getMatVFStorageSize(), and nanomagn::mesh::getMatVSStorageSize().
| bool matrixss::isSymmetric | ( | ) | const |
Checks if this matrix is symmetric.
Referenced by nanomagn::mesh::isNearIntSymmetric().
| void matrixss::noteIdx | ( | int | i, | |
| int | j | |||
| ) | [inline] |
Reserves space for the given pair of indices in the matrix.
| i | is the first index of the pair. | |
| j | is the second index of the pair. |
Referenced by nanomagn::mesh::noteNearInt().
| double matrixss::product | ( | matrixValues | cl, | |
| matrixValues | cr, | |||
| matrixValues | vals | |||
| ) | const |
Calculates the product of two vectors with this matrix. This evaluates L x M x R, where R is a column vector, M is the matrix (sparse, with element indices, represented by this object), L is a row vector.
| cl | contains the values of the left vector (L) | |
| cr | contains the values of the right vector (R) | |
| vals | contains non-zero values of the sparse matrix. |
Referenced by nanomagn::mesh::calcEnergyMS().
1.6.3