31 : maxEvaluations_(Null<Size>()),
32 initialGuess_(Null<Real>()),
33 accuracy_(Null<Real>()),
34 minMax_(make_pair(Null<Real>(), Null<Real>())),
36 lowerBound_(Null<Real>()),
37 upperBound_(Null<Real>()),
43 const pair<Real, Real>& minMax,
46 : maxEvaluations_(maxEvaluations),
47 initialGuess_(initialGuess),
51 lowerBound_(lowerBound),
52 upperBound_(upperBound),
63 : maxEvaluations_(maxEvaluations),
64 initialGuess_(initialGuess),
66 minMax_(make_pair(Null<Real>(), Null<Real>())),
68 lowerBound_(lowerBound),
69 upperBound_(upperBound),
90 QL_FAIL(
"OneDimSolverConfig: expected a MinMax or Step node.");
116 if (
step_ != Null<Real>()) {
144 solverOptions.
minMax = minMax_;
145 solverOptions.
step = step_;
150 return solverOptions;
158 if (
step_ != Null<Real>()) {
159 QL_REQUIRE(
step_ > 0,
"Step (" <<
step_ <<
") should be positive when given.");
163 QL_REQUIRE(
min != Null<Real>() &&
max != Null<Real>(),
"When Step is not given" <<
164 " Min and Max should be provided.");
165 QL_REQUIRE(
min <
max,
"When given, Min (" <<
min <<
") should be less than Max (" <<
max <<
").");
170 ") should be less than UpperBound (" <<
upperBound_ <<
").");
QuantLib::Real initialGuess_
QuantLib::Real lowerBound_
OneDimSolverConfig()
Default constructor with everything QuantLib::Null.
void check() const
Basic checks.
void fromXML(ore::data::XMLNode *node) override
std::pair< QuantLib::Real, QuantLib::Real > minMax_
QuantLib::Real upperBound_
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
QuantLib::Size maxEvaluations_
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void checkNode(XMLNode *n, const string &expectedName)
static Real getChildValueAsDouble(XMLNode *node, const string &name, bool mandatory=false, double defaultValue=0.0)
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static string getNodeValue(XMLNode *node)
Get a node's value.
static int getChildValueAsInt(XMLNode *node, const string &name, bool mandatory=false, int defaultValue=0)
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
Real parseReal(const string &s)
Convert text to Real.
RandomVariable max(RandomVariable x, const RandomVariable &y)
RandomVariable min(RandomVariable x, const RandomVariable &y)
Serializable Credit Default Swap.
Class for holding 1-D solver configuration.
Map text representations to QuantLib/QuantExt types.
std::pair< QuantLib::Real, QuantLib::Real > minMax
QuantLib::Real initialGuess
QuantLib::Real upperBound
QuantLib::Real lowerBound
QuantLib::Size maxEvaluations