Skip to content

Commit f775b13

Browse files
committed
Merge branch 'feature/QPR-13656' into 'master'
QPR-13656 Remove PiecewiseConstantHelper4 Closes QPR-13656 See merge request qs/oreplus!3168
2 parents 87a2c36 + 277752f commit f775b13

2 files changed

Lines changed: 0 additions & 50 deletions

File tree

QuantExt/qle/models/piecewiseconstanthelper.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,4 @@ PiecewiseConstantHelper3::PiecewiseConstantHelper3(const std::vector<Date>& date
119119
checkTimes(t2_);
120120
}
121121

122-
PiecewiseConstantHelper4::PiecewiseConstantHelper4(const Array& t,
123-
const QuantLib::ext::shared_ptr<Constraint>& constraint)
124-
: t_(t), y_(QuantLib::ext::make_shared<PseudoParameter>(t.size(), *constraint)) {
125-
checkTimes(t_);
126-
}
127-
128-
PiecewiseConstantHelper4::PiecewiseConstantHelper4(const std::vector<Date>& dates,
129-
const Handle<YieldTermStructure>& yts,
130-
const QuantLib::ext::shared_ptr<Constraint>& constraint)
131-
: t_(datesToTimes(dates, yts)),
132-
y_(QuantLib::ext::make_shared<PseudoParameter>(dates.size(), *constraint)) {
133-
checkTimes(t_);
134-
}
135-
136122
} // namespace QuantExt

QuantExt/qle/models/piecewiseconstanthelper.hpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -170,30 +170,6 @@ class PiecewiseConstantHelper3 {
170170
mutable std::vector<Real> b_, c_;
171171
};
172172

173-
class PiecewiseConstantHelper4 {
174-
public:
175-
PiecewiseConstantHelper4(const Array& t,
176-
const QuantLib::ext::shared_ptr<QuantLib::Constraint>& constraint = QuantLib::ext::make_shared<QuantLib::NoConstraint>());
177-
PiecewiseConstantHelper4(const std::vector<Date>& dates, const Handle<YieldTermStructure>& yts,
178-
const QuantLib::ext::shared_ptr<QuantLib::Constraint>& constraint = QuantLib::ext::make_shared<QuantLib::NoConstraint>());
179-
180-
const Array& t() const;
181-
const QuantLib::ext::shared_ptr<Parameter> p() const;
182-
/*! this returns the transformed value */
183-
Real y(const Time t) const;
184-
185-
Real direct(const Real x) const;
186-
Real inverse(const Real y) const;
187-
188-
protected:
189-
const Array t_;
190-
/*! y are the raw values in the sense of parameter transformation */
191-
const QuantLib::ext::shared_ptr<PseudoParameter> y_;
192-
193-
private:
194-
mutable std::vector<Real> b_;
195-
};
196-
197173
// inline
198174

199175
inline const Array& PiecewiseConstantHelper1::t() const { return t_; }
@@ -296,14 +272,6 @@ inline void PiecewiseConstantHelper3::update() const {
296272
}
297273
}
298274

299-
inline const Array& PiecewiseConstantHelper4::t() const { return t_; }
300-
301-
inline const QuantLib::ext::shared_ptr<Parameter> PiecewiseConstantHelper4::p() const { return y_; }
302-
303-
inline Real PiecewiseConstantHelper4::direct(const Real x) const { return x * x; }
304-
305-
inline Real PiecewiseConstantHelper4::inverse(const Real y) const { return std::sqrt(y); }
306-
307275
inline Real PiecewiseConstantHelper1::y(const Time t) const {
308276
return rcll_ ? direct(QL_PIECEWISE_FUNCTION(t_, y_->params(), t)) : direct(QL_PIECEWISE_FUNCTION2(t_, y_->params(), t));
309277
}
@@ -320,10 +288,6 @@ inline Real PiecewiseConstantHelper3::y2(const Time t) const {
320288
return direct2(QL_PIECEWISE_FUNCTION(t2_, y2_->params(), t));
321289
}
322290

323-
inline Real PiecewiseConstantHelper4::y(const Time t) const {
324-
return direct(QL_PIECEWISE_FUNCTION2(t_, y_->params(), t));
325-
}
326-
327291
inline Real PiecewiseConstantHelper1::int_y_sqr(const Time t) const {
328292
if (t < 0.0)
329293
return 0.0;

0 commit comments

Comments
 (0)