GammaLib
2.0.0
|
Optimizer parameter class. More...
#include <GOptimizerPar.hpp>
Public Member Functions | |
GOptimizerPar (void) | |
Void constructor. More... | |
GOptimizerPar (const std::string &name, const double &value) | |
Parameter constructor. More... | |
GOptimizerPar (const std::string &name, const double &factor, const double &scale) | |
Parameter constructor. More... | |
GOptimizerPar (const GOptimizerPar &par) | |
Copy constructor. More... | |
virtual | ~GOptimizerPar (void) |
Destructor. More... | |
GOptimizerPar & | operator= (const GOptimizerPar &par) |
Assignment operator. More... | |
double | value (void) const |
Return parameter value. More... | |
double | error (void) const |
Return parameter error. More... | |
double | gradient (void) const |
Return parameter gradient. More... | |
double | min (void) const |
Return parameter minimum boundary. More... | |
double | max (void) const |
Return parameter maximum boundary. More... | |
void | value (const double &value) |
Set parameter value. More... | |
void | error (const double &error) |
Set parameter error. More... | |
void | gradient (const double &gradient) |
Set parameter gradient. More... | |
void | min (const double &min) |
Set minimum parameter boundary. More... | |
void | max (const double &max) |
Set maximum parameter boundary. More... | |
void | range (const double &min, const double &max) |
Set minimum and maximum parameter boundaries. More... | |
const double & | factor_value (void) const |
Return parameter factor value. More... | |
const double & | factor_error (void) const |
Return parameter factor error. More... | |
const double & | factor_gradient (void) const |
Return parameter factor gradient. More... | |
const double & | factor_min (void) const |
Return parameter minimum factor boundary. More... | |
const double & | factor_max (void) const |
Return parameter maximum factor boundary. More... | |
const double & | scale (void) const |
Return parameter scale. More... | |
void | factor_value (const double &value) |
Set parameter value factor. More... | |
void | factor_error (const double &error) |
Set parameter factor error. More... | |
void | factor_gradient (const double &gradient) const |
Set parameter factor gradient. More... | |
void | factor_min (const double &min) |
Set minimum parameter boundary factor. More... | |
void | factor_max (const double &max) |
Set maximum parameter boundary factor. More... | |
void | factor_range (const double &min, const double &max) |
Set minimum and maximum parameter boundary factors. More... | |
void | scale (const double &scale) |
Set scale factor. More... | |
bool | has_min (void) const |
Signal if parameter has minimum boundary. More... | |
bool | has_max (void) const |
Signal if parameter has maximum boundary. More... | |
bool | has_factor_min (void) const |
Signal if parameter has minimum factor boundary. More... | |
bool | has_factor_max (void) const |
Signal if parameter has maximum factor boundary. More... | |
bool | has_range (void) const |
Signal if parameter has minimum and maximum boundaries. More... | |
void | remove_min (void) |
Removes minimum boundary. More... | |
void | remove_max (void) |
Removes maximum boundary. More... | |
void | remove_factor_min (void) |
Removes minimum factor boundary. More... | |
void | remove_factor_max (void) |
Removes maximum factor boundary. More... | |
void | remove_range (void) |
Removes minimum and maximum boundary. More... | |
bool | is_free (void) const |
Signal if parameter is free. More... | |
bool | is_fixed (void) const |
Signal if parameter is fixed. More... | |
bool | has_grad (void) const |
Signal if parameter gradient is computed analytically. More... | |
void | free (void) |
Free a parameter. More... | |
void | fix (void) |
Fix a parameter. More... | |
void | has_grad (const bool &grad) |
Set gradient property. More... | |
void | clear (void) |
Clear parameter. More... | |
GOptimizerPar * | clone (void) const |
Clone parameter. More... | |
std::string | classname (void) const |
Return class name. More... | |
const std::string & | name (void) const |
Return parameter name. More... | |
const std::string & | unit (void) const |
Return parameter unit. More... | |
void | name (const std::string &name) |
Set parameter name. More... | |
void | unit (const std::string &unit) |
Set parameter unit. More... | |
void | autoscale (void) |
Autoscale parameter. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print parameter information. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Protected Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GOptimizerPar &par) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
std::string | m_name |
Parameter name. More... | |
std::string | m_unit |
Parameter unit. More... | |
double | m_factor_value |
Parameter factor value. More... | |
double | m_factor_error |
Uncertainty in parameter factor value. More... | |
double | m_factor_min |
Parameter minimum factor value. More... | |
double | m_factor_max |
Parameter maximum factor value. More... | |
double | m_factor_gradient |
Function factor gradient. More... | |
double | m_scale |
Parameter scaling (true = factor * scale) More... | |
bool | m_free |
Parameter is free. More... | |
bool | m_has_factor_min |
Parameter has minimum factor boundary. More... | |
bool | m_has_factor_max |
Parameter has maximum factor boundary. More... | |
bool | m_has_grad |
Parameter has analytic gradient. More... | |
Optimizer parameter class.
This class implements a function parameter for the optimizer. A function parameter is a numerical value that is used to describe a function.
A function parameter has the following attributes:
value
gives the numerical value of the parametererror
gives the statistical uncertainty in the parameter valuegradient
gives the gradient of a function with respect to the parametermin
gives the minimum value that the parameter can takemax
gives the maximum value that the parameter can takeThe parameter attributes are set and retrieved using the value(), error(), gradient(), min() and max() methods, respectively. Furthermore, the range() method is used to simultaneously set the minimum and maximum value of a parameter.
The minimum and maximum values are optional, and existence of these attributes is tested using the has_min() and has_max() methods, respectively. The minimum value, maximum value are removed using the remove_min() and remove_max() methods. Simultaneous removal of minimum and maximum values is done using the remove_range() method.
Each parameter has furthermore the following properties:
free
specifies whether the parameter should be fittedgrad
specifies whether the parameter gradient is computed analytically (true) or numerically (false)The parameter property free
is set using the free() and fix() methods and it is retrieved using the is_free() and is_fixed() methods. The attribute grad
is set and retrieved using the has has_grad() methods.
Each function parameter is factorized into a factor
and a scale
term. The GOptimizerPar class stores the factors and the scale factor has data members, and the true values are computed using the following relations:
value = m_factor_value * m_scale error = m_factor_error * m_scale gradient = m_factor_gradient * m_scale min = m_factor_min * m_scale for m_scale > 0 m_factor_max * m_scale otherwise max = m_factor_max * m_scale for m_scale > 0 m_factor_min * m_scale otherwise
The factor
and scale
terms can be set and retrieved using the factor_value(), factor_error(), factor_gradient(), factor_min(), factor_max() and scale() methods.
Definition at line 91 of file GOptimizerPar.hpp.
GOptimizerPar::GOptimizerPar | ( | void | ) |
Void constructor.
Definition at line 61 of file GOptimizerPar.cpp.
References init_members().
Referenced by clone().
GOptimizerPar::GOptimizerPar | ( | const std::string & | name, |
const double & | value | ||
) |
Parameter constructor.
[in] | name | Parameter name. |
[in] | value | Parameter value. |
Constructs a parameter from a parameter name
and a parameter value
.
The parameter is auto-scaled, which for a value
that differs from zero sets the scale factor to value
and the factor_value
to unity. For a value
of zero, the scale factor will be set to unity and the factor_value
will be set to value
.
Definition at line 84 of file GOptimizerPar.cpp.
References init_members(), m_factor_value, m_name, m_scale, name(), and value().
GOptimizerPar::GOptimizerPar | ( | const std::string & | name, |
const double & | factor, | ||
const double & | scale | ||
) |
Parameter constructor.
[in] | name | Parameter name. |
[in] | factor | Parameter value factor. |
[in] | scale | Parameter scaling (non-zero value). |
GException::invalid_argument | Sacle factor of 0 specified. |
Constructs a parameter from a parameter name
, value factor
and scale
factor. The scale
factor needs to be a non-zero value. If the scale
factor is zero, an exception is thrown.
Definition at line 121 of file GOptimizerPar.cpp.
References G_CONSTRUCT, init_members(), m_factor_value, m_name, m_scale, name(), and scale().
GOptimizerPar::GOptimizerPar | ( | const GOptimizerPar & | par | ) |
Copy constructor.
[in] | par | Function parameter. |
Definition at line 150 of file GOptimizerPar.cpp.
References copy_members(), and init_members().
|
virtual |
void GOptimizerPar::autoscale | ( | void | ) |
Autoscale parameter.
Sets the value factor to unity and the scale factor to the real value of the parameter. The method will also adjust the error factor and gradient factor, as well as the minimum and maximum factors if they exist.
The method does nothing if the actual value factor is zero.
Definition at line 566 of file GOptimizerPar.cpp.
References scale(), and value().
Referenced by GModelSky::eflux_error(), and GModelSky::flux_error().
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 192 of file GOptimizerPar.hpp.
|
virtual |
Clear parameter.
Resets parameter to a clean initial state.
Implements GBase.
Definition at line 220 of file GOptimizerPar.cpp.
References free_members(), and init_members().
Referenced by GModelSpectralTablePar::init_members(), GModelSpatialRadialProfileGauss::init_members(), GCOMModelDRM::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GCTAModelSpatialGradient::init_members(), GModelTemporalConst::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GModelSpatialDiffuseConst::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GModelTemporalLightCurve::init_members(), GModelSpatialRadialRing::init_members(), GCTAModelRadialProfile::init_members(), GModelSpectralConst::init_members(), GModelSpatialEllipticalGeneralGauss::init_members(), GCTAModelSkyCube::init_members(), GModelSpatialRadial::init_members(), GModelSpatialDiffuseMap::init_members(), GCTAModelSpatialLookup::init_members(), GModelSpatialElliptical::init_members(), GModelSpatialPointSource::init_members(), GModelSpectralTable::init_members(), GModelSpectralGauss::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralBins::init_members(), GModelSpectralFunc::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpatialDiffuseCube::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), and GSPIModelDataSpace::setup_pars().
|
virtual |
Clone parameter.
Implements GBase.
Definition at line 238 of file GOptimizerPar.cpp.
References GOptimizerPar().
Referenced by GOptimizerPars::append(), GOptimizerPars::insert(), and GOptimizerPars::set().
|
protected |
Copy class members.
[in] | par | Model parameter. |
Definition at line 684 of file GOptimizerPar.cpp.
References m_factor_error, m_factor_gradient, m_factor_max, m_factor_min, m_factor_value, m_free, m_has_factor_max, m_has_factor_min, m_has_grad, m_name, m_scale, and m_unit.
Referenced by GOptimizerPar(), and operator=().
|
inline |
Return parameter error.
Returns the parameter error. The parameter error is computed by multiplying the error factor by the scale factor. By definition, the error is a positive number, hence the method returns the absolute value of the internally computed error.
Definition at line 224 of file GOptimizerPar.hpp.
References abs(), m_factor_error, and m_scale.
Referenced by factor_error(), and print().
void GOptimizerPar::error | ( | const double & | error | ) |
Set parameter error.
[in] | error | Parameter error. |
Sets the parameter error. The method stores the error factor which is obtained by dividing the error
by the scale factor.
Definition at line 275 of file GOptimizerPar.cpp.
References factor_error(), and m_scale.
|
inline |
Return parameter factor error.
Returns the parameter factor error.
Definition at line 298 of file GOptimizerPar.hpp.
References m_factor_error.
Referenced by GModelSky::eflux_error(), error(), and GModelSky::flux_error().
|
inline |
Set parameter factor error.
[in] | error | Parameter factor error. |
Sets the parameter factor error.
Definition at line 385 of file GOptimizerPar.hpp.
References error(), and m_factor_error.
|
inline |
Return parameter factor gradient.
Returns the parameter factor gradient.
Definition at line 312 of file GOptimizerPar.hpp.
References m_factor_gradient.
Referenced by GResponse::convolve(), GModelSpatialDiffuseConst::eval(), GCOMModelDRM::eval(), GCTAModelSpatialGradient::eval(), GModelSpatialDiffuseMap::eval(), GModelSpatialRadialGauss::eval(), GModelTemporalConst::eval(), GModelSpectralBins::eval(), GModelSpectralConst::eval(), GCTAModelRadialGauss::eval(), GModelSpectralTable::eval(), GSPIModelDataSpace::eval(), GCTAModelSkyCube::eval(), GModelSpectralFunc::eval(), GCTAModelSpatialLookup::eval(), GModelSpectralGauss::eval(), GModelSpatialDiffuseCube::eval(), GModelTemporalLightCurve::eval(), GModelSpectralPlaw::eval(), GModelData::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralLogParabola::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralPlawPhotonFlux::eval(), GModelSpectralPlawEnergyFlux::eval(), GModelTemporalPhaseCurve::eval(), GModelSpectralSmoothBrokenPlaw::eval(), cta_psf_radial_kerns_phi::eval(), GObservations::likelihood::eval(), GResponse::eval_prob(), gradient(), GObservation::model(), GCTAOnOffObservation::N_bgd(), and GCTAOnOffObservation::N_gamma().
|
inline |
Set parameter factor gradient.
[in] | gradient | Parameter factor gradient. |
Sets the parameter factor gradient.
Definition at line 400 of file GOptimizerPar.hpp.
References gradient(), and m_factor_gradient.
|
inline |
Return parameter maximum factor boundary.
Returns the maximum parameter factor boundary.
Definition at line 340 of file GOptimizerPar.hpp.
References m_factor_max.
Referenced by GModelSky::eflux_error(), factor_range(), factor_value(), GModelSky::flux_error(), GObservation::model_grad(), GObservation::npred_grad(), GModelPar::read(), and GModelPar::write().
void GOptimizerPar::factor_max | ( | const double & | max | ) |
Set maximum parameter boundary factor.
[in] | max | Maximum parameter boundary factor. |
GException::invalid_argument | Maximum parameter boundary factor smaller than value factor. |
Sets the maximum boundary factor of the parameter. The method makes sure that the maximum is not smaller than the actual value factor. Otherwise, an exception is thrown.
Definition at line 460 of file GOptimizerPar.cpp.
References G_FACTOR_VALUE, m_factor_max, m_factor_value, m_has_factor_max, max(), and gammalib::str().
|
inline |
Return parameter minimum factor boundary.
Returns the minimum parameter factor boundary.
Definition at line 326 of file GOptimizerPar.hpp.
References m_factor_min.
Referenced by GModelSky::eflux_error(), factor_range(), factor_value(), GModelSky::flux_error(), GObservation::model_grad(), GObservation::npred_grad(), GModelPar::read(), and GModelPar::write().
void GOptimizerPar::factor_min | ( | const double & | min | ) |
Set minimum parameter boundary factor.
[in] | min | Minimum parameter boundary factor. |
GException::invalid_argument | Minimum parameter boundary factor larger than value factor. |
Sets the minimum boundary factor of the parameter. The method makes sure that the minimum is not larger than the actual value factor. Otherwise, an exception is thrown.
Definition at line 429 of file GOptimizerPar.cpp.
References G_FACTOR_VALUE, m_factor_min, m_factor_value, m_has_factor_min, min(), and gammalib::str().
void GOptimizerPar::factor_range | ( | const double & | min, |
const double & | max | ||
) |
Set minimum and maximum parameter boundary factors.
[in] | min | Minimum parameter boundary factor. |
[in] | max | Maximum parameter boundary factor. |
Sets the minimum and maximum parameter boundary factors. The method calls the factor_min() and factor_max() methods which perform validity checking of the arguments.
Definition at line 489 of file GOptimizerPar.cpp.
References factor_max(), and factor_min().
Referenced by GModelSpectralTable::load_par().
|
inline |
Return parameter factor value.
Returns the parameter factor value.
Definition at line 284 of file GOptimizerPar.hpp.
References m_factor_value.
Referenced by GModelSky::eflux_error(), GModelSpectralPlaw::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralLogParabola::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralPlawEnergyFlux::eval(), GModelSpectralPlawPhotonFlux::eval(), GModelSpectralSmoothBrokenPlaw::eval(), GObservation::model_func::eval(), GModelSky::flux_error(), GObservations::likelihood::hessian(), GObservation::model_grad(), GObservation::npred_grad(), and value().
void GOptimizerPar::factor_value | ( | const double & | value | ) |
Set parameter value factor.
[in] | value | Value factor. |
GException::invalid_argument | Parameter value outside [min,max] boundaries. |
Sets the value factor of the parameter. The method makes sure that none of the boundaries is violated. Otherwise, exceptions are thrown.
Definition at line 389 of file GOptimizerPar.cpp.
References factor_max(), factor_min(), G_FACTOR_VALUE, has_factor_max(), has_factor_min(), m_factor_value, gammalib::str(), and value().
|
inline |
Fix a parameter.
Fixes a parameter for optimization. The parameter shall NOT be altered in a parameter optimization process.
Definition at line 628 of file GOptimizerPar.hpp.
References m_free.
Referenced by GModelSpectralBins::append(), GModelSpectralNodes::append(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GModelTemporalConst::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GModelSpatialDiffuseConst::init_members(), GModelTemporalLightCurve::init_members(), GCTAModelRadialProfile::init_members(), GCTAModelSkyCube::init_members(), GModelSpatialRadial::init_members(), GModelSpatialDiffuseMap::init_members(), GCTAModelSpatialLookup::init_members(), GModelSpatialElliptical::init_members(), GModelSpatialPointSource::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralBins::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpatialDiffuseCube::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), GModelSpectralBins::insert(), GModelSpectralNodes::insert(), GModelSpectralTable::load_par(), GModelSpatialComposite::read(), GModelPar::read(), and GModel::scale().
|
inline |
Free a parameter.
Frees a parameter for optimization. The parameter shall be fitted in a parameter optimization process.
Definition at line 614 of file GOptimizerPar.hpp.
References m_free.
Referenced by GModelSpectralBins::append(), GModelSpectralNodes::append(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GModelSpatialRadialProfileGauss::init_members(), GCOMModelDRM::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GCTAModelSpatialGradient::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GCTAModelRadialProfile::init_members(), GModelSpatialRadialRing::init_members(), GModelSpectralConst::init_members(), GModelSpatialEllipticalGeneralGauss::init_members(), GModelSpatialElliptical::init_members(), GModelSpectralTable::init_members(), GModelSpectralGauss::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralFunc::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), GModelSpectralBins::insert(), GModelSpectralNodes::insert(), GModelSpectralTable::load_par(), GModelSpatialComposite::read(), GModelPar::read(), and GSPIModelDataSpace::setup_pars().
|
protected |
Delete class members.
Definition at line 708 of file GOptimizerPar.cpp.
Referenced by clear(), operator=(), and ~GOptimizerPar().
|
inline |
Return parameter gradient.
Returns the parameter gradient. The parameter gradient is computed by dividing the gradient factor by the scale factor. The method returns zero in case that the scale factor is zero.
Definition at line 240 of file GOptimizerPar.hpp.
References m_factor_gradient, and m_scale.
Referenced by GModelSpatialComposite::append(), GCTAModelSpatialGaussSpectrum::eval(), GCTAModelSpatialMultiplicative::eval(), GModelSpectralMultiplicative::eval(), GModelSpectralExponential::eval(), factor_gradient(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GModelSpatialRadialProfileGauss::init_members(), GCOMModelDRM::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GCTAModelSpatialGradient::init_members(), GModelTemporalConst::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GModelSpatialDiffuseConst::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GModelTemporalLightCurve::init_members(), GCTAModelRadialProfile::init_members(), GModelSpatialRadialRing::init_members(), GModelSpectralConst::init_members(), GModelSpatialEllipticalGeneralGauss::init_members(), GModelSpatialRadial::init_members(), GCTAModelSkyCube::init_members(), GCTAModelSpatialLookup::init_members(), GModelSpatialDiffuseMap::init_members(), GModelSpatialElliptical::init_members(), GModelSpatialPointSource::init_members(), GModelSpectralGauss::init_members(), GModelSpectralTable::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralBins::init_members(), GModelSpectralFunc::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpatialDiffuseCube::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), and GSPIModelDataSpace::setup_pars().
void GOptimizerPar::gradient | ( | const double & | gradient | ) |
Set parameter gradient.
[in] | gradient | Parameter gradient. |
Sets the parameter gradient. The method stores the gradient factor which is obtained by multiplying gradient
by the scale factor.
Definition at line 294 of file GOptimizerPar.cpp.
References factor_gradient(), and m_scale.
|
inline |
Signal if parameter has maximum factor boundary.
Signals if the parameter has a maximum factor boundary.
Definition at line 457 of file GOptimizerPar.hpp.
References m_has_factor_max.
Referenced by factor_value(), and GModelPar::write().
|
inline |
Signal if parameter has minimum factor boundary.
Signals if the parameter has a minimum factor boundary.
Definition at line 443 of file GOptimizerPar.hpp.
References m_has_factor_min.
Referenced by factor_value(), and GModelPar::write().
|
inline |
Signal if parameter gradient is computed analytically.
Signals if the parameter gradient is computed analytically. This property is used in the function optimization process to identify parameters for which gradients need to be computed numerically.
Definition at line 601 of file GOptimizerPar.hpp.
References m_has_grad.
Referenced by GModelSpatialComposite::append(), GModelSpectralBins::append(), GModelSpectralNodes::append(), GResponse::convolve(), GResponse::edisp_kerns::edisp_kerns(), GModelData::eval(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GModelSpatialRadialProfileGauss::init_members(), GCOMModelDRM::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GCTAModelSpatialGradient::init_members(), GModelTemporalConst::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GModelSpatialDiffuseConst::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GCTAModelRadialProfile::init_members(), GModelTemporalLightCurve::init_members(), GModelSpatialRadialRing::init_members(), GModelSpectralConst::init_members(), GModelSpatialEllipticalGeneralGauss::init_members(), GModelSpatialRadial::init_members(), GCTAModelSkyCube::init_members(), GCTAModelSpatialLookup::init_members(), GModelSpatialDiffuseMap::init_members(), GModelSpatialElliptical::init_members(), GModelSpatialPointSource::init_members(), GModelSpectralTable::init_members(), GModelSpectralGauss::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralBins::init_members(), GModelSpectralFunc::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpatialDiffuseCube::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), GModelSpectralBins::insert(), GModelSpectralNodes::insert(), GCTAResponseCube::irf_radial(), GModelSpectralTable::load_par(), GCOMModelDRBPhibarNodes::read(), GCOMModelDRBPhibarBins::read(), GModelSpectralNodes::read(), GModel::read_scales(), GSPIModelDataSpace::setup_pars(), GModelSky::signal_analytical_gradients(), and GResponse::size_edisp_vector().
|
inline |
Set gradient property.
[in] | grad | Gradient flag |
Sets the gradient property of the parameter. If grad
is set to true, the parameter gradient will be computed analytically by the method that evaluates the function. If false, the gradients needs to be computed numerically.
Definition at line 646 of file GOptimizerPar.hpp.
References m_has_grad.
|
inline |
Signal if parameter has maximum boundary.
Signals if the parameter has a maximum boundary.
Definition at line 429 of file GOptimizerPar.hpp.
References m_has_factor_max, m_has_factor_min, and m_scale.
Referenced by GModelSpectralTable::create_par_table(), GModelSky::eflux_error(), GModelSky::flux_error(), GObservation::model_grad(), GObservation::npred_grad(), print(), and GModelPar::read().
|
inline |
Signal if parameter has minimum boundary.
Signals if the parameter has a minimum boundary.
Definition at line 415 of file GOptimizerPar.hpp.
References m_has_factor_max, m_has_factor_min, and m_scale.
Referenced by GModelSpectralTable::create_par_table(), GModelSky::eflux_error(), GModelSky::flux_error(), GObservation::model_grad(), GObservation::npred_grad(), print(), and GModelPar::read().
|
inline |
Signal if parameter has minimum and maximum boundaries.
Signals if the parameter has a minimum and a maximum boundary.
Definition at line 472 of file GOptimizerPar.hpp.
References m_has_factor_max, and m_has_factor_min.
|
protected |
Initialise class members.
Definition at line 658 of file GOptimizerPar.cpp.
References m_factor_error, m_factor_gradient, m_factor_max, m_factor_min, m_factor_value, m_free, m_has_factor_max, m_has_factor_min, m_has_grad, m_name, m_scale, and m_unit.
Referenced by clear(), GOptimizerPar(), and operator=().
|
inline |
Signal if parameter is fixed.
Signals if the parameter is fixed, i.e. that it shall NOT be fitted in a parameter optimization process.
Definition at line 584 of file GOptimizerPar.hpp.
References m_free.
Referenced by GModelSpectralTable::create_par_table(), and GObservations::likelihood::hessian().
|
inline |
Signal if parameter is free.
Signals if the parameter is free, i.e. that it shall be fitted in a parameter optimization process.
Definition at line 569 of file GOptimizerPar.hpp.
References m_free.
Referenced by GResponse::convolve(), GResponse::edisp_kerns::edisp_kerns(), GModelSky::eflux_error(), GModelSpatialDiffuseConst::eval(), GCOMModelDRM::eval(), GModelSpatialRadialGauss::eval(), GModelSpatialDiffuseMap::eval(), GModelTemporalConst::eval(), GModelSpectralBins::eval(), GModelSpectralConst::eval(), GModelSpectralTable::eval(), GCTAModelSkyCube::eval(), GSPIModelDataSpace::eval(), GModelSpectralFunc::eval(), GCTAModelSpatialLookup::eval(), GModelTemporalLightCurve::eval(), GModelSpectralGauss::eval(), GModelSpatialDiffuseCube::eval(), GModelSpectralPlaw::eval(), GModelData::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralLogParabola::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralPlawPhotonFlux::eval(), GModelSpectralPlawEnergyFlux::eval(), GModelTemporalPhaseCurve::eval(), GModelSpectralSmoothBrokenPlaw::eval(), GResponse::eval_prob(), GResponse::eval_probs(), GModelSky::flux_error(), GObservation::has_gradient(), GCTAResponseCube::irf_radial(), GObservation::model(), GObservation::model_grad(), GCTAOnOffObservation::N_bgd(), GCTAOnOffObservation::N_gamma(), GObservation::npred_grad(), GModelSky::signal_analytical_gradients(), GResponse::size_edisp_vector(), and GModelPar::write().
|
inline |
Return parameter maximum boundary.
Returns the parameter maximum boundary.
Definition at line 270 of file GOptimizerPar.hpp.
References m_factor_max, m_factor_min, and m_scale.
Referenced by GModelSpectralTable::create_par_table(), factor_max(), GModelSpatialRadialProfileDMEinasto::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GModelSpectralExpInvPlaw::init_members(), print(), range(), GModelSpatialComposite::read(), GModelSpectralLogParabola::read(), GModelPar::read(), and GModelSpectralLogParabola::write().
void GOptimizerPar::max | ( | const double & | max | ) |
Set maximum parameter boundary.
[in] | max | Maximum parameter boundary. |
GException::invalid_argument | Maximum parameter boundary is smaller than the parameter value |
Sets the maximum parameter boundary.
Definition at line 351 of file GOptimizerPar.cpp.
References G_MAX, m_factor_max, m_factor_min, m_has_factor_max, m_has_factor_min, m_scale, gammalib::str(), and value().
|
inline |
Return parameter minimum boundary.
Returns the parameter minimum boundary.
Definition at line 256 of file GOptimizerPar.hpp.
References m_factor_max, m_factor_min, and m_scale.
Referenced by GModelSpectralTable::create_par_table(), factor_min(), GModelSpatialRadialProfileGauss::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GCTAModelRadialProfile::init_members(), GModelSpatialRadialRing::init_members(), GModelSpatialEllipticalGeneralGauss::init_members(), GModelSpatialElliptical::init_members(), GModelSpectralGauss::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), print(), range(), GModelSpatialComposite::read(), GModelSpectralLogParabola::read(), GModelPar::read(), and GModelSpectralLogParabola::write().
void GOptimizerPar::min | ( | const double & | min | ) |
Set minimum parameter boundary.
[in] | min | Minimum parameter boundary. |
GException::invalid_argument | Minimum parameter boundary is larger than the parameter value |
Sets the minimum parameter boundary.
Definition at line 314 of file GOptimizerPar.cpp.
References G_MIN, m_factor_max, m_factor_min, m_has_factor_max, m_has_factor_min, m_scale, gammalib::str(), and value().
|
inline |
Return parameter name.
Returns the parameter name.
Definition at line 661 of file GOptimizerPar.hpp.
References m_name.
Referenced by GModelSpectralTablePars::append(), GCTAModelSpatialMultiplicative::append(), GModelSpatialComposite::append(), GModelSpectralComposite::append(), GModelSpectralMultiplicative::append(), GModelSpectralBins::append(), GModelSpectralNodes::append(), GObservation::computed_gradient(), GResponse::convolve(), GModelSpectralTable::create_par_table(), GResponse::edisp_kerns::edisp_kerns(), GResponse::eval_prob(), GResponse::eval_probs(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GModelSpatialEllipticalDisk::GModelSpatialEllipticalDisk(), GModelSpatialEllipticalGauss::GModelSpatialEllipticalGauss(), GModelSpatialEllipticalGeneralGauss::GModelSpatialEllipticalGeneralGauss(), GModelSpatialPointSource::GModelSpatialPointSource(), GModelSpatialRadialDisk::GModelSpatialRadialDisk(), GModelSpatialRadialGauss::GModelSpatialRadialGauss(), GModelSpatialRadialGeneralGauss::GModelSpatialRadialGeneralGauss(), GModelSpatialRadialRing::GModelSpatialRadialRing(), GModelSpatialRadialShell::GModelSpatialRadialShell(), GModelSpectralBrokenPlaw::GModelSpectralBrokenPlaw(), GModelSpectralConst::GModelSpectralConst(), GModelSpectralExpInvPlaw::GModelSpectralExpInvPlaw(), GModelSpectralExpPlaw::GModelSpectralExpPlaw(), GModelSpectralLogParabola::GModelSpectralLogParabola(), GModelSpectralPlaw::GModelSpectralPlaw(), GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(), GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(), GModelSpectralSmoothBrokenPlaw::GModelSpectralSmoothBrokenPlaw(), GModelSpectralSuperExpPlaw::GModelSpectralSuperExpPlaw(), GOptimizerPar(), GObservation::has_gradient(), GModelSpatialRadialProfileGauss::init_members(), GCOMModelDRM::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GCTAModelSpatialGradient::init_members(), GModelTemporalConst::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GModelSpatialDiffuseConst::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GCTAModelRadialProfile::init_members(), GModelTemporalLightCurve::init_members(), GModelSpatialRadialRing::init_members(), GModelSpectralConst::init_members(), GModelSpatialEllipticalGeneralGauss::init_members(), GCTAModelSkyCube::init_members(), GModelSpatialRadial::init_members(), GModelSpatialDiffuseMap::init_members(), GCTAModelSpatialLookup::init_members(), GModelSpatialElliptical::init_members(), GModelSpatialPointSource::init_members(), GModelSpectralTable::init_members(), GModelSpectralGauss::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralBins::init_members(), GModelSpectralFunc::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpatialDiffuseCube::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), GModelSpectralTablePars::insert(), GModelSpectralBins::insert(), GModelSpectralNodes::insert(), GModelSpatialRadial::is_celestial(), GModelSpatialPointSource::is_celestial(), GModelSpatialElliptical::is_celestial(), GObservation::model(), GCTAOnOffObservation::N_gamma(), name(), GModelSpectralTablePar::print(), print(), GModelSpatialRadialProfileGauss::read(), GCOMModelDRM::read(), GCTAModelSpatialGradient::read(), GModelSpatialDiffuseConst::read(), GCOMModelDRBPhibarBins::read(), GCOMModelDRBPhibarNodes::read(), GModelTemporalConst::read(), GCTAModelRadialGauss::read(), GCTAModelRadialPolynom::read(), GModelSpatialRadialGauss::read(), GCTAModelRadialProfile::read(), GModelSpatialRadialDisk::read(), GModelSpatialRadialGeneralGauss::read(), GModelSpatialRadialRing::read(), GModelSpectralBins::read(), GCTAModelSpatialLookup::read(), GModelTemporalLightCurve::read(), GModelSpatialEllipticalDisk::read(), GModelSpectralTable::read(), GModelSpectralConst::read(), GModelSpatialEllipticalGauss::read(), GModelSpatialEllipticalGeneralGauss::read(), GModelSpatialElliptical::read(), GModelSpectralFunc::read(), GModelSpectralGauss::read(), GModelSpectralPlaw::read(), GModelSpatialRadialShell::read(), GModelSpectralExpPlaw::read(), GModelSpectralLogParabola::read(), GModelSpectralBrokenPlaw::read(), GModelSpectralSuperExpPlaw::read(), GModelSpectralExpInvPlaw::read(), GModelTemporalPhaseCurve::read(), GModelSpectralPlawEnergyFlux::read(), GModelSpectralPlawPhotonFlux::read(), GModelSpectralNodes::read(), GModelSpectralSmoothBrokenPlaw::read(), GModel::read_scales(), GCTAModelSkyCube::read_xml_spatial(), GModel::scale(), GModelSpectralTablePars::set(), GSPIModelDataSpace::setup_pars(), GModelSky::signal_analytical_gradients(), GResponse::size_edisp_vector(), GModelSpatialRadialProfileGauss::write(), GCOMModelDRM::write(), GModelSpatialComposite::write(), GCTAModelSpatialGradient::write(), GModelSpatialDiffuseConst::write(), GCOMModelDRBPhibarNodes::write(), GCOMModelDRBPhibarBins::write(), GCTAModelSpatialMultiplicative::write(), GModelTemporalConst::write(), GModelSpectralComposite::write(), GCTAModelRadialGauss::write(), GModelSpectralMultiplicative::write(), GModelSpatialDiffuseMap::write(), GModelSpatialRadialGauss::write(), GCTAModelRadialProfile::write(), GModelSpatialRadialDisk::write(), GModelSpatialRadialGeneralGauss::write(), GModelSpatialRadialRing::write(), GModelTemporalLightCurve::write(), GModelSpectralBins::write(), GCTAModelSpatialLookup::write(), GModelSpatialEllipticalDisk::write(), GModelSpectralConst::write(), GModelSpectralTable::write(), GModelSpatialEllipticalGauss::write(), GModelSpatialEllipticalGeneralGauss::write(), GModelSpatialPointSource::write(), GModelSpatialElliptical::write(), GModelSpatialRadial::write(), GModelSpatialDiffuseCube::write(), GModelSpectralFunc::write(), GModelSpectralGauss::write(), GModelSpectralPlaw::write(), GModelSpatialRadialShell::write(), GModelSpectralExpPlaw::write(), GModelSpectralLogParabola::write(), GModelSpectralBrokenPlaw::write(), GModelSpectralSuperExpPlaw::write(), GModelSpectralExpInvPlaw::write(), GModelTemporalPhaseCurve::write(), GModelSpectralPlawEnergyFlux::write(), GModelSpectralPlawPhotonFlux::write(), GModelSpectralNodes::write(), GModelSpectralSmoothBrokenPlaw::write(), and GCTAModelSkyCube::write_xml_spatial().
|
inline |
Set parameter name.
[in] | name | Parameter name. |
Sets the parameter name.
Definition at line 689 of file GOptimizerPar.hpp.
GOptimizerPar & GOptimizerPar::operator= | ( | const GOptimizerPar & | par | ) |
Assignment operator.
[in] | par | Function parameter. |
Definition at line 188 of file GOptimizerPar.cpp.
References copy_members(), free_members(), and init_members().
Referenced by GModelPar::operator=().
Print parameter information.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 590 of file GOptimizerPar.cpp.
References error(), has_max(), has_min(), m_free, m_has_grad, m_scale, m_unit, max(), min(), name(), gammalib::parformat(), SILENT, gammalib::str(), and value().
|
inline |
Set minimum and maximum parameter boundaries.
[in] | min | Parameter minimum. |
[in] | max | Parameter maximum. |
Sets the minimum and maximum parameter boundaries.
Definition at line 355 of file GOptimizerPar.hpp.
Referenced by GModelSpectralTable::GModelSpectralTable(), GCOMModelDRM::init_members(), GModelSpatialDiffuseConst::init_members(), GModelTemporalLightCurve::init_members(), GModelSpectralConst::init_members(), GCTAModelSkyCube::init_members(), GCTAModelSpatialLookup::init_members(), GModelSpatialDiffuseMap::init_members(), GModelSpectralTable::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralBins::init_members(), GModelSpectralFunc::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpatialDiffuseCube::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), and GModelSpatialComposite::read().
|
inline |
Removes maximum factor boundary.
Removes maximum factor boundary from the parameter.
Definition at line 538 of file GOptimizerPar.hpp.
References m_factor_max, and m_has_factor_max.
Referenced by GModelPar::read().
|
inline |
Removes minimum factor boundary.
Removes minimum factor boundary from the parameter.
Definition at line 524 of file GOptimizerPar.hpp.
References m_factor_min, and m_has_factor_min.
Referenced by GModelPar::read().
|
inline |
Removes maximum boundary.
Removes maximum boundary from the parameter.
Definition at line 504 of file GOptimizerPar.hpp.
References m_factor_max, m_factor_min, m_has_factor_max, m_has_factor_min, and m_scale.
Referenced by GModelSpatialComposite::read().
|
inline |
Removes minimum boundary.
Removes minimum boundary from the parameter.
Definition at line 484 of file GOptimizerPar.hpp.
References m_factor_max, m_factor_min, m_has_factor_max, m_has_factor_min, and m_scale.
Referenced by GModelSpatialComposite::read().
|
inline |
Removes minimum and maximum boundary.
Removes minimum and maximum boundary from the parameter.
Definition at line 552 of file GOptimizerPar.hpp.
References m_has_factor_max, and m_has_factor_min.
Referenced by GModelSpectralTable::GModelSpectralTable().
|
inline |
Return parameter scale.
Returns the parameter scale factor.
Definition at line 371 of file GOptimizerPar.hpp.
References m_scale.
Referenced by GModelSpatialComposite::append(), autoscale(), GModelSpatialDiffuseConst::eval(), GCOMModelDRM::eval(), GCTAModelSpatialGradient::eval(), GModelTemporalConst::eval(), GModelSpatialDiffuseMap::eval(), GModelSpatialRadialGauss::eval(), GModelSpectralBins::eval(), GModelSpectralTable::eval(), GModelSpectralConst::eval(), GCTAModelRadialGauss::eval(), GCTAModelSkyCube::eval(), GSPIModelDataSpace::eval(), GCTAModelSpatialLookup::eval(), GModelSpectralFunc::eval(), GModelTemporalLightCurve::eval(), GModelSpatialDiffuseCube::eval(), GModelSpectralGauss::eval(), GModelSpectralPlaw::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralLogParabola::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralPlawEnergyFlux::eval(), GModelSpectralPlawPhotonFlux::eval(), GModelTemporalPhaseCurve::eval(), GModelSpectralSmoothBrokenPlaw::eval(), GResponse::eval_prob(), GResponse::eval_probs(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GModelSpectralTable::GModelSpectralTable(), GOptimizerPar(), GModelSpatialRadialProfileGauss::init_members(), GCOMModelDRM::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GCTAModelSpatialGradient::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GModelSpatialDiffuseConst::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GModelSpatialRadialRing::init_members(), GModelTemporalLightCurve::init_members(), GCTAModelRadialProfile::init_members(), GModelSpectralConst::init_members(), GModelSpatialEllipticalGeneralGauss::init_members(), GCTAModelSkyCube::init_members(), GModelSpatialRadial::init_members(), GModelSpatialDiffuseMap::init_members(), GCTAModelSpatialLookup::init_members(), GModelSpatialElliptical::init_members(), GModelSpatialPointSource::init_members(), GModelSpectralGauss::init_members(), GModelSpectralTable::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralBins::init_members(), GModelSpectralFunc::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpatialDiffuseCube::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), GModelSpectralTable::load_par(), GCTAOnOffObservation::N_gamma(), scale(), GSPIModelDataSpace::setup_pars(), and GModelSpatialRadialGauss::update().
void GOptimizerPar::scale | ( | const double & | scale | ) |
Set scale factor.
[in] | scale | Scale factor. |
GException::invalid_argument | Sacle factor of 0 specified. |
Sets the scale factor of the parameter. All parameter attributes are rescaled accordingly.
An exception is thrown if a scale factor of 0 is specified.
Definition at line 513 of file GOptimizerPar.cpp.
References G_SCALE, m_factor_error, m_factor_gradient, m_factor_max, m_factor_min, m_factor_value, m_has_factor_max, m_has_factor_min, m_scale, and scale().
|
inline |
Return parameter unit.
Returns the parameter unit.
Definition at line 675 of file GOptimizerPar.hpp.
References m_unit.
Referenced by GModelSpectralBins::append(), GModelSpectralNodes::append(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GModelSpatialRadialProfileGauss::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GCTAModelSpatialGradient::init_members(), GModelTemporalConst::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GModelSpatialRadialRing::init_members(), GModelTemporalLightCurve::init_members(), GCTAModelRadialProfile::init_members(), GModelSpatialRadial::init_members(), GModelSpatialElliptical::init_members(), GModelSpatialPointSource::init_members(), GModelSpectralGauss::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), GModelSpectralBins::insert(), GModelSpectralNodes::insert(), GCOMModelDRBPhibarBins::read(), GCOMModelDRBPhibarNodes::read(), GCTAModelRadialPolynom::read(), GModelSpectralNodes::read(), and unit().
|
inline |
Set parameter unit.
[in] | unit | Parameter unit. |
Sets the parameter unit.
Definition at line 704 of file GOptimizerPar.hpp.
|
inline |
Return parameter value.
Returns the parameter value. The parameter value is computed by multiplying the value factor by the scale factor.
Definition at line 207 of file GOptimizerPar.hpp.
References m_factor_value, and m_scale.
Referenced by GModelSpatialRadialProfileDMEinasto::alpha(), GModelSpatialRadialProfileDMZhao::alpha(), GModelSpectralBins::append(), GModelSpectralNodes::append(), autoscale(), GModelSpatialRadialProfileDMZhao::beta(), GModelSpectralSmoothBrokenPlaw::beta(), GModelSpectralBrokenPlaw::breakenergy(), GModelSpectralSmoothBrokenPlaw::breakenergy(), GCTAModelRadialProfile::core(), GModelSpectralTable::create_par_table(), GModelSpectralLogParabola::curvature(), GModelSpectralExpPlaw::cutoff(), GModelSpectralSuperExpPlaw::cutoff(), GModelSpectralExpInvPlaw::cutoff(), GCTAModelSpatialGradient::detx_gradient(), GCTAModelSpatialGradient::dety_gradient(), GModelSpatialElliptical::dir(), GModelSpatialRadial::dir(), GModelSpatialPointSource::dir(), GModelSpectralBins::eflux(), GModelSpectralConst::eflux(), GModelSpectralGauss::eflux(), GModelSpectralPlaw::eflux(), GModelSpectralExpPlaw::eflux(), GModelSpectralBrokenPlaw::eflux(), GModelSpectralExpInvPlaw::eflux(), GModelSpectralSuperExpPlaw::eflux(), GModelSpectralPlawPhotonFlux::eflux(), GModelSpectralPlawEnergyFlux::eflux(), GModelSpectralPlawPhotonFlux::emax(), GModelSpectralPlawEnergyFlux::emax(), GModelSpectralPlawPhotonFlux::emin(), GModelSpectralPlawEnergyFlux::emin(), GModelSpatialDiffuseConst::eval(), GCOMModelDRM::eval(), GCTAModelSpatialGradient::eval(), GModelSpatialDiffuseMap::eval(), GModelTemporalConst::eval(), GModelSpectralBins::eval(), GModelSpatialEllipticalDisk::eval(), GModelSpectralConst::eval(), GModelSpectralTable::eval(), GCTAModelSkyCube::eval(), GSPIModelDataSpace::eval(), GModelSpectralFunc::eval(), GCTAModelSpatialLookup::eval(), GModelSpectralGauss::eval(), GModelSpatialDiffuseCube::eval(), GModelTemporalLightCurve::eval(), GModelSpectralPlaw::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralLogParabola::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralPlawEnergyFlux::eval(), GModelSpectralPlawPhotonFlux::eval(), GModelTemporalPhaseCurve::eval(), GModelSpectralSmoothBrokenPlaw::eval(), GModelTemporalPhaseCurve::f0(), GModelTemporalPhaseCurve::f1(), GModelTemporalPhaseCurve::f2(), factor_value(), GModelSpectralBins::flux(), GModelSpectralConst::flux(), GModelSpatialDiffuseConst::flux(), GModelSpectralGauss::flux(), GModelSpectralPlaw::flux(), GModelSpatialDiffuseMap::flux(), GModelSpectralExpPlaw::flux(), GModelSpectralBrokenPlaw::flux(), GModelSpatialDiffuseCube::flux(), GModelSpectralExpInvPlaw::flux(), GModelSpectralSuperExpPlaw::flux(), GModelSpectralPlawEnergyFlux::flux(), GModelSpectralPlawPhotonFlux::flux(), GModelSpatialRadialProfileDMZhao::gamma(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GModelSpatialDiffuseConst::GModelSpatialDiffuseConst(), GModelSpatialDiffuseCube::GModelSpatialDiffuseCube(), GModelSpatialDiffuseMap::GModelSpatialDiffuseMap(), GModelSpatialPointSource::GModelSpatialPointSource(), GModelSpectralBrokenPlaw::GModelSpectralBrokenPlaw(), GModelSpectralConst::GModelSpectralConst(), GModelSpectralExpInvPlaw::GModelSpectralExpInvPlaw(), GModelSpectralExpPlaw::GModelSpectralExpPlaw(), GModelSpectralFunc::GModelSpectralFunc(), GModelSpectralGauss::GModelSpectralGauss(), GModelSpectralLogParabola::GModelSpectralLogParabola(), GModelSpectralPlaw::GModelSpectralPlaw(), GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(), GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(), GModelSpectralSmoothBrokenPlaw::GModelSpectralSmoothBrokenPlaw(), GModelSpectralSuperExpPlaw::GModelSpectralSuperExpPlaw(), GModelSpectralTable::GModelSpectralTable(), GModelTemporalConst::GModelTemporalConst(), GModelTemporalLightCurve::GModelTemporalLightCurve(), GOptimizerPar(), GModelSpatialRadialProfileDMEinasto::halo_distance(), GModelSpatialRadialProfileDMBurkert::halo_distance(), GModelSpatialRadialProfileDMZhao::halo_distance(), GModelSpectralBins::index(), GModelSpectralPlaw::index(), GModelSpectralExpPlaw::index(), GModelSpectralLogParabola::index(), GModelSpectralExpInvPlaw::index(), GModelSpectralPlawPhotonFlux::index(), GModelSpectralPlawEnergyFlux::index(), GModelSpectralBrokenPlaw::index1(), GModelSpectralSuperExpPlaw::index1(), GModelSpectralSmoothBrokenPlaw::index1(), GModelSpectralBrokenPlaw::index2(), GModelSpectralSuperExpPlaw::index2(), GModelSpectralSmoothBrokenPlaw::index2(), GModelSpatialRadialProfileGauss::init_members(), GCOMModelDRM::init_members(), GModelSpatialRadialProfileDMBurkert::init_members(), GModelSpatialRadialProfileDMEinasto::init_members(), GCTAModelSpatialGradient::init_members(), GModelTemporalConst::init_members(), GModelSpatialRadialProfileDMZhao::init_members(), GModelSpatialDiffuseConst::init_members(), GCTAModelRadialGauss::init_members(), GModelSpatialRadialGauss::init_members(), GModelSpatialRadialDisk::init_members(), GModelSpatialRadialGeneralGauss::init_members(), GModelSpatialRadialRing::init_members(), GCTAModelRadialProfile::init_members(), GModelTemporalLightCurve::init_members(), GModelSpectralConst::init_members(), GModelSpatialEllipticalGeneralGauss::init_members(), GCTAModelSkyCube::init_members(), GModelSpatialDiffuseMap::init_members(), GCTAModelSpatialLookup::init_members(), GModelSpatialElliptical::init_members(), GModelSpectralTable::init_members(), GModelSpectralGauss::init_members(), GModelSpatialRadialShell::init_members(), GModelSpectralPlaw::init_members(), GModelSpectralBins::init_members(), GModelSpectralFunc::init_members(), GModelSpectralExpPlaw::init_members(), GModelSpectralLogParabola::init_members(), GModelSpectralBrokenPlaw::init_members(), GModelSpatialDiffuseCube::init_members(), GModelSpectralExpInvPlaw::init_members(), GModelSpectralSuperExpPlaw::init_members(), GModelSpectralPlawPhotonFlux::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelTemporalPhaseCurve::init_members(), GModelSpectralSmoothBrokenPlaw::init_members(), GModelSpectralBins::insert(), GModelSpectralNodes::insert(), GModelSpectralExpInvPlaw::inverse_cutoff(), GModelSpatialRadialProfileDMBurkert::mass_density(), GModelSpatialRadialProfileDMEinasto::mass_density(), GModelSpatialRadialProfileDMZhao::mass_density(), max(), GModelSpectralGauss::mc(), GModelSpectralExpPlaw::mc(), GModelSpectralLogParabola::mc(), GModelSpectralExpInvPlaw::mc(), GModelSpectralSuperExpPlaw::mc(), GCTAModelSpatialGradient::mc_max_value(), GModelTemporalLightCurve::mc_update(), GModelSpectralBins::mc_update(), GModelSpectralGauss::mean(), min(), GModelTemporalPhaseCurve::mjd(), GCTAOnOffObservation::N_gamma(), GModelTemporalConst::norm(), GModelTemporalLightCurve::norm(), GModelSpectralTable::norm(), GModelSpectralGauss::norm(), GCTAModelSpatialLookup::norm(), GModelSpectralFunc::norm(), GModelTemporalPhaseCurve::norm(), GCTAModelSkyCube::npred(), GModelTemporalPhaseCurve::phase(), GModelSpectralPlaw::pivot(), GModelSpectralExpPlaw::pivot(), GModelSpectralLogParabola::pivot(), GModelSpectralExpInvPlaw::pivot(), GModelSpectralSuperExpPlaw::pivot(), GModelSpectralSmoothBrokenPlaw::pivot(), GModelSpatialElliptical::posangle(), GModelSpectralPlaw::prefactor(), GModelSpectralExpPlaw::prefactor(), GModelSpectralLogParabola::prefactor(), GModelSpectralBrokenPlaw::prefactor(), GModelSpectralExpInvPlaw::prefactor(), GModelSpectralSuperExpPlaw::prefactor(), GModelSpectralSmoothBrokenPlaw::prefactor(), print(), GModelSpatialRadialProfileGauss::profile_value(), GModelSpatialRadialProfileDMBurkert::profile_value(), GModelSpatialRadialProfileDMEinasto::profile_value(), GModelSpatialRadialProfileDMZhao::profile_value(), GModelSpatialRadialDisk::radius(), GModelSpatialRadialGeneralGauss::radius(), GModelSpatialRadialRing::radius(), GModelSpatialRadialShell::radius(), GModelSpatialComposite::read(), GModelSpectralBins::read(), GModelSpectralLogParabola::read(), GModelPar::read(), GModelSpectralNodes::read(), GModelSpatialRadialGeneralGauss::ridx(), GModelSpatialEllipticalGeneralGauss::ridx(), GModel::scale(), GModelSpatialRadialProfileDMEinasto::scale_density(), GModelSpatialRadialProfileDMBurkert::scale_density(), GModelSpatialRadialProfileDMZhao::scale_density(), GModelSpatialRadialProfileDMZhao::scale_radius(), GModelSpatialRadialProfileDMEinasto::scale_radius(), GModelSpatialRadialProfileDMBurkert::scale_radius(), GModelSpatialElliptical::semimajor(), GModelSpatialElliptical::semiminor(), GModelSpatialRadialGauss::set_region(), GModelSpatialRadialDisk::set_region(), GModelSpatialRadialGeneralGauss::set_region(), GModelSpatialRadialShell::set_region(), GSPIModelDataSpace::setup_pars(), GModelSpatialRadialProfileGauss::sigma(), GCTAModelRadialGauss::sigma(), GModelSpatialRadialGauss::sigma(), GModelSpectralGauss::sigma(), GCTAModelRadialProfile::tail(), GModelSpatialRadialProfileGauss::theta_max(), GModelSpatialRadialProfileDMZhao::theta_max(), GModelSpatialRadialProfileDMEinasto::theta_max(), GModelSpatialRadialProfileDMBurkert::theta_max(), GModelSpatialRadialProfileDMEinasto::theta_min(), GModelSpatialRadialProfileDMBurkert::theta_min(), GModelSpatialRadialProfileDMZhao::theta_min(), GModelSpectralTable::update(), GModelSpectralPlaw::update_eval_cache(), GModelSpectralExpPlaw::update_eval_cache(), GModelSpectralLogParabola::update_eval_cache(), GModelSpectralBrokenPlaw::update_eval_cache(), GModelSpectralSuperExpPlaw::update_eval_cache(), GModelSpectralExpInvPlaw::update_eval_cache(), GModelSpectralSmoothBrokenPlaw::update_eval_cache(), GModelSpectralLogParabola::update_mc_cache(), GModelSpectralBrokenPlaw::update_mc_cache(), GModelSpatialDiffuseConst::value(), GModelSpatialDiffuseMap::value(), GModelSpectralConst::value(), GModelSpatialDiffuseCube::value(), GModelTemporalPhaseCurve::value(), GCTAModelRadialProfile::width(), GModelSpatialRadialRing::width(), GModelSpatialRadialShell::width(), and GModelSpectralLogParabola::write().
void GOptimizerPar::value | ( | const double & | value | ) |
Set parameter value.
[in] | value | Parameter value. |
Sets the parameter value. The method stores the value factor which is obtained by dividing the value
by the scale factor.
The method calls factor_value() for assigning the value factor, and this method will verify that the value lies within the specified boundaries.
Definition at line 256 of file GOptimizerPar.cpp.
References factor_value(), and m_scale.
|
protected |
Uncertainty in parameter factor value.
Definition at line 174 of file GOptimizerPar.hpp.
Referenced by copy_members(), error(), factor_error(), init_members(), GModelPar::read(), scale(), and GModelPar::write().
|
mutableprotected |
Function factor gradient.
Definition at line 177 of file GOptimizerPar.hpp.
Referenced by copy_members(), factor_gradient(), gradient(), init_members(), and scale().
|
protected |
Parameter maximum factor value.
Definition at line 176 of file GOptimizerPar.hpp.
Referenced by copy_members(), factor_max(), init_members(), max(), min(), remove_factor_max(), remove_max(), remove_min(), and scale().
|
protected |
Parameter minimum factor value.
Definition at line 175 of file GOptimizerPar.hpp.
Referenced by copy_members(), factor_min(), init_members(), max(), min(), remove_factor_min(), remove_max(), remove_min(), and scale().
|
protected |
Parameter factor value.
Definition at line 173 of file GOptimizerPar.hpp.
Referenced by copy_members(), factor_max(), factor_min(), factor_value(), GOptimizerPar(), init_members(), GModelPar::read(), scale(), value(), and GModelPar::write().
|
protected |
Parameter is free.
Definition at line 179 of file GOptimizerPar.hpp.
Referenced by copy_members(), fix(), free(), init_members(), is_fixed(), is_free(), and print().
|
protected |
Parameter has maximum factor boundary.
Definition at line 181 of file GOptimizerPar.hpp.
Referenced by copy_members(), factor_max(), has_factor_max(), has_max(), has_min(), has_range(), init_members(), max(), min(), remove_factor_max(), remove_max(), remove_min(), remove_range(), and scale().
|
protected |
Parameter has minimum factor boundary.
Definition at line 180 of file GOptimizerPar.hpp.
Referenced by copy_members(), factor_min(), has_factor_min(), has_max(), has_min(), has_range(), init_members(), max(), min(), remove_factor_min(), remove_max(), remove_min(), remove_range(), and scale().
|
protected |
Parameter has analytic gradient.
Definition at line 182 of file GOptimizerPar.hpp.
Referenced by copy_members(), has_grad(), init_members(), and print().
|
protected |
Parameter name.
Definition at line 171 of file GOptimizerPar.hpp.
Referenced by copy_members(), GOptimizerPar(), init_members(), name(), GModelPar::read(), and GModelPar::write().
|
protected |
Parameter scaling (true = factor * scale)
Definition at line 178 of file GOptimizerPar.hpp.
Referenced by copy_members(), error(), GOptimizerPar(), gradient(), has_max(), has_min(), init_members(), max(), min(), print(), GModelPar::read(), remove_max(), remove_min(), scale(), value(), and GModelPar::write().
|
protected |
Parameter unit.
Definition at line 172 of file GOptimizerPar.hpp.
Referenced by copy_members(), init_members(), print(), and unit().