Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16127/qlo
Modified Files:
interpolation.cpp interpolation.hpp
Log Message:
1) SABR interpolation added.
2) specified loopParameters
Index: interpolation.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/interpolation.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** interpolation.hpp 8 Jun 2006 10:48:49 -0000 1.2
--- interpolation.hpp 8 Jun 2006 20:49:22 -0000 1.3
***************
*** 77,80 ****
--- 77,95 ----
};
+ class SABRInterpolation : public Interpolation {
+ public:
+ SABRInterpolation(const std::vector<double>& x,
+ const std::vector<double>& y,
+ bool allowExtrapolation,
+ double t,
+ double forward,
+ double beta,
+ double nu,
+ double alpha,
+ double rho);
+ private:
+ std::vector<double> x_, y_;
+ };
+
}
Index: interpolation.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/interpolation.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** interpolation.cpp 8 Jun 2006 10:48:49 -0000 1.2
--- interpolation.cpp 8 Jun 2006 20:49:22 -0000 1.3
***************
*** 25,28 ****
--- 25,29 ----
#include <ql/Math/forwardflatinterpolation.hpp>
#include <ql/Math/linearinterpolation.hpp>
+ #include <ql/Math/sabrinterpolation.hpp>
namespace QuantLibAddin {
***************
*** 83,87 ****
--- 84,105 ----
rightCondition, rightConditionValue,
monotonicityConstraint));
+ }
+
+
+ SABRInterpolation::SABRInterpolation(
+ const std::vector<double>& x,
+ const std::vector<double>& y,
+ bool allowExtrapolation,
+ double t,
+ double forward,
+ double beta,
+ double nu,
+ double alpha,
+ double rho) : x_(x), y_(y) {
+ interp_ = boost::shared_ptr<QuantLib::Interpolation>(
+ new QuantLib::SABRInterpolation(
+ x_.begin(), x_.end(), y_.begin(),
+ t, forward, beta, nu, alpha, rho));
}
|