37 inline const std::map<size_t, IndexPattern*>& getLinearSections()
const {
41 inline IndexPatternType getType()
const override {
42 return IndexPatternType::Sectioned;
45 inline void getSubIndexes(std::set<IndexPattern*>& indexes)
const override {
47 indexes.insert(
it.second);
48 it.second->getSubIndexes(indexes);
52 inline virtual ~SectionedIndexPattern() {
60 template<
class VectorSizeT>
61 static inline std::map<size_t, IndexPattern*> detectLinearSections(
const VectorSizeT& indexes,
63 CPPADCG_ASSERT_UNKNOWN(indexes.size() > 0);
73 while (
xStart != indexes.size()) {
76 if (
xStart + 1 == indexes.size()) {
84 for (
size_t x =
xStart + 2; x < indexes.size(); x++) {
85 if (indexes[x] !=
dy * x +
b) {
92 LinearIndexPattern*
p =
new LinearIndexPattern(
xOffset,
dy,
dx,
b);
114 return std::map<size_t, IndexPattern*>();
121 static inline std::map<size_t, IndexPattern*> detectLinearSections(
const std::map<size_t, size_t>&
x2y,
123 using c_iter = std::map<size_t, size_t>::const_iterator;
137 if (
p1 ==
x2y.end()) {
160 for (std::map<size_t, size_t>::const_iterator
itp =
p1;
itp !=
x2y.end(); ++
itp) {
161 size_t x =
itp->first;
162 size_t y =
itp->second;
171 LinearIndexPattern*
p =
new LinearIndexPattern(
xOffset,
dy,
dx,
b);
203 return std::map<size_t, IndexPattern*>();
212 static inline void deleteIndexPatterns(std::map<size_t, IndexPattern*>&
sections) {