Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
BootstrapConfig Class Reference

#include <ored/configuration/bootstrapconfig.hpp>

+ Inheritance diagram for BootstrapConfig:
+ Collaboration diagram for BootstrapConfig:

Public Member Functions

 BootstrapConfig (QuantLib::Real accuracy=1.0e-12, QuantLib::Real globalAccuracy=QuantLib::Null< QuantLib::Real >(), bool dontThrow=false, QuantLib::Size maxAttempts=5, QuantLib::Real maxFactor=2.0, QuantLib::Real minFactor=2.0, QuantLib::Size dontThrowSteps=10)
 Constructor. More...
 
XMLSerializable interface
void fromXML (ore::data::XMLNode *node) override
 
ore::data::XMLNodetoXML (ore::data::XMLDocument &doc) const override
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNodetoXML (XMLDocument &doc) const =0
 
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename) const
 
void fromXMLString (const std::string &xml)
 Parse from XML string. More...
 
std::string toXMLString () const
 Parse from XML string. More...
 

Inspectors

QuantLib::Real accuracy_
 
QuantLib::Real globalAccuracy_
 
bool dontThrow_
 
QuantLib::Size maxAttempts_
 
QuantLib::Real maxFactor_
 
QuantLib::Real minFactor_
 
QuantLib::Size dontThrowSteps_
 
QuantLib::Real accuracy () const
 
QuantLib::Real globalAccuracy () const
 
bool dontThrow () const
 
QuantLib::Size maxAttempts () const
 
QuantLib::Real maxFactor () const
 
QuantLib::Real minFactor () const
 
QuantLib::Size dontThrowSteps () const
 

Detailed Description

Serializable Bootstrap configuration

Definition at line 35 of file bootstrapconfig.hpp.

Constructor & Destructor Documentation

◆ BootstrapConfig()

BootstrapConfig ( QuantLib::Real  accuracy = 1.0e-12,
QuantLib::Real  globalAccuracy = QuantLib::Null<QuantLib::Real>(),
bool  dontThrow = false,
QuantLib::Size  maxAttempts = 5,
QuantLib::Real  maxFactor = 2.0,
QuantLib::Real  minFactor = 2.0,
QuantLib::Size  dontThrowSteps = 10 
)

Constructor.

Definition at line 27 of file bootstrapconfig.cpp.

QuantLib::Real maxFactor() const
QuantLib::Size dontThrowSteps() const
QuantLib::Real globalAccuracy() const
QuantLib::Real accuracy() const
QuantLib::Real minFactor() const
QuantLib::Size maxAttempts() const

Member Function Documentation

◆ fromXML()

