21#include <ql/math/comparison.hpp>
27 const std::vector<std::vector<Real>>& curveData,
28 const std::vector<std::vector<std::pair<Real, Real>>>& volTimesStrikes,
29 const std::vector<std::vector<Real>>& volData,
const bool updateCache) {
35 dirty = dirty || curveTimes.size() !=
curveTimes_.size();
36 dirty = dirty || curveData.size() !=
curveData_.size();
38 dirty = dirty || volData.size() !=
volData_.size();
40 for (Size i = 0; i < curveTimes.size() && !dirty; ++i) {
41 dirty = dirty || (curveTimes[i].size() !=
curveTimes_[i].size());
42 for (Size j = 0; j < curveTimes[i].size() && !dirty; ++j) {
43 dirty = dirty || curveTimes[i][j] !=
curveTimes_[i][j];
47 for (Size i = 0; i < curveData.size() && !dirty; ++i) {
48 dirty = dirty || (curveData[i].size() !=
curveData_[i].size());
49 for (Size j = 0; j < curveData[i].size() && !dirty; ++j) {
50 dirty = dirty || curveData[i][j] !=
curveData_[i][j];
54 for (Size i = 0; i < volTimesStrikes.size() && !dirty; ++i) {
56 for (Size j = 0; j < volTimesStrikes[i].size() && !dirty; ++j) {
57 dirty = dirty || volTimesStrikes[i][j].first !=
volTimesStrikes_[i][j].first;
58 dirty = dirty || volTimesStrikes[i][j].second !=
volTimesStrikes_[i][j].second;
62 for (Size i = 0; i < volData.size() && !dirty; ++i) {
63 dirty = dirty || (volData[i].size() !=
volData_[i].size());
64 for (Size j = 0; j < volData[i].size() && !dirty; ++j) {
65 dirty = dirty || volData[i][j] !=
volData_[i][j];
71 if (dirty && updateCache) {
cache for relevant points on curve / vol surfaces
bool hasChanged(const std::vector< std::vector< Real > > &curveTimes, const std::vector< std::vector< Real > > &curveData, const std::vector< std::vector< std::pair< Real, Real > > > &volTimesStrikes, const std::vector< std::vector< Real > > &volData, const bool updateCache)
std::vector< std::vector< Real > > curveTimes_
std::vector< std::vector< std::pair< Real, Real > > > volTimesStrikes_
std::vector< std::vector< Real > > curveData_
std::vector< std::vector< Real > > volData_
Serializable Credit Default Swap.