libROM
v1.0
Data-driven physical simulation library
|
#include <BasisReader.h>
Public Member Functions | |
BasisReader (const std::string &base_file_name, Database::formats db_format=Database::formats::HDF5, const int dim=-1) | |
The constructor for the BasisReader class takes the base part of the name of the files holding the basis vectors and the file format. More... | |
~BasisReader () | |
Destructor. | |
Matrix * | getSpatialBasis () |
Returns the spatial basis vectors as a Matrix. More... | |
Matrix * | getSpatialBasis (int n) |
Returns the first n spatial basis vectors for the requested time as a Matrix. More... | |
Matrix * | getSpatialBasis (int start_col, int end_col) |
Returns spatial basis vectors from start_col to end_col for the requested time as a Matrix. More... | |
Matrix * | getSpatialBasis (double ef) |
Returns the first n spatial basis vectors for the requested time as a Matrix that capture the given energy fraction. More... | |
Matrix * | getTemporalBasis () |
Returns the temporal basis vectors for the requested time as a Matrix. More... | |
Matrix * | getTemporalBasis (int n) |
Returns the first n temporal basis vectors for the requested time as a Matrix. More... | |
Matrix * | getTemporalBasis (int start_col, int end_col) |
Returns temporal basis vectors from start_col to end_col for the requested time as a Matrix. More... | |
Matrix * | getTemporalBasis (double ef) |
Returns the first n temporal basis vectors for the requested time as a Matrix that capture the given energy fraction. More... | |
Vector * | getSingularValues () |
Returns the singular values for the requested time. More... | |
Vector * | getSingularValues (double ef) |
Returns the largest singular values for the requested time that capture the given energy fraction. More... | |
int | getDim (const std::string kind) |
Returns the dimension of the system on this processor. More... | |
int | getNumSamples (const std::string kind) |
Returns the number of samples (columns) in file. More... | |
Matrix * | getSnapshotMatrix () |
Returns the snapshot matrix for the requested time. More... | |
Matrix * | getSnapshotMatrix (int n) |
Returns the first n columns of the snapshot matrix for the requested time. More... | |
Matrix * | getSnapshotMatrix (int start_col, int end_col) |
Returns the snapshot matrix from start_col to end_col for the requested time. More... | |
Class BasisReader reads the basis vectors from a file written by class BasisWriter.
Definition at line 33 of file BasisReader.h.
CAROM::BasisReader::BasisReader | ( | const std::string & | base_file_name, |
Database::formats | db_format = Database::formats::HDF5 , |
||
const int | dim = -1 |
||
) |
The constructor for the BasisReader class takes the base part of the name of the files holding the basis vectors and the file format.
[in] | base_file_name | The base part of the name of the files holding the basis vectors. |
[in] | db_format | Format of the file to read. One of the implemented file formats defined in Database. |
[in] | dim | Number of rows of basis that will be read from a file. If negative, will use the dimension from the rank-specific local file. |
Definition at line 23 of file BasisReader.cpp.
int CAROM::BasisReader::getDim | ( | const std::string | kind | ) |
Returns the dimension of the system on this processor.
[in] | kind | Type of matrix whose row-dimension is returned. "basis" - local dimension of spatial basis "snapshot" - local dimension of snapshot matrix "temporal_basis" - global dimension of temporal basis |
Definition at line 273 of file BasisReader.cpp.
int CAROM::BasisReader::getNumSamples | ( | const std::string | kind | ) |
Returns the number of samples (columns) in file.
Definition at line 304 of file BasisReader.cpp.
Vector * CAROM::BasisReader::getSingularValues | ( | ) |
Returns the singular values for the requested time.
Definition at line 223 of file BasisReader.cpp.
Vector * CAROM::BasisReader::getSingularValues | ( | double | ef | ) |
Returns the largest singular values for the requested time that capture the given energy fraction.
[in] | ef | The desired energy fraction. |
Definition at line 239 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getSnapshotMatrix | ( | ) |
Returns the snapshot matrix for the requested time.
Definition at line 324 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getSnapshotMatrix | ( | int | n | ) |
Returns the first n columns of the snapshot matrix for the requested time.
[in] | n | The number of basis vectors desired. |
Definition at line 340 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getSnapshotMatrix | ( | int | start_col, |
int | end_col | ||
) |
Returns the snapshot matrix from start_col to end_col for the requested time.
[in] | start_col | The starting column desired. |
[in] | end_col | The starting column desired. |
Definition at line 347 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getSpatialBasis | ( | ) |
Returns the spatial basis vectors as a Matrix.
Definition at line 76 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getSpatialBasis | ( | double | ef | ) |
Returns the first n spatial basis vectors for the requested time as a Matrix that capture the given energy fraction.
[in] | ef | The desired energy fraction. |
Definition at line 123 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getSpatialBasis | ( | int | n | ) |
Returns the first n spatial basis vectors for the requested time as a Matrix.
[in] | n | The number of spatial basis vectors desired. |
Definition at line 91 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getSpatialBasis | ( | int | start_col, |
int | end_col | ||
) |
Returns spatial basis vectors from start_col to end_col for the requested time as a Matrix.
[in] | start_col | The starting column desired. |
[in] | end_col | The starting column desired. |
Definition at line 98 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getTemporalBasis | ( | ) |
Returns the temporal basis vectors for the requested time as a Matrix.
Definition at line 150 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getTemporalBasis | ( | double | ef | ) |
Returns the first n temporal basis vectors for the requested time as a Matrix that capture the given energy fraction.
[in] | ef | The desired energy fraction. |
Definition at line 196 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getTemporalBasis | ( | int | n | ) |
Returns the first n temporal basis vectors for the requested time as a Matrix.
[in] | n | The number of temporal basis vectors desired. |
Definition at line 165 of file BasisReader.cpp.
Matrix * CAROM::BasisReader::getTemporalBasis | ( | int | start_col, |
int | end_col | ||
) |
Returns temporal basis vectors from start_col to end_col for the requested time as a Matrix.
[in] | start_col | The starting column desired. |
[in] | end_col | The starting column desired. |
Definition at line 172 of file BasisReader.cpp.