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

#include <StaticSVD.h>

Inheritance diagram for CAROM::StaticSVD:
CAROM::SVD CAROM::RandomizedSVD

Public Member Functions

 ~StaticSVD ()
 
virtual bool takeSample (double *u_in, bool add_without_increase=false)
 Collect the new sample, u_in at the supplied time. More...
 
virtual const MatrixgetSpatialBasis ()
 Returns the basis vectors for the current time interval as a Matrix. More...
 
virtual const MatrixgetTemporalBasis ()
 Returns the temporal basis vectors for the current time interval as a Matrix. More...
 
virtual const VectorgetSingularValues ()
 Returns the singular values for the current time interval. More...
 
virtual const MatrixgetSnapshotMatrix ()
 Returns the snapshot matrix for the current time interval. More...
 
- Public Member Functions inherited from CAROM::SVD
 SVD (Options options)
 Constructor. More...
 
 ~SVD ()
 
int getDim () const
 Returns the dimension of the system on this processor. 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

 StaticSVD (Options options)
 Constructor. More...
 
virtual void computeSVD ()
 Gathers samples from all other processors to form complete sample of system and computes the SVD.
 
bool isBasisCurrent ()
 Checks if the basis vectors are computed from the current snapshot. More...
 
void get_global_info ()
 Get the system's total row dimension and where my rows sit in the matrix.
 
void delete_samples ()
 Delete the samples from ScaLAPACK.
 
void delete_factorizer ()
 Delete the factorizer from ScaLAPACK.
 
void broadcast_sample (const double *u_in)
 Broadcast the sample to all processors.
 
- Protected Member Functions inherited from CAROM::SVD
bool isFirstSample () const
 Returns true if the next sample will result in a new time interval. More...
 

Protected Attributes

std::unique_ptr< SLPK_Matrix > d_samples
 Current samples of the system.
 
std::unique_ptr< SVDManager > d_factorizer
 Factorization manager object used to compute the SVD.
 
bool d_basis_is_current
 Flag to indicate if the basis vectors for the current time interval are up to date.
 
int d_rank
 The rank of the process this object belongs to.
 
int d_num_procs
 The number of processors being run on.
 
std::vector< int > d_istarts
 The starting row (0-based) of the matrix that each process owns. Stored to avoid an MPI operation to get this operation every time we scatter a sample.
 
std::vector< int > d_dims
 The number of rows that each process owns. Stored to avoid an MPI operation to get this operation every time we scatter a sample.
 
int d_total_dim
 The total dimension of the system (row dimension)
 
int d_nprow
 The number of processor rows in the grid.
 
int d_npcol
 The number of processor columns in the grid.
 
int d_blocksize
 The block size used internally for computing the SVD.
 
int d_max_basis_dimension
 The max number of basis vectors to return.
 
double d_singular_value_tol
 The tolerance for singular values below which to drop vectors.
 
- Protected Attributes inherited from CAROM::SVD
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.
 
Matrixd_basis
 The globalized basis vectors for the current time interval. More...
 
Matrixd_basis_right
 The globalized right basis vectors for the current time interval. More...
 
Matrixd_U
 The matrix U which is large. More...
 
Matrixd_W
 The matrix U which is large. More...
 
Vectord_S
 The vector S which is small. More...
 
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.
 

Friends

class BasisGenerator
 

Detailed Description

StaticSVD implements the interface of class SVD for the static SVD algorithm. This algorithm is not scalable and is intended primarily as a sanity check of the incremental SVD algorithm.

Definition at line 32 of file StaticSVD.h.

Constructor & Destructor Documentation

◆ ~StaticSVD()

CAROM::StaticSVD::~StaticSVD ( )

Destructor.

Definition at line 68 of file StaticSVD.cpp.

◆ StaticSVD()

CAROM::StaticSVD::StaticSVD ( Options  options)
protected

Constructor.

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

Definition at line 35 of file StaticSVD.cpp.

Member Function Documentation

◆ getSingularValues()

const Vector * CAROM::StaticSVD::getSingularValues ( )
virtual

Returns the singular values for the current time interval.

Postcondition
thisIntervalBasisCurrent()
Returns
The singular values for the current time interval.

Implements CAROM::SVD.

Definition at line 191 of file StaticSVD.cpp.

◆ getSnapshotMatrix()

const Matrix * CAROM::StaticSVD::getSnapshotMatrix ( )
virtual

Returns the snapshot matrix for the current time interval.

Returns
The snapshot matrix for the current time interval.

Implements CAROM::SVD.

Definition at line 216 of file StaticSVD.cpp.

◆ getSpatialBasis()

const Matrix * CAROM::StaticSVD::getSpatialBasis ( )
virtual

Returns the basis vectors for the current time interval as a Matrix.

Postcondition
thisIntervalBasisCurrent()
Returns
The basis vectors for the current time interval.

Implements CAROM::SVD.

Definition at line 141 of file StaticSVD.cpp.

◆ getTemporalBasis()

const Matrix * CAROM::StaticSVD::getTemporalBasis ( )
virtual

Returns the temporal basis vectors for the current time interval as a Matrix.

Postcondition
thisIntervalBasisCurrent()
Returns
The temporal basis vectors for the current time interval.

Implements CAROM::SVD.

Definition at line 166 of file StaticSVD.cpp.

◆ isBasisCurrent()

bool CAROM::StaticSVD::isBasisCurrent ( )
inlineprotected

Checks if the basis vectors are computed from the current snapshot.

Returns
True if the basis vectors are computed from the current snapshot.

Definition at line 126 of file StaticSVD.h.

◆ takeSample()

bool CAROM::StaticSVD::takeSample ( double *  u_in,
bool  add_without_increase = false 
)
virtual

Collect the new sample, u_in at the supplied time.

Precondition
u_in != 0
Parameters
[in]u_inThe new sample.
[in]add_without_increaseIf true, then addLinearlyDependent will be invoked
Returns
True if the sampling was successful.

Implements CAROM::SVD.

Definition at line 101 of file StaticSVD.cpp.


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