Feel++
0.92.0
|
SCM algorithm. More...
#include <crbscm.hpp>
Public Types | |
Typedefs | |
typedef TruthModelType | truth_model_type |
typedef truth_model_type | model_type |
typedef boost::shared_ptr < truth_model_type > | truth_model_ptrtype |
typedef double | value_type |
typedef boost::tuple< double, double > | bounds_type |
typedef ParameterSpace < TruthModelType::ParameterSpaceDimension > | parameterspace_type |
typedef boost::shared_ptr < parameterspace_type > | parameterspace_ptrtype |
typedef parameterspace_type::element_type | parameter_type |
typedef parameterspace_type::element_ptrtype | parameter_ptrtype |
typedef parameterspace_type::sampling_type | sampling_type |
typedef parameterspace_type::sampling_ptrtype | sampling_ptrtype |
typedef boost::tuple< double, parameter_type, size_type, double, double > | relative_error_type |
typedef model_type::backend_type | backend_type |
typedef model_type::sparse_matrix_ptrtype | sparse_matrix_ptrtype |
typedef model_type::vector_ptrtype | vector_ptrtype |
typedef model_type::theta_vector_type | theta_vector_type |
typedef Eigen::VectorXd | y_type |
typedef std::vector< y_type > | y_set_type |
typedef std::vector < boost::tuple< double, double > > | y_bounds_type |
Public Member Functions | |
Constructors, destructor | |
CRBSCM () | |
default constructor | |
CRBSCM (std::string const &name, po::variables_map const &vm) | |
constructor from command line options | |
CRBSCM (CRBSCM const &o) | |
copy constructor | |
~CRBSCM () | |
destructor | |
Operator overloads | |
CRBSCM & | operator= (CRBSCM const &o) |
copy operator | |
Accessors | |
size_type | KMax () const |
Returns maximum value of K. | |
int | maxIter () const |
return max iterations | |
parameterspace_ptrtype | Dmu () const |
return the parameter space | |
int | Mplus () const |
get M+ | |
int | Malpha () |
get Malpha | |
Mutators | |
void | setTolerance (double tolerance) |
set offline tolerance | |
void | setMplus (int Mplus) |
set M+ | |
void | setMalpha (int Malpha) |
set Malpha | |
void | setTruthModel (truth_model_ptrtype const &model) |
set the truth offline model | |
void | setMaxIter (int K) |
set Kmax | |
void | setScmForMassMatrix (bool b) |
set bool ( if we do scm for mass matrix or not ) | |
Methods | |
void | generate () |
void | checkC (size_type K) const |
boost::tuple< value_type, value_type > | ex (parameter_type const &mu) const |
boost::tuple< value_type, value_type > | lb (parameter_type const &mu, size_type K=invalid_size_type_value, int indexmu=-1) const |
boost::tuple< value_type, value_type > | lb (parameter_ptrtype const &mu, size_type K=invalid_size_type_value, int indexmu=-1) const |
boost::tuple< value_type, value_type > | ub (parameter_type const &mu, size_type K=invalid_size_type_value) const |
boost::tuple< value_type, value_type > | ub (parameter_ptrtype const &mu, size_type K=invalid_size_type_value) const |
std::vector< boost::tuple < double, double, double > > | offline () |
bounds_type | online () const |
relative_error_type | maxRelativeError (size_type K) const |
Retuns maximum value of the relative error. | |
void | computeYBounds () |
compute the bounds for ![]() | |
std::vector< double > | run (parameter_type const &mu, int K) |
void | run (const double *X, unsigned long N, double *Y, unsigned long P) |
void | saveDB () |
bool | loadDB () |
bool | rebuildDB () |
bool | doScmForMassMatrix () |
Friends | |
class | boost::serialization::access |
SCM algorithm.
TruthModelType | the type of the class that describes the truth (e.g. fem) model problem |
TruthModelType must support a certain interface: affine decomposition, solve for fm problem and problem associated with with affine decomposition. As to the SCM, it should problem
void Feel::CRBSCM< TruthModelType >::checkC | ( | size_type | K | ) | const |
check properties
K | dimension of ![]() |
References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().
void Feel::CRBSCM< TruthModelType >::generate | ( | ) |
generate offline the space
boost::tuple< typename CRBSCM< TruthModelType >::value_type, double > Feel::CRBSCM< TruthModelType >::lb | ( | parameter_type const & | mu, |
size_type | K = invalid_size_type_value , |
||
int | indexmu = -1 |
||
) | const |
Returns the lower bound of the coercive constant given a parameter
mu | ![]() |
K | the dimension of ![]() |
References Feel::invalid_size_type_value, Feel::CRBSCM< TruthModelType >::KMax(), Feel::CRBSCM< TruthModelType >::Malpha(), and Feel::CRBSCM< TruthModelType >::Mplus().
Referenced by Feel::CRBSCM< TruthModelType >::checkC(), Feel::CRBSCM< TruthModelType >::lb(), Feel::CRBSCM< TruthModelType >::maxRelativeError(), and Feel::CRBSCM< TruthModelType >::run().
boost::tuple<value_type,value_type> Feel::CRBSCM< TruthModelType >::lb | ( | parameter_ptrtype const & | mu, |
size_type | K = invalid_size_type_value , |
||
int | indexmu = -1 |
||
) | const [inline] |
Returns the lower bound of the coercive constant given a parameter
mu | ![]() |
K | the dimension of ![]() |
References Feel::CRBSCM< TruthModelType >::lb().
bool Feel::CRBSCM< TruthModelType >::loadDB | ( | ) | [virtual] |
load the CRB database
Reimplemented from Feel::CRBDB.
References Feel::CRBDB::lookForDB().
Referenced by Feel::CRBSCM< TruthModelType >::CRBSCM(), and Feel::CRBSCM< TruthModelType >::setTruthModel().
CRBSCM< TruthModelType >::relative_error_type Feel::CRBSCM< TruthModelType >::maxRelativeError | ( | size_type | K | ) | const |
Retuns maximum value of the relative error.
Xi | fine sampling of the parameter space |
References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().
Referenced by Feel::CRBSCM< TruthModelType >::offline().
std::vector< boost::tuple< double, double, double > > Feel::CRBSCM< TruthModelType >::offline | ( | ) |
Offline computation
References Feel::CRBSCM< TruthModelType >::computeYBounds(), Feel::CRBSCM< TruthModelType >::maxRelativeError(), and Feel::CRBSCM< TruthModelType >::saveDB().
bounds_type Feel::CRBSCM< TruthModelType >::online | ( | ) | const [inline] |
Online computation
std::vector< double > Feel::CRBSCM< TruthModelType >::run | ( | parameter_type const & | mu, |
int | K | ||
) |
K | size of C_K |
mu | parameter set |
References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().
void Feel::CRBSCM< TruthModelType >::run | ( | const double * | X, |
unsigned long | N, | ||
double * | Y, | ||
unsigned long | P | ||
) |
run scm for a set of parameter
X | - input parameter |
N | - number of input parameter |
Y | - outputs |
P | - number of outputs |
the output is the lower/upper bounds, hence P=2
References Feel::CRBSCM< TruthModelType >::KMax(), Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().
void Feel::CRBSCM< TruthModelType >::saveDB | ( | ) | [virtual] |
save the CRB database
Reimplemented from Feel::CRBDB.
References Feel::CRBDB::dbFilename(), and Feel::CRBDB::dbLocalPath().
Referenced by Feel::CRBSCM< TruthModelType >::offline().
boost::tuple< typename CRBSCM< TruthModelType >::value_type, double > Feel::CRBSCM< TruthModelType >::ub | ( | parameter_type const & | mu, |
size_type | K = invalid_size_type_value |
||
) | const |
Returns the upper bound of the coercive constant given a parameter
mu | ![]() |
K | the dimension of ![]() |
References Feel::invalid_size_type_value, and Feel::CRBSCM< TruthModelType >::KMax().
Referenced by Feel::CRBSCM< TruthModelType >::checkC(), Feel::CRBSCM< TruthModelType >::maxRelativeError(), Feel::CRBSCM< TruthModelType >::run(), and Feel::CRBSCM< TruthModelType >::ub().
boost::tuple<value_type,value_type> Feel::CRBSCM< TruthModelType >::ub | ( | parameter_ptrtype const & | mu, |
size_type | K = invalid_size_type_value |
||
) | const [inline] |
Returns the upper bound of the coercive constant given a parameter
mu | ![]() |
K | the dimension of ![]() |
References Feel::CRBSCM< TruthModelType >::ub().