libROM  v1.0
Data-driven physical simulation library
IncrementalSVDBrand.h
1 
11 // Description: The concrete implementation of the incremental SVD algorithm
12 // using Matthew Brand's (exact) "fast update" method.
13 
14 #ifndef included_IncrementalSVDBrand_h
15 #define included_IncrementalSVDBrand_h
16 
17 #include "IncrementalSVD.h"
18 #include "linalg/Options.h"
19 
20 namespace CAROM {
21 
28 {
29 public:
34 
41  std::shared_ptr<const Matrix>
42  getSpatialBasis() override;
43 
50  std::shared_ptr<const Matrix>
51  getTemporalBasis() override;
52 
53 private:
54  friend class BasisGenerator;
55 
68  Options options,
69  const std::string& basis_file_name);
70 
75 
80  const IncrementalSVDBrand& other);
81 
86  operator = (
87  const IncrementalSVDBrand& rhs);
88 
98  void
99  buildInitialSVD(
100  double* u) override;
101 
112  bool
113  buildIncrementalSVD(
114  double* u, bool add_without_increase = false) override;
115 
119  void
120  updateSpatialBasis();
121 
125  void
126  updateTemporalBasis();
127 
131  void
132  computeBasis() override;
133 
141  void
142  addLinearlyDependentSample(
143  const Matrix & A,
144  const Matrix & W,
145  const Matrix & sigma) override;
146 
155  void
156  addNewSample(
157  const Vector & j,
158  const Matrix & A,
159  const Matrix & W,
160  const Matrix & sigma) override;
161 
166  std::unique_ptr<Matrix> d_Up;
167 
171  double d_singular_value_tol;
172 
173 };
174 
175 }
176 
177 #endif
std::shared_ptr< const Matrix > getTemporalBasis() override
Returns the temporal basis vectors for the current time interval as a Matrix.
std::shared_ptr< const Matrix > getSpatialBasis() override
Returns the basis vectors for the current time interval as a Matrix.