本文整理汇总了C++中GModelPar::value方法的典型用法代码示例。如果您正苦于以下问题:C++ GModelPar::value方法的具体用法?C++ GModelPar::value怎么用?C++ GModelPar::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GModelPar
的用法示例。
在下文中一共展示了GModelPar::value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/***********************************************************************//**
* @brief Return maximum energy
*
* @return Maximum energy.
*
* Returns the maximum energy.
***************************************************************************/
inline
GEnergy GModelSpectralPlaw2::emax(void) const
{
GEnergy energy;
energy.MeV(m_emax.value());
return energy;
}
示例2: breakenergy
/***********************************************************************//**
* @brief Return breakenergy energy
*
* @return breakenergy energy.
*
* Returns the breakenergy energy.
***************************************************************************/
inline
GEnergy GModelSpectralBrokenPlaw::breakenergy(void) const
{
GEnergy energy;
energy.MeV(m_breakenergy.value());
return energy;
}
示例3: pivot
/***********************************************************************//**
* @brief Return pivot energy
*
* @return Pivot energy.
*
* Returns the pivot energy.
***************************************************************************/
inline
GEnergy GModelSpectralPlaw::pivot(void) const
{
GEnergy energy;
energy.MeV(m_pivot.value());
return energy;
}
示例4: cutoff
/***********************************************************************//**
* @brief Return exponential cut-off energy
*
* @return Exponential cut-off energy.
*
* Returns the exponential cut-off energy.
***************************************************************************/
inline
GEnergy GModelSpectralSuperExpPlaw::cutoff(void) const
{
GEnergy energy;
energy.MeV(m_ecut.value());
return energy;
}
示例5: test_one_binned_optimizer
/***********************************************************************//**
* @brief Test binned optimizer
*
* @param[in] datadir Directory of test data.
* @param[in] irf Instrument response function.
* @param[in] fit_results Expected fit result.
*
* Verifies the ability optimize binned Fermi/LAT data.
***************************************************************************/
void TestGLATOptimize::test_one_binned_optimizer(const std::string& datadir,
const std::string& irf,
const double* fit_results)
{
// Set filenames
std::string lat_srcmap = datadir+"/srcmap.fits";
std::string lat_expmap = datadir+"/binned_expmap.fits";
std::string lat_ltcube = datadir+"/ltcube.fits";
std::string lat_model_xml = datadir+"/source_model.xml";
// Setup GObservations for optimizing
GObservations obs;
GLATObservation run;
test_try("Setup for optimization");
try {
run.load_binned(lat_srcmap, lat_expmap, lat_ltcube);
run.response(irf, lat_caldb);
obs.append(run);
test_try_success();
}
catch (std::exception &e) {
test_try_failure(e);
}
// Load models from XML file
obs.models(lat_model_xml);
// Setup LM optimizer
test_try("Perform LM optimization");
try {
GOptimizerLM opt;
opt.max_iter(1000);
obs.optimize(opt);
obs.errors(opt);
test_try_success();
for (int i = 0, j = 0; i < obs.models().size(); ++i) {
const GModel* model = obs.models()[i];
for (int k = 0; k < model->size(); ++k) {
GModelPar par = (*model)[k];
std::string msg = "Verify optimization result for " + par.print();
test_value(par.value(), fit_results[j++], 5.0e-5, msg);
test_value(par.error(), fit_results[j++], 5.0e-5, msg);
}
}
}
catch (std::exception &e) {
test_try_failure(e);
}
// Exit test
return;
}
示例6: scale
/***********************************************************************//**
* @brief Returns model scale factor for a given instrument
*
* @param[in] instrument Instrument.
*
* Returns the model scale factor for a given @p instrument. The search is
* case sensitive.
*
* If the @p instrument is not found, the method returns a scale factor of
* unity.
***************************************************************************/
GModelPar GModel::scale(const std::string& instrument) const
{
// Initialise unit scale factor
GModelPar scale;
scale.value(1.0);
scale.name(instrument);
scale.fix();
// Search for instrument and recover scale factor if the instrument
// has been found.
for (int i = 0; i < m_scales.size(); ++i) {
if (m_scales[i].name() == instrument) {
scale = m_scales[i];
break;
}
}
// Return scale factor
return scale;
}
示例7:
/***********************************************************************//**
* @brief Set power law index2
*
* @param[in] index2 Power law index2.
*
* Sets the power law index2.
***************************************************************************/
inline
void GModelSpectralBrokenPlaw::index2(const double& index2)
{
m_index2.value(index2);
return;
}
示例8: index
/***********************************************************************//**
* @brief Return power law index
*
* @return Power law index.
*
* Returns the power law index.
***************************************************************************/
inline
double GModelSpectralPlaw::index(void) const
{
return (m_index.value());
}
示例9: prefactor
/***********************************************************************//**
* @brief Set pre factor
*
* @param[in] prefactor Pre factor (ph/cm2/s/MeV).
*
* Sets the pre factor.
***************************************************************************/
inline
void GModelSpectralBrokenPlaw::prefactor(const double& prefactor)
{
m_norm.value(prefactor);
return;
}
示例10: return
/***********************************************************************//**
* @brief Return power law index2
*
* @return Power law index2.
*
* Returns the power law index2.
***************************************************************************/
inline
double GModelSpectralBrokenPlaw::index2(void) const
{
return (m_index2.value());
}
示例11: semimajor
/***********************************************************************//**
* @brief Return semi-major axis of ellipse
*
* @return Semi-major axis of ellipse (degrees).
*
* Returns the semi-major axis of the ellipse in degrees.
***************************************************************************/
inline
double GModelSpatialEllipticalDisk::semimajor(void) const
{
return (m_semimajor.value());
}
示例12: norm
/***********************************************************************//**
* @brief Return normalization factor
*
* @return Normalization factor.
*
* Returns the normalization factor.
***************************************************************************/
inline
double GModelSpectralFunc::norm(void) const
{
return (m_norm.value());
}
示例13: ra
/***********************************************************************//**
* @brief Return Right Ascencion of model centre
*
* @return Right Ascencion of model centre (degrees).
*
* Returns the Right Ascension of the model centre in degrees.
***************************************************************************/
inline
double GModelSpatialRadial::ra(void) const
{
return (m_ra.value());
}
示例14: dec
/***********************************************************************//**
* @brief Return Declination of model centre
*
* @return Declination of model centre (degrees).
*
* Returns the Declination of the model centre in degrees.
***************************************************************************/
inline
double GModelSpatialRadial::dec(void) const
{
return (m_dec.value());
}
示例15: value
/***********************************************************************//**
* @brief Set model value
*
* @param[in] value Model value.
*
* Set the value of the spatial map model.
***************************************************************************/
inline
void GModelSpatialDiffuseMap::value(const double& value)
{
m_value.value(value);
return;
}