Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24871/qlo
Modified Files:
interpolation.cpp interpolation.hpp
Log Message:
QuantLib::Interpolation makes a copy of x,y
Index: interpolation.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/interpolation.hpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** interpolation.hpp 16 Oct 2006 15:15:32 -0000 1.19
--- interpolation.hpp 24 Oct 2006 10:13:54 -0000 1.20
***************
*** 38,43 ****
const std::vector<double>& x,
const std::vector<double>& y);
- private:
- std::vector<double> x_, y_;
};
--- 38,41 ----
***************
*** 52,57 ****
double rightConditionValue,
bool monotonicityConstraint);
- private:
- std::vector<double> x_, y_;
};
--- 50,53 ----
***************
*** 72,77 ****
bool isRhoFixed,
const boost::shared_ptr<QuantLib::OptimizationMethod>& om);
- private:
- std::vector<double> x_, y_;
};
--- 68,71 ----
Index: interpolation.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/interpolation.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** interpolation.cpp 16 Oct 2006 15:15:32 -0000 1.17
--- interpolation.cpp 24 Oct 2006 10:13:54 -0000 1.18
***************
*** 32,41 ****
const std::string &linearInterpolationType,
const std::vector<double>& x,
! const std::vector<double>& y) : x_(x), y_(y)
{
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
libraryObject_ = Create<boost::shared_ptr<QuantLib::Interpolation> >()
! (linearInterpolationType, x_.begin(), x_.end(), y_.begin());
}
--- 32,41 ----
const std::string &linearInterpolationType,
const std::vector<double>& x,
! const std::vector<double>& y)
{
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
libraryObject_ = Create<boost::shared_ptr<QuantLib::Interpolation> >()
! (linearInterpolationType, x.begin(), x.end(), y.begin());
}
***************
*** 47,64 ****
QuantLib::CubicSpline::BoundaryCondition rightCondition,
double rightConditionValue,
! bool monotonicityConstraint) : x_(x), y_(y)
{
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
! libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(
! new QuantLib::CubicSpline(
! x_.begin(), x_.end(), y_.begin(),
! leftCondition, leftConditionValue,
! rightCondition, rightConditionValue,
! monotonicityConstraint));
}
-
-
SABRInterpolation::SABRInterpolation(
const std::vector<double>& x,
--- 47,61 ----
QuantLib::CubicSpline::BoundaryCondition rightCondition,
double rightConditionValue,
! bool monotonicityConstraint)
{
QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
! libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
! QuantLib::CubicSpline(x.begin(), x.end(), y.begin(),
! leftCondition, leftConditionValue,
! rightCondition, rightConditionValue,
! monotonicityConstraint));
}
SABRInterpolation::SABRInterpolation(
const std::vector<double>& x,
***************
*** 75,84 ****
bool isRhoFixed,
const boost::shared_ptr<QuantLib::OptimizationMethod>& om)
- : x_(x), y_(y)
{
libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
! QuantLib::SABRInterpolation(x_.begin(), x_.end(), y_.begin(),
! t, forward, alpha, beta, nu, rho,
! isAlphaFixed, isBetaFixed, isNuFixed, isRhoFixed, om));
}
--- 72,84 ----
bool isRhoFixed,
const boost::shared_ptr<QuantLib::OptimizationMethod>& om)
{
+ QL_REQUIRE(x.size()==y.size(), "unmatched x/y");
+
libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
! QuantLib::SABRInterpolation(x.begin(), x.end(), y.begin(),
! t, forward, alpha, beta, nu, rho,
! isAlphaFixed, isBetaFixed,
! isNuFixed, isRhoFixed,
! om));
}
|