43 #define G_READ "GModelTemporalConst::read(GXmlElement&)"
44 #define G_WRITE "GModelTemporalConst::write(GXmlElement&)"
167 if (
this != &model) {
248 const bool& gradients)
const
287 double lambda = rate *
norm();
290 double time = tmin.
secs();
291 double tstop = tmax.
secs();
294 while (time <= tstop) {
297 time += ran.
exp(lambda);
382 result.append(
"=== GModelTemporalConst ===");
387 for (
int i = 0; i <
size(); ++i) {
Constant temporal model class interface definition.
const double & factor_gradient(void) const
Return parameter factor gradient.
double norm(const GVector &vector)
Computes vector norm.
std::vector< GModelPar * > m_pars
Parameter pointers.
const std::string & name(void) const
Return parameter name.
double gradient(void) const
Return parameter gradient.
virtual std::string type(void) const
Return model type.
Abstract temporal model base class.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
virtual GModelTemporalConst & operator=(const GModelTemporalConst &model)
Assignment operator.
Random number generator class.
virtual GModelTemporalConst * clone(void) const
Clone constant temporal model.
bool is_free(void) const
Signal if parameter is free.
void copy_members(const GModelTemporalConst &model)
Copy class members.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual void clear(void)
Clear constant temporal model.
const double & scale(void) const
Return parameter scale.
virtual ~GModelTemporalConst(void)
Destructor.
const GModelTemporalConst g_temporal_const_seed
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
void fix(void)
Fix a parameter.
GModelPar m_norm
Constant.
int size(void) const
Return number of parameters.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print constant information.
void clear(void)
Clear parameter.
GModelTemporalConst(void)
Void constructor.
void init_members(void)
Initialise class members.
void xml_check_parnum(const std::string &origin, const GXmlElement &xml, const int &number)
Checks number of parameters.
void free_members(void)
Delete class members.
Interface definition for the temporal model registry class.
const double & secs(void) const
Return time in seconds in native reference (TT)
Temporal model registry class definition.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
double value(void) const
Return parameter value.
virtual GModelTemporal & operator=(const GModelTemporal &model)
Assignment operator.
const std::string & unit(void) const
Return parameter unit.
Exception handler interface definition.
virtual void read(const GXmlElement &xml)
Read model from XML element.
double norm(void) const
Return normalization factor.
virtual double eval(const GTime &srcTime, const bool &gradients=false) const
Evaluate function.
void init_members(void)
Initialise class members.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
const GXmlElement * xml_get_par(const std::string &origin, const GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
void append(const GTime &time)
Append time to container.
Constant temporal model class.
void free_members(void)
Delete class members.
double exp(const double &lambda)
Returns exponential deviates.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
virtual GTimes mc(const double &rate, const GTime &tmin, const GTime &tmax, GRan &ran) const
Returns vector of random event times.
void xml_check_type(const std::string &origin, GXmlElement &xml, const std::string &type)
Checks the model type.