libROM  v1.0
Data-driven physical simulation library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CAROM::SVD Class Referenceabstract

#include <SVD.h>

Inheritance diagram for CAROM::SVD:
CAROM::IncrementalSVD CAROM::StaticSVD CAROM::IncrementalSVDBrand CAROM::IncrementalSVDFastUpdate CAROM::IncrementalSVDStandard CAROM::RandomizedSVD

Public Member Functions

 SVD (Options options)
 Constructor. More...
 
virtual bool takeSample (double *u_in, bool add_without_increase)=0
 Collect the new sample, u_in at supplied time. More...
 
int getDim () const
 Returns the dimension of the system on this processor. More...
 
virtual std::shared_ptr< const MatrixgetSpatialBasis ()=0
 Returns the basis vectors for the current time interval. More...
 
virtual std::shared_ptr< const MatrixgetTemporalBasis ()=0
 Returns the temporal basis vectors for the current time interval. More...
 
virtual std::shared_ptr< const VectorgetSingularValues ()=0
 Returns the singular values for the current time interval. More...
 
virtual std::shared_ptr< const MatrixgetSnapshotMatrix ()=0
 Returns the singular values for the current time interval. More...
 
int getNumSamples () const
 Get the number of samples taken.
 
int getMaxNumSamples () const
 Get the maximum number of samples that can be taken. SVD class will return an error if the number of samples exceeds the maximum.
 

Protected Member Functions

bool isFirstSample () const
 Returns true if the next sample will result in a new time interval. More...
 

Protected Attributes

const int d_dim
 Dimension of the system.
 
int d_num_samples
 Number of samples stored for the current time interval.
 
int d_num_rows_of_W
 Number of rows in right singular matrix.
 
const int d_max_num_samples
 The maximum number of samples.
 
std::shared_ptr< Matrixd_basis
 The globalized basis vectors for the current time interval. More...
 
std::shared_ptr< Matrixd_basis_right
 The globalized right basis vectors for the current time interval. More...
 
std::shared_ptr< Matrixd_U
 The matrix U which is large. More...
 
std::shared_ptr< Matrixd_W
 The matrix U which is large. More...
 
std::shared_ptr< Vectord_S
 The vector S which is small. More...
 
std::shared_ptr< Matrixd_snapshots
 The globalized snapshot vectors for the current time interval. More...
 
bool d_debug_algorithm
 Flag to indicate if results of algorithm should be printed for debugging purposes.
 

Detailed Description

Class SVD defines the interface to the generic SVD algorithm. The API is intentionally small. One may collect the samples, compute the SVD, and get the dimension of the system.

Definition at line 28 of file SVD.h.

Constructor & Destructor Documentation

◆ SVD()

CAROM::SVD::SVD ( Options  options)

Constructor.

Parameters
[in]optionsThe struct containing the options for this abstract SVD class.
See also
Options

Definition at line 18 of file SVD.cpp.

Member Function Documentation

◆ getDim()

int CAROM::SVD::getDim ( ) const
inline

Returns the dimension of the system on this processor.

Returns
The dimension of the system on this processor.

Definition at line 64 of file SVD.h.

◆ getSingularValues()

virtual std::shared_ptr<const Vector> CAROM::SVD::getSingularValues ( )
pure virtual

Returns the singular values for the current time interval.

Returns
The singular values for the current time interval.

Implemented in CAROM::StaticSVD, and CAROM::IncrementalSVD.

◆ getSnapshotMatrix()

virtual std::shared_ptr<const Matrix> CAROM::SVD::getSnapshotMatrix ( )
pure virtual

Returns the singular values for the current time interval.

Returns
The singular values for the current time interval.

Implemented in CAROM::StaticSVD, and CAROM::IncrementalSVD.

◆ getSpatialBasis()

virtual std::shared_ptr<const Matrix> CAROM::SVD::getSpatialBasis ( )
pure virtual

Returns the basis vectors for the current time interval.

Returns
The basis vectors for the current time interval.

Implemented in CAROM::StaticSVD, CAROM::IncrementalSVDBrand, and CAROM::IncrementalSVD.

◆ getTemporalBasis()

virtual std::shared_ptr<const Matrix> CAROM::SVD::getTemporalBasis ( )
pure virtual

Returns the temporal basis vectors for the current time interval.

Returns
The temporal basis vectors for the current time interval.

Implemented in CAROM::StaticSVD, CAROM::IncrementalSVDBrand, and CAROM::IncrementalSVD.

◆ isFirstSample()

bool CAROM::SVD::isFirstSample ( ) const
inlineprotected

Returns true if the next sample will result in a new time interval.

Returns
True if the next sample results in the creation of a new time interval.

Definition at line 133 of file SVD.h.

◆ takeSample()

virtual bool CAROM::SVD::takeSample ( double *  u_in,
bool  add_without_increase 
)
pure virtual

Collect the new sample, u_in at supplied time.

Precondition
u_in != 0
Parameters
[in]u_inThe new sample.
[in]add_without_increaseIf true, the addLinearlyDependent is invoked. This only applies to incremental SVD.
Returns
True if the sampling was successful.

Implemented in CAROM::StaticSVD, and CAROM::IncrementalSVD.

Member Data Documentation

◆ d_basis

std::shared_ptr<Matrix> CAROM::SVD::d_basis
protected

The globalized basis vectors for the current time interval.

The basis vectors are large and each process owns all of the basis vectors.

Definition at line 164 of file SVD.h.

◆ d_basis_right

std::shared_ptr<Matrix> CAROM::SVD::d_basis_right
protected

The globalized right basis vectors for the current time interval.

Depending on the SVD algorithm, it may be distributed across all processors or each processor may own all of U.

Definition at line 172 of file SVD.h.

◆ d_S

std::shared_ptr<Vector> CAROM::SVD::d_S
protected

The vector S which is small.

For all SVD algorithms, S is not distributed and the entire vector exists on each processor.

Definition at line 196 of file SVD.h.

◆ d_snapshots

std::shared_ptr<Matrix> CAROM::SVD::d_snapshots
protected

The globalized snapshot vectors for the current time interval.

The snapshot vectors are large and each process owns all of the snapshot vectors.

Definition at line 204 of file SVD.h.

◆ d_U

std::shared_ptr<Matrix> CAROM::SVD::d_U
protected

The matrix U which is large.

Depending on the SVD algorithm, d_U may be distributed across all processors or each processor may own all of U.

Definition at line 180 of file SVD.h.

◆ d_W

std::shared_ptr<Matrix> CAROM::SVD::d_W
protected

The matrix U which is large.

Depending on the SVD algorithm, d_W may be distributed across all processors or each processor may own all of U.

Definition at line 188 of file SVD.h.


The documentation for this class was generated from the following files: