27#ifndef GMODELSPECTRALNODES_HPP
28#define GMODELSPECTRALNODES_HPP
98 virtual void clear(
void);
100 virtual std::string
classname(
void)
const;
101 virtual std::string
type(
void)
const;
104 const bool& gradients =
false)
const;
118 int nodes(
void)
const;
122 void remove(
const int& index);
127 double intensity(
const int& index)
const;
129 double error(
const int& index)
const;
181 return (
"GModelSpectralNodes");
195 return "NodeFunction";
Energy value class definition.
Model parameter class interface definition.
Abstract spectral model base class interface definition.
Node array class interface definition.
Class that handles energies in a unit independent way.
Spectral nodes model class.
virtual void read(const GXmlElement &xml)
Read model from XML element.
std::vector< GModelPar > m_values
Node values.
virtual GModelSpectralNodes & operator=(const GModelSpectralNodes &model)
Assignment operator.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print node function information.
void reserve(const int &num)
Reserve space for nodes.
std::vector< double > m_old_energies
Old energies.
void set_flux_cache(void) const
Set flux computation cache.
std::vector< double > m_gamma
Power-law indices.
std::vector< double > m_prefactor
Power-law normalisations.
std::vector< double > m_old_values
Old values.
void set_eval_cache(void) const
Set evaluation cache.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between [emin, emax] (units: ph/cm2/s)
void update_eval_cache(void) const
Update evaluation cache.
double error(const int &index) const
Return intensity error of node.
void update_flux_cache(void) const
Update flux computation cache.
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns MC energy between [emin, emax].
std::vector< double > m_mc_max
Upper boundary for MC.
virtual void clear(void)
Clear spectral nodes model.
void remove(const int &index)
Remove node.
std::vector< GModelPar > m_energies
Node energies.
std::vector< double > m_lin_values
Values of nodes.
int nodes(void) const
Return number of nodes.
void append(const GEnergy &energy, const double &intensity)
Append node.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate function.
virtual ~GModelSpectralNodes(void)
Destructor.
void extend(const GModelSpectralNodes &nodes)
Append nodes from node function.
void update_pars(void)
Update parameter mapping.
void mc_update(const GEnergy &emin, const GEnergy &emax) const
Set MC pre-computation cache.
std::vector< double > m_mc_exp
Exponent for MC.
virtual std::string classname(void) const
Return class name.
void init_members(void)
Initialise class members.
std::vector< double > m_mc_min
Lower boundary for MC.
std::vector< double > m_eflux
Energy fluxes.
void free_members(void)
Delete class members.
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between [emin, emax] (units: erg/cm2/s)
virtual std::string type(void) const
Return model type.
virtual GModelSpectralNodes * clone(void) const
Clone spectral nodes model.
GNodeArray m_log_energies
log10(energy) of nodes
double intensity(const int &index) const
Return node intensity.
GModelSpectralNodes(void)
Void constructor.
std::vector< double > m_mc_cum
Cumulative distribution.
GEnergy energy(const int &index) const
Return node energy.
std::vector< double > m_log_values
log10(value) of nodes
void set_cache(void) const
Set pre-computation cache.
std::vector< double > m_flux
Photon fluxes.
GEnergy m_mc_emin
Minimum energy.
GEnergy m_mc_emax
Maximum energy.
void copy_members(const GModelSpectralNodes &model)
Copy class members.
std::vector< double > m_epivot
Power-law pivot energies.
void insert(const int &index, const GEnergy &energy, const double &intensity)
Insert node.
GNodeArray m_lin_energies
Energy of nodes.
Abstract spectral model base class.
Random number generator class.