delphi_cb
 All Classes Namespaces Files Functions Variables Macros
misc_grid.h
Go to the documentation of this file.
1 
8 #ifndef GRID_H_
9 #define GRID_H_
10 
11 #include <iostream>
12 
13 #include "../interface/environment.h"
14 
15 using namespace std;
16 
17 
23 template <class T> struct SGrid
24 {
25  T nX,nY,nZ;
26 };
27 
32 template <class T> struct SGridValue
33 {
34  SGrid <T> nGrid;
35  T nValue;
36 };
37 
41 template <class T> struct SExtrema
42 {
43  SGrid <T> nMin,nMax;
44 };
45 
50 {
51  SGrid<delphi_real> fgCoord;
52  delphi_real fVal1;
53  delphi_real fVal2;
54 };
55 
56 /*------------------- newly defined operators on grids ------------------*/
57 
58 /*
59  * overload operator <<
60  */
61 template <class T> extern ostream& operator<<(ostream &, SGrid<T> &);
62 template <class T> extern ostream& operator<<(ostream &, SGridValue<T> &);
63 template <class T> extern ostream& operator<<(ostream &, SExtrema<T> &);
64 
65 /*
66  * overload operator +
67  */
68 template <class T> extern SGrid <T> operator+(const SGrid <T> &, const SGrid <T> &);
69 template <class T> extern SGrid <T> operator+(const SGrid <T> &, const T &);
70 template <class T> extern SGrid <T> operator+(const T &, const SGrid <T> &);
71 
72 /*
73  * overload operator -
74  */
75 template <class T> extern SGrid <T> operator-(const SGrid <T> &, const SGrid <T> &);
76 template <class T> extern SGrid <T> operator-(const SGrid <T> &, const T &);
77 template <class T> extern SGrid <T> operator-(const T &, const SGrid <T> &);
78 template <class T> extern SGrid <T> operator-(const SGrid <T> &);
79 
80 /*
81  * overload operator *
82  */
83 template <class T> extern SGrid <T> operator*(const SGrid <T> &, const SGrid <T> &);
84 template <class T> extern SGrid <T> operator*(const SGrid <T> &, const T &);
85 template <class T> extern SGrid <T> operator*(const T &, const SGrid <T> &);
86 
87 /*
88  * overload operator /
89  */
90 template <class T, class N> extern SGrid <T> operator/(const SGrid <N> &, const T &);
91 
92 /*
93  * new operator: dot product
94  */
95 template <class T> extern T optDot(const SGrid <T> &, const SGrid <T> &);
96 
97 /*
98  * new operator: cross product
99  */
100 template <class T> extern SGrid <T> optCross(const SGrid <T> &, const SGrid <T> &);
101 
102 /*
103  * new math func. optSQRT()
104  */
106 
107 /*
108  * new math func. optABS()
109  */
110 template <class T> extern SGrid <T> optABS(const SGrid <T> &);
111 
112 /*
113  * convert one type to another
114  */
115 template <class T, class N> extern SGrid <T> optCast(const SGrid <N> &);
116 
117 /*
118  * round to the nearest delphi_integer
119  */
121 
122 /*
123  * new math func. optMin()
124  */
125 template <class T> extern SGrid <T> optMin(const T &, const SGrid <T> &);
126 template <class T> extern SGrid <T> optMin(const SGrid <T> &, const T &);
127 template <class T> extern SGrid <T> optMin(const SGrid <T> &, const SGrid <T> &);
128 template <class T> extern T optMin(const SGrid <T> &);
129 
130 /*
131  * new math func. optMax()
132  */
133 template <class T> extern SGrid <T> optMax(const T &, const SGrid <T> &);
134 template <class T> extern SGrid <T> optMax(const SGrid <T> &, const T &);
135 template <class T> extern SGrid <T> optMax(const SGrid <T> &, const SGrid <T> &);
136 template <class T> extern T optMax(const SGrid <T> &);
137 
138 /*
139  * new func. optMinSign()
140  */
141 template <class T> extern SGrid <T> optMinSign(const T &, const SGrid <T> &);
142 template <class T> extern SGrid <T> optMinSign(const SGrid <T> &, const T &);
143 
144 /*
145  * new func. optMaxSign()
146  */
147 template <class T> extern SGrid <T> optMaxSign(const T &, const SGrid <T> &);
148 template <class T> extern SGrid <T> optMaxSign(const SGrid <T> &, const T &);
149 
150 /*
151  * new func. optSubMin()
152  */
153 template <class T> extern SGrid <T> optSubMin(const SGrid <T> &, const SGrid <T> &, const SGrid <T> &);
154 
155 /*
156  * new func. optSubMax()
157  */
158 template <class T> extern SGrid <T> optSubMax(const SGrid <T> &, const SGrid <T> &, const SGrid <T> &);
159 
160 /*
161  * new func. optSum()
162  */
163 template <class T> extern T optSum(const SGrid <T> &);
164 
165 /*
166  * new func. optComp()
167  */
168 template <class T> extern T optComp(const SGrid <T> &, const int &);
169 
170 /*
171  * new func. optORLT()
172  */
173 template <class T> extern bool optORLT(const SGrid <T> &, const SGrid <T> &);
174 template <class T> extern bool optORLT(const SGrid <T> &, const T &);
175 
176 /*
177  * new func. optANDLT()
178  */
179 template <class T> extern bool optANDLT(const SGrid <T> &, const SGrid <T> &);
180 template <class T> extern bool optANDLT(const SGrid <T> &, const T &);
181 
182 /*
183  * new func. optORLE()
184  */
185 template <class T> extern bool optORLE(const SGrid <T> &, const SGrid <T> &);
186 template <class T> extern bool optORLE(const SGrid <T> &, const T &);
187 
188 /*
189  * new func. optANDLE()
190  */
191 template <class T> extern bool optANDLE(const SGrid <T> &, const SGrid <T> &);
192 template <class T> extern bool optANDLE(const SGrid <T> &, const T &);
193 
194 /*
195  * new func. optORGT()
196  */
197 template <class T> extern bool optORGT(const SGrid <T> &, const SGrid <T> &);
198 template <class T> extern bool optORGT(const SGrid <T> &, const T &);
199 
200 /*
201  * new func. optORGE()
202  */
203 template <class T> extern bool optORGE(const SGrid <T> &, const SGrid <T> &);
204 template <class T> extern bool optORGE(const SGrid <T> &, const T &);
205 
206 /*
207  * new func. optANDGT()
208  */
209 template <class T> extern bool optANDGT(const SGrid <T> &, const SGrid <T> &);
210 template <class T> extern bool optANDGT(const SGrid <T> &, const T &);
211 
212 /*
213  * new func. optANDGE()
214  */
215 template <class T> extern bool optANDGE(const SGrid <T> &, const SGrid <T> &);
216 template <class T> extern bool optANDGE(const SGrid <T> &, const T &);
217 
218 /*
219  * overlaod logical operator !=
220  */
221 template <class T> extern bool operator!=(const SGrid <T> &, const T &);
222 template <class T> extern bool operator!=(const SGrid <T> &, const SGrid <T> &);
223 
224 
225 #endif // GRID_H_
226 
bool optORLT(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:678
SGrid< T > optSubMax(const SGrid< T > &, const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:619
bool optANDGE(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:945
SGrid< T > optCross(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:273
SGrid< T > optMaxSign(const T &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:568
SGrid< T > operator+(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:48
SGrid< delphi_real > optSQRT(const SGrid< delphi_real > &)
Definition: misc_grid_opts.cpp:292
Definition: misc_grid.h:32
bool optORGT(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:830
SGrid< T > optMax(const T &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:456
bool optANDLE(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:792
bool operator!=(const SGrid< T > &, const T &)
Definition: misc_grid_opts.cpp:983
SGrid< T > operator/(const SGrid< N > &, const T &)
Definition: misc_grid_opts.cpp:235
SGrid< T > optABS(const SGrid< T > &)
Definition: misc_grid_opts.cpp:312
SGrid< T > optCast(const SGrid< N > &)
Definition: misc_grid_opts.cpp:337
Definition: misc_grid.h:41
bool optORLE(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:754
SGrid< delphi_integer > optRound(const SGrid< delphi_real > &)
Definition: misc_grid_opts.cpp:359
T optSum(const SGrid< T > &)
Definition: misc_grid_opts.cpp:639
Definition: misc_grid.h:49
bool optORGE(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:868
SGrid< T > optMinSign(const T &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:532
T optComp(const SGrid< T > &, const int &)
Definition: misc_grid_opts.cpp:657
SGrid< T > optMin(const T &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:379
bool optANDLT(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:716
T optDot(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:256
SGrid< T > operator-(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:104
Definition: misc_grid.h:23
bool optANDGT(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:907
SGrid< T > operator*(const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:178
SGrid< T > optSubMin(const SGrid< T > &, const SGrid< T > &, const SGrid< T > &)
Definition: misc_grid_opts.cpp:602