|
From: Roland L. <rol...@go...> - 2006-11-20 09:47:15
|
Hi Peter, I had not seen muParser so far, will check it out. The MIT license seems to me compatible with QuantLib's. Thanks for this interesting hint! Roland On 11/19/06, Piter Dias <pit...@ma...> wrote: > > Guys, > > Roland=B4s idea is very interesting. I used myself a math expression pars= er > (Warp=B4s one) when I worked to Algorithmics in order to make a Balance > Sheet > simulator for some clients (pension funds). > > If you want the idea, could you please check this link > http://muparser.sourceforge.net/mup_license.html in order to see if the > license is in line with QuantLib? > > I know I can always use it myself while coding, but I think a standard wa= t > inside QuantLib would be better. > > Regards. > > ---- Mensagem Original ---- > From: "RolandLichters"<rol...@go...> > To: "quantlib-dev"<qua...@li...> > Sent: Dom, Novembro 19, 2006 5:23 pm > Subject: [Quantlib-dev]MarketModels,TODOs,scripting > > Hello Market Model team, > > I have read the TODOs in the Market Models section and saw the item on > scripting, specify new payoffs "without code recompilation". > > I am not sure whether this helps in this exercise - I came across a > free/open mathematical expression parser written by Yann Ollivier > (http://www.eleves.ens.fr/home/ollivier), wrapped and used it with > some minor extensions so that it understands max, min, step functions > in addition to the bulk that Yann had already coded. For example, I > evaluate formulas as follows: > > ... > > #define LENGTH(a) (sizeof(a)/sizeof(a[0])) > > string name[] =3D { "a", "b", "c" }; > double value[] =3D { 1, 2, 3 }; > > string formula =3D "sqrt (max (step(5a-10) + min(3b, 4c), 0)) * 15"; > > vector<string> variableNames; > vector<double> variableValues; > for (int i =3D 0; i < LENGTH(name); i++) { > variableNames.push_back(name[i]); > variableValues.push_back(value[i]); > } > > Formula form (formula, variableNames, variableValues); > > cout << "formula =3D " << formula << " =3D " << form.eval() << endl; > > ... and changing the variableValue vector after creating the formula > object allows revaluing the formula with the amended variable input, > calling form.eval() again. That might be useful, not only for the > Market Models. > > Yann's license is currently not compatible with the QuantLib license, > as far as I understand - he does not allow selling the code unless one > contacts him. Maybe he is willing to change the license if you are > interested in including his code or a modified version of it in the > library? > > Regards, > Roland > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > |