SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
LegacyModelFittingConfig.cpp
Go to the documentation of this file.
1
17/*
18 * ModelFittingConfig.cpp
19 *
20 * Created on: May 17, 2017
21 * Author: mschefer
22 */
23
26
27using namespace Euclid::Configuration;
28namespace po = boost::program_options;
29
30namespace SourceXtractor {
31
32static const std::string MFIT_MAX_ITERATIONS {"model-fitting-iterations"};
33static const std::string MFIT_ENGINE {"model-fitting-engine"};
34
37
40
41 return {{"Model Fitting",
42 {
43 {MFIT_MAX_ITERATIONS.c_str(), po::value<int>()->default_value(1000),
44 "Maximum number of iterations allowed for model fitting"},
45 {MFIT_ENGINE.c_str(), po::value<std::string>()->default_value(default_engine),
46 "Least squares engine"}
47 }
48 }};
49}
50
52 m_max_iterations = args.at(MFIT_MAX_ITERATIONS).as<int>();
53 if (m_max_iterations <= 0) {
54 throw Elements::Exception() << "Invalid " << MFIT_MAX_ITERATIONS << " value: " << m_max_iterations;
55 }
57}
58
59} /* namespace SourceXtractor */
60
61
T at(T... args)
std::map< std::string, boost::program_options::variable_value > UserValues
void initialize(const UserValues &args) override
std::map< std::string, OptionDescriptionList > getProgramOptions() override
static const std::string MFIT_MAX_ITERATIONS
static const std::string MFIT_ENGINE