Feel++  0.92.0
Friends
Feel::CRBSCM< TruthModelType > Class Template Reference

SCM algorithm. More...

#include <crbscm.hpp>

Inheritance diagram for Feel::CRBSCM< TruthModelType >:
Feel::CRBDB

List of all members.

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
CRBSCMoperator= (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 $y \in \mathbb{R}^{Q_a}$
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

Detailed Description

template<typename TruthModelType>
class Feel::CRBSCM< TruthModelType >

SCM algorithm.

Template Parameters:
TruthModelTypethe 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

Author:
Christophe Prud'homme
See also:
page scm

Member Function Documentation

template<typename TruthModelType >
void Feel::CRBSCM< TruthModelType >::checkC ( size_type  K) const

check $C_K$ properties

Parameters:
Kdimension of $C_K$

References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().

template<typename TruthModelType>
void Feel::CRBSCM< TruthModelType >::generate ( )

generate offline the space $C_K$

template<typename TruthModelType >
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$

Parameters:
mu$ \mu$ the parameter at which to evaluate the coercive constant
Kthe dimension of $Y_{\mathrm{UB}}$
Returns:
compute online the lower bounmd

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().

template<typename TruthModelType>
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$

Parameters:
mu$ \mu$ the parameter at which to evaluate the coercive constant
Kthe dimension of $Y_{\mathrm{UB}}$
Returns:
compute online the lower bounmd

References Feel::CRBSCM< TruthModelType >::lb().

template<typename TruthModelType >
bool Feel::CRBSCM< TruthModelType >::loadDB ( ) [virtual]
template<typename TruthModelType >
CRBSCM< TruthModelType >::relative_error_type Feel::CRBSCM< TruthModelType >::maxRelativeError ( size_type  K) const

Retuns maximum value of the relative error.

Parameters:
Xifine sampling of the parameter space

References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().

Referenced by Feel::CRBSCM< TruthModelType >::offline().

template<typename TruthModelType >
std::vector< boost::tuple< double, double, double > > Feel::CRBSCM< TruthModelType >::offline ( )
template<typename TruthModelType>
bounds_type Feel::CRBSCM< TruthModelType >::online ( ) const [inline]

Online computation

template<typename TruthModelType >
std::vector< double > Feel::CRBSCM< TruthModelType >::run ( parameter_type const &  mu,
int  K 
)
Parameters:
Ksize of C_K
muparameter set

References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().

template<typename TruthModelType >
void Feel::CRBSCM< TruthModelType >::run ( const double *  X,
unsigned long  N,
double *  Y,
unsigned long  P 
)

run scm for a set of parameter

Parameters:
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().

template<typename TruthModelType >
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().

template<typename TruthModelType >
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$

Parameters:
mu$ \mu$ the parameter at which to evaluate the coercive constant
Kthe dimension of $Y_{\mathrm{UB}}$
Returns:
compute online the lower bounmd

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().

template<typename TruthModelType>
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$

Parameters:
mu$ \mu$ the parameter at which to evaluate the coercive constant
Kthe dimension of $Y_{\mathrm{UB}}$
Returns:
compute online the lower bounmd

References Feel::CRBSCM< TruthModelType >::ub().