[QuantLibAddin-cvs] QuantLibAddin/qlo mathf.hpp,1.1,1.2
Brought to you by:
ericehlers,
nando
|
From: Ferdinando A. <na...@us...> - 2006-08-10 10:24:21
|
Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4939/qlo Modified Files: mathf.hpp Log Message: bug fix Index: mathf.hpp =================================================================== RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/mathf.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mathf.hpp 23 Jun 2006 17:20:55 -0000 1.1 --- mathf.hpp 10 Aug 2006 10:24:15 -0000 1.2 *************** *** 20,24 **** #include <oh/objhandler.hpp> ! #endif --- 20,53 ---- #include <oh/objhandler.hpp> + #include <ql/Math/normaldistribution.hpp> ! namespace QuantLibAddin { ! ! inline double normDist(double x, ! double mean, ! double stdDev, ! bool cumulative) { ! if (cumulative) { ! return QuantLib::CumulativeNormalDistribution(mean, stdDev)(x); ! } else { ! return QuantLib::NormalDistribution(mean, stdDev)(x); ! } ! } + inline double normSDist(double x) { + return QuantLib::CumulativeNormalDistribution(0.0, 1.0)(x); + } + + inline double normInv(double prob, + double mean, + double stdDev) { + return QuantLib::InverseCumulativeNormal(mean, stdDev)(prob); + } + + inline double normSInv(double prob) { + return QuantLib::InverseCumulativeNormal(0.0, 1.0)(prob); + } + + } + + #endif |