libROM  v1.0
Data-driven physical simulation library
Options.h
1 
11 // Description: A class defining the parameters to the BasisGenerator class and
12 // SVD algorithm.
13 
14 #ifndef included_Options_h
15 #define included_Options_h
16 
17 #include "utils/Utilities.h"
18 
19 namespace CAROM {
20 
26 class Options
27 {
28 public:
43  Options(int dim_,
44  int max_num_samples_,
45  bool update_right_SV_ = false,
46  bool write_snapshots_ = false
47  ): dim(dim_),
48  max_basis_dimension(max_num_samples_),
49  max_num_samples(max_num_samples_),
50  update_right_SV(update_right_SV_),
51  write_snapshots(write_snapshots_)
52  {};
53 
63  int max_basis_dimension_
64  )
65  {
66  max_basis_dimension = max_basis_dimension_;
67  return *this;
68  }
69 
83  double singular_value_tol_
84  )
85  {
86  singular_value_tol = singular_value_tol_;
87  return *this;
88  }
89 
96  bool debug_algorithm_
97  )
98  {
99  debug_algorithm = debug_algorithm_;
100  return *this;
101  }
102 
112  bool randomized_,
113  int randomized_subspace_dim_ = -1,
114  int random_seed_ = 1
115  )
116  {
117  randomized = randomized_;
118  randomized_subspace_dim = randomized_subspace_dim_;
119  random_seed = random_seed_;
120  return *this;
121  }
122 
143  double linearity_tol_,
144  double initial_dt_,
145  double sampling_tol_,
146  double max_time_between_samples_,
147  bool fast_update_ = false,
148  bool fast_update_brand_ = false,
149  bool skip_linearly_dependent_ = false
150  )
151  {
152  linearity_tol = linearity_tol_;
153  initial_dt = initial_dt_;
154  sampling_tol = sampling_tol_;
155  max_time_between_samples = max_time_between_samples_;
156  fast_update = fast_update_;
157  fast_update_brand = fast_update_brand_;
158  skip_linearly_dependent = skip_linearly_dependent_;
159  return *this;
160  }
161 
174  bool save_state_,
175  bool restore_state_
176  )
177  {
178  save_state = save_state_;
179  restore_state = restore_state_;
180  return *this;
181  }
182 
201  double min_sampling_time_step_scale_,
202  double sampling_time_step_scale_,
203  double max_sampling_time_step_scale_
204  )
205  {
206  min_sampling_time_step_scale = min_sampling_time_step_scale_;
207  sampling_time_step_scale = sampling_time_step_scale_;
208  max_sampling_time_step_scale = max_sampling_time_step_scale_;
209  return *this;
210  }
211 
215  int dim = -1;
216 
220  int max_num_samples = -1;
221 
225  bool update_right_SV = false;
226 
230  bool write_snapshots = false;
231 
236 
240  double singular_value_tol = 0;
241 
245  bool debug_algorithm = false;
246 
247  // Randomized SVD
248 
252  bool randomized = false;
253 
259 
263  int random_seed = 1;
264 
265  // Incremental SVD
266 
271  double linearity_tol = -1;
272 
277  double initial_dt = -1;
278 
284  double sampling_tol = -1;
285 
291 
296  bool fast_update = false;
297 
302  bool fast_update_brand = false;
303 
309 
317  bool save_state = false;
318 
323  bool restore_state = false;
324 
330 
336 
342 
347 };
348 
349 }
350 
351 #endif
bool fast_update_brand
If true use the exact Brand's algorithm for the incremental SVD.
Definition: Options.h:302
double max_time_between_samples
The upper bound on time between samples of the incremental SVD algorithm.
Definition: Options.h:290
bool debug_algorithm
Whether debugging is turned on (any randomness is turned off).
Definition: Options.h:245
bool write_snapshots
Whether to write snapshots or bases.
Definition: Options.h:230
bool restore_state
If true the state of the incremental SVD will be restored when the object is created.
Definition: Options.h:323
int randomized_subspace_dim
The dimension of the randomized subspace used in the randomized SVD algogrithm.
Definition: Options.h:258
Options(int dim_, int max_num_samples_, bool update_right_SV_=false, bool write_snapshots_=false)
Constructor.
Definition: Options.h:43
int dim
The dimension of the system on this processor.
Definition: Options.h:215
double max_sampling_time_step_scale
The maximum overall scale factor to apply to time step of the incremental SVD algorithm.
Definition: Options.h:341
int max_num_samples
The maximum number of samples.
Definition: Options.h:220
Options setSingularValueTol(double singular_value_tol_)
Sets the singular value tolerance of the SVD algorithm.
Definition: Options.h:82
double singular_value_tol
The singular value tolerance used in the SVD algorithm.
Definition: Options.h:240
double linearity_tol
The tolerance of the incremental SVD algorithm to determine whether or not a sample is linearly depen...
Definition: Options.h:271
bool static_svd_preserve_snapshot
Option to preserve snapshot in StaticSVD::computeSVD.
Definition: Options.h:346
Options setSamplingTimeStepScale(double min_sampling_time_step_scale_, double sampling_time_step_scale_, double max_sampling_time_step_scale_)
Sets the sampling time step scaling of the incremental SVD algorithm.
Definition: Options.h:200
bool save_state
If true the state of the incremental SVD will be written to disk when the object is deleted....
Definition: Options.h:317
double sampling_tol
The sampling control tolerance of the incremental SVD algorithm. Limits error in projection of soluti...
Definition: Options.h:284
double min_sampling_time_step_scale
The minimum overall scale factor to apply to time step of the incremental SVD algorithm.
Definition: Options.h:329
Options setMaxBasisDimension(int max_basis_dimension_)
Sets the maximum basis dimension of the SVD algorithm.
Definition: Options.h:62
Options setDebugMode(bool debug_algorithm_)
Sets whether debugging is turned on.
Definition: Options.h:95
Options setRandomizedSVD(bool randomized_, int randomized_subspace_dim_=-1, int random_seed_=1)
Sets the parameters of the randomized SVD algorithm.
Definition: Options.h:111
Options setIncrementalSVD(double linearity_tol_, double initial_dt_, double sampling_tol_, double max_time_between_samples_, bool fast_update_=false, bool fast_update_brand_=false, bool skip_linearly_dependent_=false)
Sets the essential parameters of the incremental SVD algorithm.
Definition: Options.h:142
bool randomized
Whether to use the randomized SVD algorithm.
Definition: Options.h:252
bool update_right_SV
Whether to update the right singular values.
Definition: Options.h:225
bool fast_update
If true use the fast update version of the incremental SVD algorithm.
Definition: Options.h:296
bool skip_linearly_dependent
If true skip linearly dependent samples of the incremental SVD algorithm.
Definition: Options.h:308
Options setStateIO(bool save_state_, bool restore_state_)
Sets the state IO parameters of the incremental SVD algorithm.
Definition: Options.h:173
double initial_dt
The initial simulation time step of the incremental SVD algorithm.
Definition: Options.h:277
int max_basis_dimension
The maximum dimension of the basis.
Definition: Options.h:235
int random_seed
The random seed used to initialize the algorithm.
Definition: Options.h:263
double sampling_time_step_scale
The scaling factor to apply to sampling algorithm of the incremental SVD algorithm.
Definition: Options.h:335