@@ -149,9 +149,7 @@ bool parseBool(const string& s) {
149149 }
150150}
151151
152- Calendar parseCalendar (const string& s) {
153- return CalendarParser::instance ().parseCalendar (s);
154- }
152+ Calendar parseCalendar (const string& s) { return CalendarParser::instance ().parseCalendar (s); }
155153
156154bool isOnePeriod (const string& s) {
157155 if (s.empty ())
@@ -278,7 +276,7 @@ DayCounter parseDayCounter(const string& s) {
278276 auto it = m.find (s);
279277 if (it != m.end ()) {
280278 return it->second ;
281-
279+
282280 } else {
283281 QL_FAIL (" DayCounter \" " << s << " \" not recognized" );
284282 }
@@ -371,10 +369,8 @@ Compounding parseCompounding(const string& s) {
371369}
372370
373371QuantLib::Bond::Price::Type parseBondPriceType (const string& s) {
374- static map<string, QuantLib::Bond::Price::Type> m = {
375- {" Clean" , QuantLib::Bond::Price::Type::Clean},
376- {" Dirty" , QuantLib::Bond::Price::Type::Dirty}
377- };
372+ static map<string, QuantLib::Bond::Price::Type> m = {{" Clean" , QuantLib::Bond::Price::Type::Clean},
373+ {" Dirty" , QuantLib::Bond::Price::Type::Dirty}};
378374
379375 auto it = m.find (s);
380376 if (it != m.end ()) {
@@ -608,7 +604,7 @@ Month parseMonth(const string& s) {
608604 }
609605}
610606
611- PaymentLag parsePaymentLag (const string& s) {
607+ PaymentLag parsePaymentLag (const string& s) {
612608 Period p;
613609 Natural n;
614610 if (tryParse<Period>(s, p, parsePeriod))
@@ -685,9 +681,10 @@ FdmSchemeDesc parseFdmSchemeDesc(const std::string& s) {
685681}
686682
687683AssetClass parseAssetClass (const std::string& s) {
688- static map<string, AssetClass> assetClasses = {
689- {" EQ" , AssetClass::EQ}, {" FX" , AssetClass::FX}, {" COM" , AssetClass::COM}, {" IR" , AssetClass::IR},
690- {" INF" , AssetClass::INF}, {" CR" , AssetClass::CR}, {" BOND" , AssetClass::BOND}, {" BOND_INDEX" , AssetClass::BOND_INDEX}};
684+ static map<string, AssetClass> assetClasses = {{" EQ" , AssetClass::EQ}, {" FX" , AssetClass::FX},
685+ {" COM" , AssetClass::COM}, {" IR" , AssetClass::IR},
686+ {" INF" , AssetClass::INF}, {" CR" , AssetClass::CR},
687+ {" BOND" , AssetClass::BOND}, {" BOND_INDEX" , AssetClass::BOND_INDEX}};
691688 auto it = assetClasses.find (s);
692689 if (it != assetClasses.end ()) {
693690 return it->second ;
@@ -847,7 +844,7 @@ pair<string, string> parseBoostAny(const boost::any& anyType, Size precision) {
847844 } else if (anyType.type () == typeid (double )) {
848845 resultType = " double" ;
849846 double r = boost::any_cast<double >(anyType);
850- if (r != Null<Real>())
847+ if (r != Null<Real>())
851848 oss << std::fixed << std::setprecision (precision) << r;
852849 } else if (anyType.type () == typeid (std::string)) {
853850 resultType = " string" ;
@@ -1045,7 +1042,7 @@ DoubleBarrier::Type parseDoubleBarrierType(const std::string& s) {
10451042 QL_FAIL (" DoubleBarrier type \" " << s << " \" not recognized" );
10461043 }
10471044}
1048-
1045+
10491046ostream& operator <<(ostream& os, InflationSwapConvention::PublicationRoll pr) {
10501047 using IPR = InflationSwapConvention::PublicationRoll;
10511048 if (pr == IPR::None) {
@@ -1289,7 +1286,7 @@ string fxDominance(const string& s1, const string& s2) {
12891286 // JPY at the end (of majors)
12901287 " JPY" ,
12911288 // JPYIDR and JPYKRW - who knew!
1292- " IDR" , " KRW" };
1289+ " IDR" , " KRW" };
12931290
12941291 auto p1 = std::find (dominance.begin (), dominance.end (), s1);
12951292 auto p2 = std::find (dominance.begin (), dominance.end (), s2);
@@ -1387,5 +1384,15 @@ QuantLib::Pillar::Choice parsePillarChoice(const std::string& s) {
13871384 }
13881385}
13891386
1387+ QuantExt::McMultiLegBaseEngine::RegressorModel parseRegressorModel (const std::string& s) {
1388+ if (s == " Simple" )
1389+ return McMultiLegBaseEngine::RegressorModel::Simple;
1390+ else if (s == " LaggedFX" )
1391+ return McMultiLegBaseEngine::RegressorModel::LaggedFX;
1392+ else {
1393+ QL_FAIL (" RegressorModel '" << s << " ' not recognized, expected Simple, LaggedFX" );
1394+ }
1395+ }
1396+
13901397} // namespace data
13911398} // namespace ore
0 commit comments