Class documentation of Concepts

Loading...
Searching...
No Matches
coeffIterator.hh
Go to the documentation of this file.
1
6#ifndef coeffIterator_hh
7#define coeffIterator_hh
8
9#include "basics/typedefs.hh"
10#include "basics/exceptions.hh"
12#include "basics/debug.hh"
13
14// debugging
15#define CoeffItIncrOp_D 0
16
17namespace concepts {
18
19 // ********************************************************* CoeffIterator **
20
37 template<typename F, typename Coeff>
39
45 template<typename F>
46 class CoeffIterator<F, F> {
47 public:
48 CoeffIterator(const F* data) : data_(data) {}
49 const F* operator++() { return ++data_; }
50 inline const F* operator++(int) { return data_++; }
51 private:
52 const F* data_;
53 };
54
60 template<typename F, uint dim>
61 class CoeffIterator<F, Point<F,dim> >
62 {
63 public:
65 CoeffIterator(const Point<F,dim>* data, int i = 0) : data_(data), i_(i) {}
67 inline const F* operator++();
69 inline const F* operator++(int);
71 inline const F* data();
72 private:
74 const Point<F,dim>* data_;
76 const int i_;
77 };
78
79 template<typename F, uint dim>
81 {
82 ++data_;
83 DEBUGL(CoeffItIncrOp_D, '(' << i_ << ") is "
84 << *this->data() << " at " << this->data());
85 return this->data();
86 }
87
88 template<typename F, uint dim>
90 {
91 const F* tmp = this->data();
92 ++data_;
93 return tmp;
94 }
95
96 template<typename F, uint dim>
98 {
99 return &(data_->operator[](i_));
100 }
101
107 template<typename F, uint dim>
108 class CoeffIterator<F, Mapping<F,dim> >
109 {
110 public:
112 CoeffIterator(const Mapping<F,dim>* data, uint i = 0, uint j = 0) :
113 data_(data), i_(i), j_(j) {}
115 inline const F* operator++();
117 inline const F* operator++(int);
119 inline const F* data();
120 private:
122 const Mapping<F,dim>* data_;
123 const uint i_;
124 const uint j_;
125 };
126
127 template<typename F, uint dim>
129 {
130 ++data_;
131 DEBUGL(CoeffItIncrOp_D, '(' << i_ << ", " << j_ << ") is "
132 << *this->data() << " at " << this->data());
133 return this->data();
134 }
135
136 template<typename F, uint dim>
138 {
139 const F* tmp = this->data();
140 ++data_;
141 return tmp;
142 }
143
144 template<typename F, uint dim>
146 {
147 return &(data_->operator()(i_, j_));
148 }
149
150} // namespace
151
152#endif // coeffIterator_hh
CoeffIterator(const Mapping< F, dim > *data, uint i=0, uint j=0)
Constructor.
CoeffIterator(const Point< F, dim > *data, int i=0)
Constructor.
#define DEBUGL(doit, msg)
Definition debug.hh:40
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320