25#include <boost/lexical_cast.hpp>
35 QL_REQUIRE(node !=
nullptr,
"CreditSimulationParameters: Node TransitionMatrices not found.");
38 while (node !=
nullptr) {
41 Size n =
static_cast<Size
>(std::sqrt(
data.size()));
42 QL_REQUIRE(
data.size() == n * n,
"CreditSimulationParameters: Square matrix required, found " <<
data.size()
45 for (Size i = 0; i < n; ++i) {
46 for (Size j = 0; j < n; ++j) {
47 m[i][j] =
data[i * n + j];
55 QL_REQUIRE(node !=
nullptr,
"CreditSimulationparameters: Node Entities not found.");
57 while (node !=
nullptr) {
60 Array loadings(tmp.begin(), tmp.end());
71 QL_REQUIRE(node !=
nullptr,
"CreditSimulationParameters: Node Risk not found.");
86 QL_FAIL(
"CreditSimulationParameters::toXML() not implemented");
std::vector< Size > initialStates_
std::vector< string > nettingSetIds_
virtual void fromXML(XMLNode *node)
std::vector< string > entities_
virtual XMLNode * toXML(XMLDocument &doc) const
std::vector< string > transitionMatrices_
std::vector< Array > factorLoadings_
const std::map< string, Matrix > & transitionMatrix() const
std::map< string, Matrix > transitionMatrix_
\Equality Operators
static XMLNode * locateNode(XMLNode *n, const string &name="")
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static bool getChildValueAsBool(XMLNode *node, const string &name, bool mandatory=false, bool defaultValue=true)
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static int getChildValueAsInt(XMLNode *node, const string &name, bool mandatory=false, int defaultValue=0)
static XMLNode * getNextSibling(XMLNode *node, const string &name="")
static vector< Real > getChildrenValuesAsDoublesCompact(XMLNode *node, const string &name, bool mandatory=false)
Credit simulation parameter class.
std::vector< string > parseListOfValues(string s, const char escape, const char delim, const char quote)