|
GridFire v0.7.1_rc2
General Purpose Nuclear Network
|
A wrapper class for handling the network Jacobian matrix. More...
#include <jacobian.h>
Public Member Functions | |
| NetworkJacobian (const Eigen::SparseMatrix< double > &jacobianMatrix, const std::function< fourdst::atomic::Species(size_t)> &indexToSpeciesFunc) | |
| Constructs a NetworkJacobian with the given sparse matrix and species index mapping function. | |
| NetworkJacobian (const NetworkJacobian &jacobian) | |
| Copy constructor for NetworkJacobian. | |
| NetworkJacobian (NetworkJacobian &&jacobian) noexcept | |
| Copy assignment operator for NetworkJacobian. | |
| NetworkJacobian & | operator= (NetworkJacobian &&jacobian) noexcept |
| Move constructor for NetworkJacobian. | |
| double | operator() (const fourdst::atomic::Species &row, const fourdst::atomic::Species &col) const |
| Accesses the value at the specified row and column corresponding to the given species. | |
| double | operator() (size_t i, size_t j) const |
| Accesses the value at the specified row and column indices. | |
| void | set (const fourdst::atomic::Species &row, const fourdst::atomic::Species &col, double value) |
| Sets the value at the specified row and column corresponding to the given species. | |
| void | set (size_t i, size_t j, double value) |
| Sets the value at the specified row and column indices. | |
| void | set (const JacobianEntry &entry) |
| Sets the value in the Jacobian matrix based on a JacobianEntry. | |
| std::tuple< size_t, size_t > | shape () const |
| Retrieves the shape of the Jacobian matrix as a tuple (rows, columns). | |
| size_t | rank () const |
| Retrieves the rank of the Jacobian matrix. | |
| size_t | nnz () const |
| Get the number of non-zero entries in the Jacobian matrix. | |
| bool | singular () const |
| Checks if the Jacobian matrix is singular. | |
| std::vector< JacobianEntry > | infs () const |
| Retrieves all entries in the Jacobian matrix that are infinite. | |
| std::vector< JacobianEntry > | nans () const |
| Retrieves all entries in the Jacobian matrix that are NaN (Not a Number). | |
| Eigen::SparseMatrix< double > | data () const |
| Provides access to the underlying sparse matrix data. | |
| const std::unordered_map< fourdst::atomic::Species, size_t > & | mapping () const |
| Provides access to the species-to-index mapping. | |
| void | to_csv (const std::string &filename) const |
| Exports the Jacobian matrix to a CSV file. | |
Private Attributes | |
| Eigen::SparseMatrix< double > | m_jacobianMatrix |
| std::unordered_map< fourdst::atomic::Species, size_t > | m_speciesToIndexMap |
| std::optional< size_t > | m_rank = std::nullopt |
A wrapper class for handling the network Jacobian matrix.
This class encapsulates an Eigen::SparseMatrix to represent the Jacobian matrix of a reaction network. It provides methods for accessing and modifying matrix entries using species identifiers, as well as utility functions for analyzing the matrix (e.g., checking for singularity, counting non-zero entries).
|
explicit |
Constructs a NetworkJacobian with the given sparse matrix and species index mapping function.
| jacobianMatrix | The sparse matrix representing the Jacobian. |
| indexToSpeciesFunc | A function that maps matrix indices to species identifiers. |
| gridfire::engine::NetworkJacobian::NetworkJacobian | ( | const NetworkJacobian & | jacobian | ) |
Copy constructor for NetworkJacobian.
| jacobian | The NetworkJacobian instance to copy from. |
|
noexcept |
Copy assignment operator for NetworkJacobian.
| jacobian | The NetworkJacobian instance to copy from. |
| Eigen::SparseMatrix< double > gridfire::engine::NetworkJacobian::data | ( | ) | const |
Provides access to the underlying sparse matrix data.
| std::vector< JacobianEntry > gridfire::engine::NetworkJacobian::infs | ( | ) | const |
Retrieves all entries in the Jacobian matrix that are infinite.
| const std::unordered_map< fourdst::atomic::Species, size_t > & gridfire::engine::NetworkJacobian::mapping | ( | ) | const |
Provides access to the species-to-index mapping.
| std::vector< JacobianEntry > gridfire::engine::NetworkJacobian::nans | ( | ) | const |
Retrieves all entries in the Jacobian matrix that are NaN (Not a Number).
| size_t gridfire::engine::NetworkJacobian::nnz | ( | ) | const |
Get the number of non-zero entries in the Jacobian matrix.
| double gridfire::engine::NetworkJacobian::operator() | ( | const fourdst::atomic::Species & | row, |
| const fourdst::atomic::Species & | col | ||
| ) | const |
Accesses the value at the specified row and column corresponding to the given species.
| row | Species for the row |
| col | Species for the column |
| double gridfire::engine::NetworkJacobian::operator() | ( | size_t | i, |
| size_t | j | ||
| ) | const |
Accesses the value at the specified row and column indices.
| i | Row index |
| j | Column index |
|
noexcept |
Move constructor for NetworkJacobian.
| jacobian | The NetworkJacobian instance to move from. |
| size_t gridfire::engine::NetworkJacobian::rank | ( | ) | const |
Retrieves the rank of the Jacobian matrix.
| void gridfire::engine::NetworkJacobian::set | ( | const fourdst::atomic::Species & | row, |
| const fourdst::atomic::Species & | col, | ||
| double | value | ||
| ) |
Sets the value at the specified row and column corresponding to the given species.
| row | Row species |
| col | Column species |
| value | Value to set |
| void gridfire::engine::NetworkJacobian::set | ( | const JacobianEntry & | entry | ) |
Sets the value in the Jacobian matrix based on a JacobianEntry.
| entry | The JacobianEntry containing row species, column species, and value. |
| void gridfire::engine::NetworkJacobian::set | ( | size_t | i, |
| size_t | j, | ||
| double | value | ||
| ) |
Sets the value at the specified row and column indices.
| i | Row index |
| j | Column index |
| value | Value to set |
| std::tuple< size_t, size_t > gridfire::engine::NetworkJacobian::shape | ( | ) | const |
Retrieves the shape of the Jacobian matrix as a tuple (rows, columns).
| bool gridfire::engine::NetworkJacobian::singular | ( | ) | const |
Checks if the Jacobian matrix is singular.
| void gridfire::engine::NetworkJacobian::to_csv | ( | const std::string & | filename | ) | const |
Exports the Jacobian matrix to a CSV file.
| filename | The name of the CSV file to export to. |
|
private |
|
mutableprivate |
|
private |