DFT-EFE
 
Loading...
Searching...
No Matches
PointImpl.h
Go to the documentation of this file.
1#ifndef dftefePointImpl_h
2#define dftefePointImpl_h
3#include "TypeConfig.h"
4#include <iostream>
5#include <vector>
6
7namespace dftefe
8{
9 namespace utils
10 {
11 template <typename T>
13 {
14 typedef T value_type;
15 typedef T * pointer;
16 typedef T & reference;
17 typedef const T &const_reference;
18 typedef int difference_type;
19 typedef T * iterator;
20 typedef const T *const_iterator;
21
22 public:
29 PointImpl(const std::vector<T> &x);
30
37 PointImpl(const T *x, size_type N);
38
46
55
60 PointImpl(const PointImpl &p);
61
65 ~PointImpl();
66
67
73 size() const;
74
82 begin();
83
92 begin() const;
93
100 end();
101
109 end() const;
110
117 PointImpl &
118 operator=(const PointImpl &p);
119
128
136 operator[](size_type i) const;
137
138
139 private:
142 };
143
144 //
145 // A list of helper functions to operate on PointImpl
146 //
147
156 template <typename T>
158 operator*=(PointImpl<T> &p, T a);
159
168 template <typename T>
170 operator*(const PointImpl<T> &p, T a);
171
181 template <typename T>
183 operator*(T a, const PointImpl<T> &p);
184
195 template <typename T>
198
209 template <typename T>
211 operator+(const PointImpl<T> &v, const PointImpl<T> &u);
212
223 template <typename T>
226
237 template <typename T>
239 operator-(const PointImpl<T> &p, const PointImpl<T> &q);
240
241
251 template <typename T>
252 std::ostream &
253 operator<<(std::ostream &outputStream, const PointImpl<T> &p);
254
255 } // end of namespace utils
256} // end of namespace dftefe
257
258#include "PointImpl.t.cpp"
259
260#endif // dftefePointImpl_h
Definition: PointImpl.h:13
~PointImpl()
Destructor.
Definition: PointImpl.t.cpp:76
T * iterator
Definition: PointImpl.h:19
const T * const_iterator
Definition: PointImpl.h:20
T & reference
Definition: PointImpl.h:16
PointImpl & operator=(const PointImpl &p)
Operator overload for assignment q=p.
Definition: PointImpl.t.cpp:55
size_type d_size
Definition: PointImpl.h:141
size_type size() const
Returns the dimension of the point.
Definition: PointImpl.t.cpp:125
reference operator[](size_type i)
Operator to get a reference to a component of the point.
Definition: PointImpl.t.cpp:132
iterator end()
Return iterator pointing to the end of PointImpl data.
Definition: PointImpl.t.cpp:108
iterator begin()
Return iterator pointing to the begining of point data.
Definition: PointImpl.t.cpp:87
T value_type
Definition: PointImpl.h:14
pointer d_data
Definition: PointImpl.h:140
int difference_type
Definition: PointImpl.h:18
T * pointer
Definition: PointImpl.h:15
const T & const_reference
Definition: PointImpl.h:17
PointImpl< T > & operator*=(PointImpl< T > &p, T a)
In-plance multiplication of the point by a scalar p->p*a.
Definition: PointImpl.t.cpp:148
PointImpl< T > operator+(const PointImpl< T > &v, const PointImpl< T > &u)
Addition of two points r = p + q.
Definition: PointImpl.t.cpp:187
PointImpl< T > & operator-=(PointImpl< T > &p, const PointImpl< T > &q)
In-place subtraction of two points p -> p - q;.
Definition: PointImpl.t.cpp:196
std::ostream & operator<<(std::ostream &outputStream, const PointImpl< T > &p)
Output perator.
Definition: PointImpl.t.cpp:216
PointImpl< T > & operator+=(PointImpl< T > &p, const PointImpl< T > &q)
In-place addition of two pointts p-> p + q.
Definition: PointImpl.t.cpp:177
PointImpl< T > operator-(const PointImpl< T > &p, const PointImpl< T > &q)
Subtraction of two points = p - q.
Definition: PointImpl.t.cpp:206
PointImpl< T > operator*(const PointImpl< T > &p, T a)
Multiplication by a scalar q = p*a.
Definition: PointImpl.t.cpp:159
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8