void fromXML ( ore::data::XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 33 of file bootstrapconfig.cpp.

33 {
34
35 XMLUtils::checkNode(node, "BootstrapConfig");
36
37 accuracy_ = 1e-12;
38 if (XMLNode* n = XMLUtils::getChildNode(node, "Accuracy")) {
40 QL_REQUIRE(accuracy_ > 0, "Accuracy (" << accuracy_ << ") must be a positive number");
41 }
42
44 if (XMLNode* n = XMLUtils::getChildNode(node, "GlobalAccuracy")) {
46 QL_REQUIRE(globalAccuracy_ > 0, "GlobalAccuracy (" << globalAccuracy_ << ") must be a positive number");
47 }
48
49 dontThrow_ = false;
50 if (XMLNode* n = XMLUtils::getChildNode(node, "DontThrow")) {
52 }
53
54 maxAttempts_ = 5;
55 if (XMLNode* n = XMLUtils::getChildNode(node, "MaxAttempts")) {
57 QL_REQUIRE(maxAttempts > 0, "MaxAttempts (" << maxAttempts << ") must be a positive integer");
58 maxAttempts_ = static_cast<Size>(maxAttempts);
59 }
60
61 maxFactor_ = 2.0;
62 if (XMLNode* n = XMLUtils::getChildNode(node, "MaxFactor")) {
64 }
65
66 minFactor_ = 2.0;
67 if (XMLNode* n = XMLUtils::getChildNode(node, "MinFactor")) {
69 }
70
71 dontThrowSteps_ = 10;
72 if (XMLNode* n = XMLUtils::getChildNode(node, "DontThrowSteps")) {
74 QL_REQUIRE(dontThrowSteps > 0, "DontThrowSteps (" << dontThrowSteps << ") must be a positive integer");
75 dontThrowSteps_ = static_cast<Size>(dontThrowSteps);
76 }
77}
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
Definition: parsers.cpp:136
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXML()

XMLNode * toXML ( ore::data::XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 79 of file bootstrapconfig.cpp.

79 {
80
81 XMLNode* node = doc.allocNode("BootstrapConfig");
82 XMLUtils::addChild(doc, node, "Accuracy", accuracy_);
83 XMLUtils::addChild(doc, node, "GlobalAccuracy", globalAccuracy_);
84 XMLUtils::addChild(doc, node, "DontThrow", dontThrow_);
85 XMLUtils::addChild(doc, node, "MaxAttempts", static_cast<int>(maxAttempts_));
86 XMLUtils::addChild(doc, node, "MaxFactor", maxFactor_);
87 XMLUtils::addChild(doc, node, "MinFactor", minFactor_);
88 XMLUtils::addChild(doc, node, "DontThrowSteps", static_cast<int>(dontThrowSteps_));
89
90 return node;
91}
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accuracy()

QuantLib::Real accuracy ( ) const

Definition at line 50 of file bootstrapconfig.hpp.

50{ return accuracy_; }
+ Here is the caller graph for this function:

◆ globalAccuracy()

QuantLib::Real globalAccuracy ( ) const

Definition at line 51 of file bootstrapconfig.hpp.

51{ return globalAccuracy_; }
+ Here is the caller graph for this function:

◆ dontThrow()

bool dontThrow ( ) const

Definition at line 52 of file bootstrapconfig.hpp.

52{ return dontThrow_; }
+ Here is the caller graph for this function:

◆ maxAttempts()

QuantLib::Size maxAttempts ( ) const

Definition at line 53 of file bootstrapconfig.hpp.

53{ return maxAttempts_; }
+ Here is the caller graph for this function:

◆ maxFactor()

QuantLib::Real maxFactor ( ) const

Definition at line 54 of file bootstrapconfig.hpp.

54{ return maxFactor_; }
+ Here is the caller graph for this function:

◆ minFactor()

QuantLib::Real minFactor ( ) const

Definition at line 55 of file bootstrapconfig.hpp.

55{ return minFactor_; }
+ Here is the caller graph for this function:

◆ dontThrowSteps()

QuantLib::Size dontThrowSteps ( ) const

Definition at line 56 of file bootstrapconfig.hpp.

56{ return dontThrowSteps_; }
+ Here is the caller graph for this function:

Member Data Documentation

◆ accuracy_

QuantLib::Real accuracy_
private

Definition at line 60 of file bootstrapconfig.hpp.

◆ globalAccuracy_

QuantLib::Real globalAccuracy_
private

Definition at line 61 of file bootstrapconfig.hpp.

◆ dontThrow_

bool dontThrow_
private

Definition at line 62 of file bootstrapconfig.hpp.

◆ maxAttempts_

QuantLib::Size maxAttempts_
private

Definition at line 63 of file bootstrapconfig.hpp.

◆ maxFactor_

QuantLib::Real maxFactor_
private

Definition at line 64 of file bootstrapconfig.hpp.

◆ minFactor_

QuantLib::Real minFactor_
private

Definition at line 65 of file bootstrapconfig.hpp.

◆ dontThrowSteps_

QuantLib::Size dontThrowSteps_
private

Definition at line 66 of file bootstrapconfig.hpp.