Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28291/qlo
Modified Files:
interpolation.cpp interpolation.hpp
Log Message:
exported:
1) SABR full interface
2) Extrapolator interface
Index: interpolation.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/interpolation.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** interpolation.hpp 13 Jun 2006 11:26:23 -0000 1.5
--- interpolation.hpp 13 Jun 2006 18:56:56 -0000 1.6
***************
*** 20,36 ****
#include <oh/objhandler.hpp>
#include <ql/Math/cubicspline.hpp>
#include <ql/Math/matrix.hpp>
namespace QuantLibAddin {
! class Interpolation : public ObjHandler::LibraryObject<QuantLib::Interpolation> {
};
class BackwardFlatInterpolation : public Interpolation {
public:
BackwardFlatInterpolation(const std::vector<double>& x,
! const std::vector<double>& y,
! bool allowExtrapolation);
private:
std::vector<double> x_, y_;
--- 20,40 ----
#include <oh/objhandler.hpp>
+ #include <ql/Math/linearinterpolation.hpp>
#include <ql/Math/cubicspline.hpp>
+ #include <ql/Math/sabrinterpolation.hpp>
#include <ql/Math/matrix.hpp>
namespace QuantLibAddin {
! class Extrapolator :
! public ObjHandler::LibraryObject<QuantLib::Extrapolator> {
};
+ class Interpolation : public Extrapolator {};
+
class BackwardFlatInterpolation : public Interpolation {
public:
BackwardFlatInterpolation(const std::vector<double>& x,
! const std::vector<double>& y);
private:
std::vector<double> x_, y_;
***************
*** 40,45 ****
public:
ForwardFlatInterpolation(const std::vector<double>& x,
! const std::vector<double>& y,
! bool allowExtrapolation);
private:
std::vector<double> x_, y_;
--- 44,48 ----
public:
ForwardFlatInterpolation(const std::vector<double>& x,
! const std::vector<double>& y);
private:
std::vector<double> x_, y_;
***************
*** 50,54 ****
LinearInterpolation(const std::vector<double>& x,
const std::vector<double>& y,
! bool allowExtrapolation);
private:
std::vector<double> x_, y_;
--- 53,57 ----
LinearInterpolation(const std::vector<double>& x,
const std::vector<double>& y,
! QuantLib::LinearInterpolationType type);
private:
std::vector<double> x_, y_;
***************
*** 57,68 ****
class CubicSplineInterpolation : public Interpolation {
public:
! CubicSplineInterpolation(const std::vector<double>& x,
! const std::vector<double>& y,
! bool allowExtrapolation,
! QuantLib::CubicSpline::BoundaryCondition leftCondition,
! double leftConditionValue,
! QuantLib::CubicSpline::BoundaryCondition rightCondition,
! double rightConditionValue,
! bool monotonicityConstraint);
private:
std::vector<double> x_, y_;
--- 60,71 ----
class CubicSplineInterpolation : public Interpolation {
public:
! CubicSplineInterpolation(
! const std::vector<double>& x,
! const std::vector<double>& y,
! QuantLib::CubicSpline::BoundaryCondition leftCondition,
! double leftConditionValue,
! QuantLib::CubicSpline::BoundaryCondition rightCondition,
! double rightConditionValue,
! bool monotonicityConstraint);
private:
std::vector<double> x_, y_;
***************
*** 73,77 ****
SABRInterpolation(const std::vector<double>& x,
const std::vector<double>& y,
- bool allowExtrapolation,
double t,
double forward,
--- 76,79 ----
Index: interpolation.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/interpolation.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** interpolation.cpp 13 Jun 2006 11:26:23 -0000 1.5
--- interpolation.cpp 13 Jun 2006 18:56:56 -0000 1.6
***************
*** 31,36 ****
BackwardFlatInterpolation::BackwardFlatInterpolation(
const std::vector<double>& x,
! const std::vector<double>& y,
! bool allowExtrapolation) : x_(x), y_(y) {
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
--- 31,35 ----
BackwardFlatInterpolation::BackwardFlatInterpolation(
const std::vector<double>& x,
! const std::vector<double>& y) : x_(x), y_(y) {
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
***************
*** 43,48 ****
ForwardFlatInterpolation::ForwardFlatInterpolation(
const std::vector<double>& x,
! const std::vector<double>& y,
! bool allowExtrapolation) : x_(x), y_(y) {
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
--- 42,46 ----
ForwardFlatInterpolation::ForwardFlatInterpolation(
const std::vector<double>& x,
! const std::vector<double>& y) : x_(x), y_(y) {
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
***************
*** 56,60 ****
const std::vector<double>& x,
const std::vector<double>& y,
! bool allowExtrapolation) : x_(x), y_(y) {
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
--- 54,58 ----
const std::vector<double>& x,
const std::vector<double>& y,
! QuantLib::LinearInterpolationType type) : x_(x), y_(y) {
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
***************
*** 69,73 ****
const std::vector<double>& x,
const std::vector<double>& y,
- bool allowExtrapolation,
QuantLib::CubicSpline::BoundaryCondition leftCondition,
double leftConditionValue,
--- 67,70 ----
***************
*** 87,94 ****
SABRInterpolation::SABRInterpolation(
const std::vector<double>& x,
const std::vector<double>& y,
- bool allowExtrapolation,
double t,
double forward,
--- 84,91 ----
+
SABRInterpolation::SABRInterpolation(
const std::vector<double>& x,
const std::vector<double>& y,
double t,
double forward,
|