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