OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
IpplExpressions.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 
13 //
14 // FILE NAME
15 // IpplExpressions.h
16 //
17 // CREATED
18 // July 11, 1997
19 //
20 // DESCRIPTION
21 // This header file defines custom objects and operators necessary to use
22 // expression templates in IPPL.
23 //
25 
26 #ifndef IPPL_EXPRESSIONS_H
27 #define IPPL_EXPRESSIONS_H
28 
29 
30 // We need to construct a custom version of Reduction. We must define
31 // this macro before including PETE.h.
32 #define PETE_USER_REDUCTION_CODE \
33  R global_ret; \
34  reduce_masked(ret, global_ret, acc_op, 0 < n ); \
35  ret = global_ret;
36 
37 // include files
38 #include "Message/Message.h"
40 #include "PETE/PETE.h"
41 
42 
43 //=========================================================================
44 //
45 // UNARY OPERATIONS
46 //
47 //=========================================================================
48 
49 // Abs is handled rather strangely. There appears to be two versions
50 // that do the same thing: abs and Abs.
51 
52 PETE_DefineUnary(Abs, (0 < a ? a : -a), FnAbs)
53 
54 inline double
56 {
57  return abs(a);
58 }
59 
60 template<class T>
62 abs(const PETE_Expr<T>& l)
63 {
65  (l.PETE_unwrap().MakeExpression());
66 }
67 
69 PETE_DefineUnary(arg, (arg(a)), FnArg)
70 PETE_DefineUnary(norm, (norm(a)), FnNorm)
71 PETE_DefineUnary(real, (real(a)), FnReal)
72 PETE_DefineUnary(imag, (imag(a)), FnImag)
73 PETE_DefineUnary(sign, (sign(a)), FnSign)
74 PETE_DefineUnary(trace, (trace(a)), FnTrace)
75 PETE_DefineUnary(transpose, (transpose(a)), FnTranspose)
76 PETE_DefineUnary(det, (det(a)), FnDet)
77 PETE_DefineUnary(cofactors, (cofactors(a)), FnCofactors)
78 
79 
80 //=========================================================================
81 //
82 // BINARY OPERATIONS
83 //
84 //=========================================================================
85 
86 // define min/max for built-in scalar types
87 #define PETE_DefineScalarMinMax(Sca) \
88 inline Sca \
89 Min(const Sca& a, const Sca& b) \
90 { \
91  return (a<b ? a : b); \
92 } \
93 inline Sca \
94 Max(const Sca& a, const Sca& b) \
95 { \
96  return (b<a ? a : b); \
97 }
98 
104 
105 PETE_DefineBinary(Min, (Min(a,b)), FnMin)
106 PETE_DefineBinary(Max, (Max(a,b)), FnMax)
107 
108 PETE_DefineBinary(dot, (dot(a,b)), FnDot)
109 PETE_DefineBinary(dotdot, (dotdot(a,b)), FnDotDot)
110 PETE_DefineBinary(outerProduct, (outerProduct(a,b)), FnOuterProduct)
111 PETE_DefineBinary(cross, (cross(a,b)), FnCross)
112 
119 
120 //tjw: make sure kosher to have "cross" down there (added in)
121 #define PETE_DefineIPPLScalar(Sca) \
122 PETE_DefineBinaryWithScalars(Min, FnMin, Sca) \
123 PETE_DefineBinaryWithScalars(Max, FnMax, Sca) \
124 PETE_DefineBinaryWithScalars(dot, FnDot, Sca) \
125 PETE_DefineBinaryWithScalars(dotdot, FnDotDot, Sca) \
126 PETE_DefineBinaryWithScalars(outerProduct, FnOuterProduct, Sca) \
127 PETE_DefineBinaryWithScalars(cross, FnDot, Sca) \
128 PETE_DefineBinaryWithScalars(lt, OpLT, Sca) \
129 PETE_DefineBinaryWithScalars(le, OpLE, Sca) \
130 PETE_DefineBinaryWithScalars(gt, OpGT, Sca) \
131 PETE_DefineBinaryWithScalars(ge, OpGE, Sca) \
132 PETE_DefineBinaryWithScalars(eq, OpEQ, Sca) \
133 PETE_DefineBinaryWithScalars(ne, OpNE, Sca)
134 
139 PETE_DefineIPPLScalar(double)
140 
144 
145 #undef PETE_DefineIPPLScalar
146 
147 // Now we need to provide special cases for Vektors, SymTenzors, and Tenzors
148 // so we can remove PETE_Expr base class.
149 
150 #define PETE_DefineBinaryWithVSTScalars(Fun,Op,Sca) \
151 template<class T1, unsigned Dim, class T2> \
152 inline PETE_TBTree<Op, PETE_Scalar< Sca<T1, Dim> >, \
153  typename T2::PETE_Expr_t> \
154 Fun(const Sca<T1, Dim> &l, const PETE_Expr<T2>& r) \
155 { \
156  typedef PETE_TBTree<Op, PETE_Scalar< Sca<T1, Dim> >, \
157  typename T2::PETE_Expr_t> ret; \
158  return ret(PETE_Scalar< Sca<T1, Dim> >(l), \
159  r.PETE_unwrap().MakeExpression()); \
160 } \
161 template<class T1, class T2, unsigned Dim> \
162 inline PETE_TBTree<Op, typename T1::PETE_Expr_t, \
163  PETE_Scalar< Sca<T2, Dim> > > \
164 Fun(const PETE_Expr<T1>& l, const Sca<T2, Dim> &r) \
165 { \
166  typedef PETE_TBTree<Op, typename T1::PETE_Expr_t, \
167  PETE_Scalar< Sca<T2, Dim> > > ret; \
168  return ret(l.PETE_unwrap().MakeExpression(), \
169  PETE_Scalar< Sca<T2, Dim> >(r)); \
170 }
171 
172 #define PETE_DefineTrinaryWithVSTScalars(Fun, Op, Sca) \
173 template<class Cond_t, class True_t, class T, unsigned Dim> \
174 inline PETE_TTTree<Op, typename Cond_t::PETE_Expr_t, \
175  typename True_t::PETE_Expr_t, PETE_Scalar< Sca<T, Dim> > > \
176 Fun(const PETE_Expr<Cond_t>& c, const PETE_Expr<True_t>& t, \
177  const Sca<T, Dim> &f) \
178 { \
179  typedef PETE_TTTree<Op, typename Cond_t::PETE_Expr_t, \
180  typename True_t::PETE_Expr_t, PETE_Scalar< Sca<T, Dim> > > ret; \
181  return ret(c.PETE_unwrap().MakeExpression(), \
182  t.PETE_unwrap().MakeExpression(), PETE_Scalar< Sca<T, Dim> >(f)); \
183 } \
184 template<class Cond_t, class T, unsigned Dim, class False_t> \
185 inline PETE_TTTree<Op, typename Cond_t::PETE_Expr_t, \
186  PETE_Scalar< Sca<T, Dim> >, typename False_t::PETE_Expr_t > \
187 Fun(const PETE_Expr<Cond_t>& c, const Sca<T, Dim> &t, \
188  const PETE_Expr<False_t>& f) \
189 { \
190  typedef PETE_TTTree<Op, typename Cond_t::PETE_Expr_t, PETE_Scalar< Sca<T, Dim> >, \
191  typename False_t::PETE_Expr_t > ret; \
192  return ret(c.PETE_unwrap().MakeExpression(), \
193  PETE_Scalar< Sca<T, Dim> >(t), f.PETE_unwrap().MakeExpression()); \
194 } \
195 template<class Cond_t, class T, unsigned Dim> \
196 inline PETE_TTTree<Op, typename Cond_t::PETE_Expr_t, \
197  PETE_Scalar< Sca<T, Dim> >, PETE_Scalar< Sca<T, Dim> > > \
198 Fun(const PETE_Expr<Cond_t>& c, const Sca<T, Dim> &t, const Sca<T, Dim> &f) \
199 { \
200  typedef PETE_TTTree<Op, typename Cond_t::PETE_Expr_t, \
201  PETE_Scalar< Sca<T, Dim> >, PETE_Scalar< Sca<T, Dim> > > ret; \
202  return ret(c.PETE_unwrap().MakeExpression(), \
203  PETE_Scalar< Sca<T, Dim> >(t), PETE_Scalar< Sca<T, Dim> >(f)); \
204 }
205 
206 
207 //tjw: make sure kosher to have "cross" down there (added in)
208 #define PETE_DefineVSTScalar(Sca) \
209 PETE_DefineBinaryWithVSTScalars(operator+, OpAdd, Sca) \
210 PETE_DefineBinaryWithVSTScalars(operator-, OpSubtract, Sca) \
211 PETE_DefineBinaryWithVSTScalars(operator*, OpMultipply, Sca) \
212 PETE_DefineBinaryWithVSTScalars(operator/, OpDivide, Sca) \
213 PETE_DefineBinaryWithVSTScalars(operator%, OpMod, Sca) \
214 PETE_DefineBinaryWithVSTScalars(operator<, OpLT, Sca) \
215 PETE_DefineBinaryWithVSTScalars(operator<=, OpLE, Sca) \
216 PETE_DefineBinaryWithVSTScalars(operator>, OpGT, Sca) \
217 PETE_DefineBinaryWithVSTScalars(operator>=, OpGE, Sca) \
218 PETE_DefineBinaryWithVSTScalars(operator==, OpEQ, Sca) \
219 PETE_DefineBinaryWithVSTScalars(operator!=, OpNE, Sca) \
220 PETE_DefineBinaryWithVSTScalars(operator&&, OpAnd, Sca) \
221 PETE_DefineBinaryWithVSTScalars(operator||, OpOr, Sca) \
222 PETE_DefineBinaryWithVSTScalars(operator&, OpBitwiseAnd, Sca) \
223 PETE_DefineBinaryWithVSTScalars(operator|, OpBitwiseOr, Sca) \
224 PETE_DefineBinaryWithVSTScalars(operator^, OpBitwiseXor, Sca) \
225 PETE_DefineBinaryWithVSTScalars(copysign, FnCopysign, Sca) \
226 PETE_DefineBinaryWithVSTScalars(ldexp, FnLdexp, Sca) \
227 PETE_DefineBinaryWithVSTScalars(pow, FnPow, Sca) \
228 PETE_DefineBinaryWithVSTScalars(fmod, FnFmod, Sca) \
229 PETE_DefineBinaryWithVSTScalars(atan2, FnArcTan2, Sca) \
230 PETE_DefineTrinaryWithVSTScalars(where, OpWhere, Sca) \
231 PETE_DefineBinaryWithVSTScalars(Min, FnMin, Sca) \
232 PETE_DefineBinaryWithVSTScalars(Max, FnMax, Sca) \
233 PETE_DefineBinaryWithVSTScalars(dot, FnDot, Sca) \
234 PETE_DefineBinaryWithVSTScalars(dotdot, FnDotDot, Sca) \
235 PETE_DefineBinaryWithVSTScalars(outerProduct, FnOuterProduct, Sca) \
236 PETE_DefineBinaryWithVSTScalars(cross, FnCross, Sca) \
237 PETE_DefineBinaryWithVSTScalars(lt, OpLT, Sca) \
238 PETE_DefineBinaryWithVSTScalars(le, OpLE, Sca) \
239 PETE_DefineBinaryWithVSTScalars(gt, OpGT, Sca) \
240 PETE_DefineBinaryWithVSTScalars(ge, OpGE, Sca) \
241 PETE_DefineBinaryWithVSTScalars(eq, OpEQ, Sca) \
242 PETE_DefineBinaryWithVSTScalars(ne, OpNE, Sca)
243 
247 
248 #undef PETE_DefineVSTScalar
249 
250 
251 //=========================================================================
252 //
253 // ASSIGNMENT OPERATIONS
254 //
255 //=========================================================================
256 
257 PETE_DefineAssign((a = Min(a,b)),(a = Min(a,b.value)), OpMinAssign)
258 PETE_DefineAssign((a = Max(a,b)),(a = Max(a,b.value)), OpMaxAssign)
259 PETE_DefineAssign((a = (a&&b)) ,(a = (a&&b.value)) , OpAndAssign)
260 PETE_DefineAssign((a = (a||b)) ,(a = (a||b.value)) , OpOrAssign)
261 
262 
263 //=========================================================================
264 //
265 // MIN and MAX REDUCTIONS
266 //
267 //=========================================================================
268 
269 #ifdef __MWERKS__
270 // Workaround for CodeWarrior 4 bug
271 // Funny "MMin" name is to avoid conflict with Min defined elsewhere in r1
272 template<class T>
273 struct MMin {
274  typedef typename T::PETE_Expr_t::PETE_Return_t type_t;
275  static inline type_t apply(const PETE_Expr<T>& expr) {
276  type_t val ;
278  OpAssign(), OpMinAssign());
279  return val;
280  }
281 };
282 
283 template<class T>
284 inline typename MMin<T>::type_t
285 min(const PETE_Expr<T>& expr) {
286  return MMin<T>::apply(expr);
287 }
288 #else
289 template<class T>
290 inline typename T::PETE_Expr_t::PETE_Return_t
291 min(const PETE_Expr<T>& expr)
292 {
293  typename T::PETE_Expr_t::PETE_Return_t val ;
294  Reduction(val,
296  OpAssign(),
297  OpMinAssign());
298  return val;
299 }
300 #endif // __MWERKS__
301 
302 #ifdef __MWERKS__
303 // Workaround for CodeWarrior 4 bug
304 // Funny "MMax" name is to avoid conflict with Max defined elsewhere in r1
305 template<class T>
306 struct MMax {
307  typedef typename T::PETE_Expr_t::PETE_Return_t type_t;
308  static inline type_t apply(const PETE_Expr<T>& expr) {
309  type_t val ;
311  OpAssign(), OpMaxAssign());
312  return val;
313  }
314 };
315 
316 template<class T>
317 inline typename MMax<T>::type_t
318 max(const PETE_Expr<T>& expr) {
319  return MMax<T>::apply(expr);
320 }
321 #else
322 template<class T>
323 inline typename T::PETE_Expr_t::PETE_Return_t
324 max(const PETE_Expr<T>& expr)
325 {
326  typename T::PETE_Expr_t::PETE_Return_t val ;
327  Reduction(val,
329  OpAssign(),
330  OpMaxAssign());
331  return val;
332 }
333 #endif // __MWERKS__
334 
335 
336 //=========================================================================
337 //
338 // MINMAX REDUCTION
339 //
340 //=========================================================================
341 
342 template<class T>
343 struct MinMaxHolder {
344  T a;
345  T b;
346  MinMaxHolder() { }
347  MinMaxHolder(const MinMaxHolder<T>& rhs) : a(rhs.a), b(rhs.b) { }
348  const MinMaxHolder<T>& operator=(const MinMaxHolder<T>& rhs) {
349  a = rhs.a;
350  b = rhs.b;
351  return *this;
352  }
353  const MinMaxHolder<T>& operator=(const T& rhs) {
354  T c = rhs;
355  a = c;
356  b = c;
357  return *this;
358  }
359  const MinMaxHolder<T>& operator*=(const MinMaxHolder<T>& rhs) {
360  a = (a < rhs.a ? a : rhs.a);
361  b = (rhs.b < b ? b : rhs.b);
362  return *this;
363  }
364  const MinMaxHolder<T>& operator*=(const T& rhs) {
365  T c = rhs;
366  a = (a < c ? a : c);
367  b = (c < b ? b : c);
368  return *this;
369  }
370  Message& putMessage(Message& m) {
371  m.put(a);
372  m.put(b);
373  return m;
374  }
375  Message& getMessage(Message& m) {
376  m.get(a);
377  m.get(b);
378  return m;
379  }
380 };
381 
382 template<class T1, class T2>
383 inline void
384 minmax(const PETE_Expr<T1>& expr, T2& minval, T2& maxval)
385 {
386  typedef typename T1::PETE_Expr_t::PETE_Return_t val_t;
387  MinMaxHolder<val_t> ret;
388  Reduction(ret,
390  OpAssign(),
392  minval = static_cast<T2>(ret.a);
393  maxval = static_cast<T2>(ret.b);
394 }
395 
396 
398 //
399 // The 'any' function finds if there is any location in the expression
400 // where a condition is true.
401 //
403 
404 template<class T, class OP>
405 struct AnyHolder
406 {
407  bool Test;
409  OP Op;
410  AnyHolder() : Test(false), Val(T(0)), Op(OP()) {}
411  AnyHolder(const T& t, OP op) : Test(false), Val(t), Op(op) {}
413  : Test(rhs.Test), Val(rhs.Val), Op(rhs.Op) { }
414  const AnyHolder<T,OP>& operator=(const T& rhs)
415  {
416  if ( PETE_apply(Op,rhs,Val) )
417  Test = true;
418  return *this;
419  }
421  {
422  Test = rhs.Test;
423  Val = rhs.Val;
424  Op = rhs.Op;
425  return *this;
426  }
427  const AnyHolder<T,OP>& operator*=(const T& rhs)
428  {
429  if ( PETE_apply(Op,rhs,Val) )
430  Test = true;
431  return *this;
432  }
434  {
435  Test = (Test || rhs.Test);
436  return *this;
437  }
439  {
440  m.put(Test);
441  return m;
442  }
444  {
445  m.get(Test);
446  return m;
447  }
448 };
449 
450 template<class T1, class T2>
451 inline bool
452 any(const PETE_Expr<T1>& expr, T2 val)
453 {
454  AnyHolder<T2,OpEQ> ret(val,OpEQ());
455  Reduction(ret,
457  OpAssign(),
459  return ret.Test;
460 }
461 
462 template<class T1, class T2, class Op>
463 inline bool
464 any(const PETE_Expr<T1>& expr, T2 val, Op op)
465 {
466  AnyHolder<T2,Op> ret(val,op);
467  Reduction(ret,
469  OpAssign(),
471  return ret.Test;
472 }
473 
474 
475 //=========================================================================
476 //
477 // BOUNDS REDUCTION - find bounding box of Vektor expression
478 // for scalars, use minmax
479 // for tensors, extend this code to include them as well
480 //
481 //=========================================================================
482 
483 template<class T, unsigned int D>
484 struct BoundsHolder {
488  BoundsHolder(const BoundsHolder<T,D>& rhs) : a(rhs.a), b(rhs.b) { }
490  a = rhs.a;
491  b = rhs.b;
492  return *this;
493  }
495  Vektor<T,D> c(rhs);
496  a = c;
497  b = c;
498  return *this;
499  }
500  const BoundsHolder<T,D>& operator=(const T& rhs) {
501  Vektor<T,D> c(rhs);
502  a = c;
503  b = c;
504  return *this;
505  }
507  for (unsigned int d=0; d < D; ++d) {
508  a[d] = (a[d] < rhs.a[d] ? a[d] : rhs.a[d]);
509  b[d] = (rhs.b[d] < b[d] ? b[d] : rhs.b[d]);
510  }
511  return *this;
512  }
514  Vektor<T,D> c(rhs);
515  for (unsigned int d=0; d < D; ++d) {
516  a[d] = (a[d] < c[d] ? a[d] : c[d]);
517  b[d] = (c[d] < b[d] ? b[d] : c[d]);
518  }
519  return *this;
520  }
521  const BoundsHolder<T,D>& operator*=(const T& rhs) {
522  Vektor<T,D> c(rhs);
523  for (unsigned int d=0; d < D; ++d) {
524  a[d] = (a[d] < c[d] ? a[d] : c[d]);
525  b[d] = (c[d] < b[d] ? b[d] : c[d]);
526  }
527  return *this;
528  }
530  m.put(a);
531  m.put(b);
532  return m;
533  }
535  m.get(a);
536  m.get(b);
537  return m;
538  }
539 };
540 
541 template<class T1, class T2, unsigned int D>
542 inline void
543 bounds(const PETE_Expr<T1>& expr, Vektor<T2,D>& minval, Vektor<T2,D>& maxval)
544 {
545  BoundsHolder<T2,D> ret;
546  Reduction(ret,
548  OpAssign(),
550  minval = ret.a;
551  maxval = ret.b;
552 }
553 
554 
555 //=========================================================================
556 //
557 // OPERATOR()
558 //
559 //=========================================================================
560 
561 template<class T, class TP>
562 inline typename PETEUnaryReturn<T,OpParens<TP> >::type
563 PETE_apply(OpParens<TP> op, const T& a)
564 {
565  return a(op.Arg);
566 }
567 
568 
569 //=========================================================================
570 //
571 // MISCELLANEOUS
572 //
573 //=========================================================================
574 
575 // When figuring out data dependencies you sometimes need to know
576 // if the left hand side of an assignment needs to be read
577 // before being it is written.
578 // The following trait will set IsAssign to 1 for OpAssign
579 // and to zero for all the other assignment functions.
580 
581 template<class Op> struct OperatorTraits { enum { IsAssign=0 }; };
582 template<> struct OperatorTraits<OpAssign> { enum { IsAssign=1 }; };
583 
584 
586 //
587 // END OF FILE
588 //
590 
591 #endif // IPPL_EXPRESSIONS_H
592 
593 /***************************************************************************
594  * $RCSfile: IpplExpressions.h,v $ $Author: adelmann $
595  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:28 $
596  * IPPL_VERSION_ID: $Id: IpplExpressions.h,v 1.1.1.1 2003/01/23 07:40:28 adelmann Exp $
597  ***************************************************************************/
T::PETE_Return_t Reduction(const PETE_Expr< T > &const_expr, CompOp comp_op, AccOp acc_op, NDIndex< D > &loc)
#define PETE_DefineUnary(Fun, Expr, Op)
Definition: PETE.h:787
const AnyHolder< T, OP > & operator=(const AnyHolder< T, OP > &rhs)
void PETE_apply(const OpPeriodic< T > &e, T &a, const T &b)
Definition: BCond.hpp:373
void minmax(const PETE_Expr< T1 > &expr, T2 &minval, T2 &maxval)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Definition: PETE.h:80
PETE_TBTree< OpGT, Index::PETE_Expr_t, PETE_Scalar< double > > gt(const Index &idx, double x)
Definition: IndexInlines.h:354
#define PETE_DefineScalar(Sca)
Definition: PETE.h:1069
#define PETE_DefineBinaryWithScalars(Fun, Op, Sca)
Definition: PETE.h:906
Definition: TSVMeta.h:24
Definition: rbendmap.h:8
PETEBinaryReturn< T1, T2, OpMultipply >::type dotdot(const AntiSymTenzor< T1, D > &lhs, const AntiSymTenzor< T2, D > &rhs)
const BoundsHolder< T, D > & operator=(const T &rhs)
T det(const AntiSymTenzor< T, 3 > &t)
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Definition: ReductionLoc.h:123
Message & putMessage(Message &m)
PETE_TBTree< OpEQ, Index::PETE_Expr_t, PETE_Scalar< double > > eq(const Index &idx, double x)
Definition: IndexInlines.h:356
AntiSymTenzor< T, D > transpose(const AntiSymTenzor< T, D > &rhs)
PETE_TBTree< OpLE, Index::PETE_Expr_t, PETE_Scalar< double > > le(const Index &idx, double x)
Definition: IndexInlines.h:353
WrappedExpr & PETE_unwrap()
Definition: PETE.h:85
std::complex< double > dcomplex
Definition: dcomplex.h:30
const BoundsHolder< T, D > & operator*=(const T &rhs)
const AnyHolder< T, OP > & operator=(const T &rhs)
PETE_TBTree< OpNE, Index::PETE_Expr_t, PETE_Scalar< double > > ne(const Index &idx, double x)
Definition: IndexInlines.h:357
BoundsHolder(const BoundsHolder< T, D > &rhs)
#define PETE_DefineIPPLScalar(Sca)
Message & getMessage(Message &m)
AnyHolder(const T &t, OP op)
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
Definition: Vector3D.cpp:118
Tenzor< T, D > cofactors(const AntiSymTenzor< T, D > &rhs)
FLieGenerator< T, N > real(const FLieGenerator< std::complex< T >, N > &)
Take real part of a complex generator.
PETE_TBTree< OpGE, Index::PETE_Expr_t, PETE_Scalar< double > > ge(const Index &idx, double x)
Definition: IndexInlines.h:355
void bounds(const PETE_Expr< T1 > &expr, Vektor< T2, D > &minval, Vektor< T2, D > &maxval)
#define PETE_DefineVSTScalar(Sca)
m_complex conj(const m_complex &c)
Definition: MVector.h:105
Vektor< T, D > a
double Max(double a, double b)
const AnyHolder< T, OP > & operator*=(const T &rhs)
constexpr double c
The velocity of light in m/s.
Definition: Physics.h:52
Vector3D cross(const Vector3D &lhs, const Vector3D &rhs)
Vector cross product.
Definition: Vector3D.cpp:111
#define PETE_DefineScalarMinMax(Sca)
const BoundsHolder< T, D > & operator=(const Vektor< T, D > &rhs)
PETE_TBTree< OpLT, Index::PETE_Expr_t, PETE_Scalar< double > > lt(const Index &idx, double x)
Definition: IndexInlines.h:352
MMatrix< double > & operator*=(MMatrix< double > &m1, MMatrix< double > m2)
Definition: MMatrix.cpp:332
arg(a))
Message & get(const T &cval)
Definition: Message.h:484
#define PETE_DefineBinarySynonym(Fun, Op)
Definition: PETE.h:870
Message & put(const T &val)
Definition: Message.h:414
const AnyHolder< T, OP > & operator*=(const AnyHolder< T, OP > &rhs)
double Min(double a, double b)
bool any(const PETE_Expr< T1 > &expr, T2 val)
const BoundsHolder< T, D > & operator*=(const BoundsHolder< T, D > &rhs)
FnArg FnReal sign(a))
const BoundsHolder< T, D > & operator=(const BoundsHolder< T, D > &rhs)
BOOST_UBLAS_INLINE V trace(ublas::matrix< V > &e)
Computes the trace of a square matrix.
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, D > outerProduct(const Vektor< T1, D > &v1, const Vektor< T2, D > &v2)
Definition: Tenzor.h:443
void getMessage(Message &m, T &t)
Definition: Message.h:580
const BoundsHolder< T, D > & operator*=(const Vektor< T, D > &rhs)
Vektor< T, D > b
#define PETE_DefineBinary(Fun, Expr, Op)
Definition: PETE.h:853
AnyHolder(const AnyHolder< T, OP > &rhs)
void putMessage(Message &m, const T &t)
Definition: Message.h:557
Message & putMessage(Message &m)
FLieGenerator< T, N > imag(const FLieGenerator< std::complex< T >, N > &)
Take imaginary part of a complex generator.
PETE_DefineAssign((a=Min(a, b)),(a=Min(a, b.value)), OpMinAssign) PETE_DefineAssign((a
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Definition: ReductionLoc.h:95
Message & getMessage(Message &m)