ROOT   6.10/09 Reference Guide
BinaryOperators.h
Go to the documentation of this file.
1 // @(#)root/smatrix:$Id$
2 // Authors: T. Glebe, L. Moneta 2005
3
4 #ifndef ROOT_Math_BinaryOperators
5 #define ROOT_Math_BinaryOperators
6 //======================================================
7 //
8 // ATTENTION: This file was automatically generated,
9 // do not edit!
10 //
11 // author: Thorsten Glebe
12 // HERA-B Collaboration
13 // Max-Planck-Institut fuer Kernphysik
14 // Saupfercheckweg 1
15 // 69117 Heidelberg
16 // Germany
17 // E-mail: T.Glebe@mpi-hd.mpg.de
18 //
19 //======================================================
20
21 #include "Math/BinaryOpPolicy.h"
22 #include "Math/Expression.h"
23
24 namespace ROOT {
25
26  namespace Math {
27
28
29
30 template <class T, unsigned int D> class SVector;
31 template <class T, unsigned int D1, unsigned int D2, class R> class SMatrix;
32
33
34 //==============================================================================
36 //==============================================================================
37 /**
38  Addition Operation Class
39
40  @ingroup Expression
41  */
42 template <class T>
43 class AddOp {
44 public:
45  static inline T apply(const T& lhs, const T& rhs) {
46  return lhs + rhs;
47  }
48 };
49
50
51 /**
52  Addition of two vectors v3 = v1+v2
53  returning a vector expression
54
55  @ingroup VectFunction
56 */
57 //==============================================================================
58 // operator+ (SVector, binary)
59 //==============================================================================
60 template < class T, unsigned int D>
61 inline VecExpr<BinaryOp<AddOp<T>, SVector<T,D>, SVector<T,D>, T>, T, D>
62  operator+(const SVector<T,D>& lhs, const SVector<T,D>& rhs) {
63  typedef BinaryOp<AddOp<T>, SVector<T,D>, SVector<T,D>, T> AddOpBinOp;
64
66 }
67
68
69 //==============================================================================
70 // operator+ (SVector, binary)
71 //==============================================================================
72 template <class A, class T, unsigned int D>
73 inline VecExpr<BinaryOp<AddOp<T>, VecExpr<A,T,D>, SVector<T,D>, T>, T, D>
74  operator+(const VecExpr<A,T,D>& lhs, const SVector<T,D>& rhs) {
75  typedef BinaryOp<AddOp<T>, VecExpr<A,T,D>, SVector<T,D>, T> AddOpBinOp;
76
78 }
79
80
81 //==============================================================================
82 // operator+ (SVector, binary)
83 //==============================================================================
84 template < class A, class T, unsigned int D>
85 inline VecExpr<BinaryOp<AddOp<T>, SVector<T,D>, VecExpr<A,T,D>, T>, T, D>
86  operator+(const SVector<T,D>& lhs, const VecExpr<A,T,D>& rhs) {
87  typedef BinaryOp<AddOp<T>, SVector<T,D>, VecExpr<A,T,D>, T> AddOpBinOp;
88
90 }
91
92
93 //==============================================================================
94 // operator+ (SVector, binary)
95 //==============================================================================
96 template <class A, class B, class T, unsigned int D>
97 inline VecExpr<BinaryOp<AddOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T>, T, D>
98  operator+(const VecExpr<A,T,D>& lhs, const VecExpr<B,T,D>& rhs) {
99  typedef BinaryOp<AddOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T> AddOpBinOp;
100
102 }
103
104
105 /**
106  Addition of a scalar to a each vector element: v2(i) = v1(i) + a
107  returning a vector expression
108
109  @ingroup VectFunction
110 */
111 //==============================================================================
112 // operator+ (SVector, binary, Constant)
113 //==============================================================================
114 template <class A, class T, unsigned int D>
115 inline VecExpr<BinaryOpCopyR<AddOp<T>, SVector<T,D>, Constant<A>, T>, T, D>
116  operator+(const SVector<T,D>& lhs, const A& rhs) {
117  typedef BinaryOpCopyR<AddOp<T>, SVector<T,D>, Constant<A>, T> AddOpBinOp;
118
120 }
121
122 /**
123  Addition of a scalar to each vector element v2(i) = a + v1(i)
124  returning a vector expression
125
126  @ingroup VectFunction
127 */
128 //==============================================================================
129 // operator+ (SVector, binary, Constant)
130 //==============================================================================
131 template <class A, class T, unsigned int D>
132 inline VecExpr<BinaryOpCopyL<AddOp<T>, Constant<A>, SVector<T,D>, T>, T, D>
133  operator+(const A& lhs, const SVector<T,D>& rhs) {
134  typedef BinaryOpCopyL<AddOp<T>, Constant<A>, SVector<T,D>, T> AddOpBinOp;
135
137 }
138
139
140 //==============================================================================
141 // operator+ (SVector, binary, Constant)
142 //==============================================================================
143 template <class A, class B, class T, unsigned int D>
144 inline VecExpr<BinaryOpCopyR<AddOp<T>, VecExpr<B,T,D>, Constant<A>, T>, T, D>
145  operator+(const VecExpr<B,T,D>& lhs, const A& rhs) {
146  typedef BinaryOpCopyR<AddOp<T>, VecExpr<B,T,D>, Constant<A>, T> AddOpBinOp;
147
149 }
150
151 //==============================================================================
152 // operator+ (SVector, binary, Constant)
153 //==============================================================================
154 template <class A, class B, class T, unsigned int D>
155 inline VecExpr<BinaryOpCopyL<AddOp<T>, Constant<A>, VecExpr<B,T,D>, T>, T, D>
156  operator+(const A& lhs, const VecExpr<B,T,D>& rhs) {
157  typedef BinaryOpCopyL<AddOp<T>, Constant<A>, VecExpr<B,T,D>, T> AddOpBinOp;
158
160 }
161
162
163 /**
164  Addition of two matrices C = A+B
165  returning a matrix expression
166
167  @ingroup MatrixFunctions
168 */
169 //==============================================================================
170 // operator+ (SMatrix, binary)
171 //==============================================================================
172 template < class T, unsigned int D, unsigned int D2, class R1, class R2>
174  operator+(const SMatrix<T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
175  typedef BinaryOp<AddOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> AddOpBinOp;
176
178 }
179
180
181 //==============================================================================
182 // operator+ (SMatrix, binary)
183 //==============================================================================
184 template <class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
185 inline Expr<BinaryOp<AddOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
186  operator+(const Expr<A,T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
187  typedef BinaryOp<AddOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> AddOpBinOp;
188
190 }
191
192
193 //==============================================================================
194 // operator+ (SMatrix, binary)
195 //==============================================================================
196 template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
197 inline Expr<BinaryOp<AddOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T>, T, D, D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>
198  operator+(const SMatrix<T,D,D2,R1>& lhs, const Expr<A,T,D,D2,R2>& rhs) {
199  typedef BinaryOp<AddOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T> AddOpBinOp;
200
202 }
203
204
205 //==============================================================================
206 // operator+ (SMatrix, binary)
207 //==============================================================================
208 template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
209 inline Expr<BinaryOp<AddOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType >
210  operator+(const Expr<A,T,D,D2,R1>& lhs, const Expr<B,T,D,D2,R2>& rhs) {
211  typedef BinaryOp<AddOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T> AddOpBinOp;
212
214 }
215
216
217 /**
218  Addition element by element of matrix and a scalar C(i,j) = A(i,j) + s
219  returning a matrix expression
220
221  @ingroup MatrixFunctions
222 */
223 //=============================================================================
224 // operator+ (SMatrix, binary, Constant)
225 //=============================================================================
226 template <class A, class T, unsigned int D, unsigned int D2, class R>
227 inline Expr<BinaryOpCopyR<AddOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
228  operator+(const SMatrix<T,D,D2,R>& lhs, const A& rhs) {
229  typedef BinaryOpCopyR<AddOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T> AddOpBinOp;
230
232 }
233
234 /**
235  Addition element by element of matrix and a scalar C(i,j) = s + A(i,j)
236  returning a matrix expression
237
238  @ingroup MatrixFunctions
239 */
240 //==============================================================================
241 // operator+ (SMatrix, binary, Constant)
242 //==============================================================================
243 template <class A, class T, unsigned int D, unsigned int D2, class R>
244 inline Expr<BinaryOpCopyL<AddOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
245  operator+(const A& lhs, const SMatrix<T,D,D2,R>& rhs) {
246  typedef BinaryOpCopyL<AddOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T> AddOpBinOp;
247
249  Constant<A>(lhs),rhs));
250 }
251
252
253 //==============================================================================
254 // operator+ (SMatrix, binary, Constant)
255 //==============================================================================
256 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
257 inline Expr<BinaryOpCopyR<AddOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
258  operator+(const Expr<B,T,D,D2,R>& lhs, const A& rhs) {
259  typedef BinaryOpCopyR<AddOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T> AddOpBinOp;
260
262  lhs,Constant<A>(rhs)));
263 }
264
265 //==============================================================================
266 // operator+ (SMatrix, binary, Constant)
267 //==============================================================================
268 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
269 inline Expr<BinaryOpCopyL<AddOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T>, T, D, D2, R>
270  operator+(const A& lhs, const Expr<B,T,D,D2,R>& rhs) {
271  typedef BinaryOpCopyL<AddOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T> AddOpBinOp;
272
274  Constant<A>(lhs),rhs));
275 }
276
277
278 //==============================================================================
279 // MinOp
280 //==============================================================================
281 /**
282  Subtraction Operation Class
283
284  @ingroup Expression
285  */
286 template <class T>
287 class MinOp {
288 public:
289  static inline T apply(const T& lhs, const T& rhs) {
290  return lhs - rhs;
291  }
292 };
293
294
295 /**
296  Vector Subtraction: v3 = v1 - v2
297  returning a vector expression
298
299  @ingroup VectFunction
300 */
301 //==============================================================================
302 // operator- (SVector, binary)
303 //==============================================================================
304 template < class T, unsigned int D>
305 inline VecExpr<BinaryOp<MinOp<T>, SVector<T,D>, SVector<T,D>, T>, T, D>
306  operator-(const SVector<T,D>& lhs, const SVector<T,D>& rhs) {
307  typedef BinaryOp<MinOp<T>, SVector<T,D>, SVector<T,D>, T> MinOpBinOp;
308
309  return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,rhs));
310 }
311
312
313 //==============================================================================
314 // operator- (SVector, binary)
315 //==============================================================================
316 template <class A, class T, unsigned int D>
317 inline VecExpr<BinaryOp<MinOp<T>, VecExpr<A,T,D>, SVector<T,D>, T>, T, D>
318  operator-(const VecExpr<A,T,D>& lhs, const SVector<T,D>& rhs) {
319  typedef BinaryOp<MinOp<T>, VecExpr<A,T,D>, SVector<T,D>, T> MinOpBinOp;
320
321  return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,rhs));
322 }
323
324
325 //==============================================================================
326 // operator- (SVector, binary)
327 //==============================================================================
328 template < class A, class T, unsigned int D>
329 inline VecExpr<BinaryOp<MinOp<T>, SVector<T,D>, VecExpr<A,T,D>, T>, T, D>
330  operator-(const SVector<T,D>& lhs, const VecExpr<A,T,D>& rhs) {
331  typedef BinaryOp<MinOp<T>, SVector<T,D>, VecExpr<A,T,D>, T> MinOpBinOp;
332
333  return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,rhs));
334 }
335
336
337 //==============================================================================
338 // operator- (SVector, binary)
339 //==============================================================================
340 template <class A, class B, class T, unsigned int D>
341 inline VecExpr<BinaryOp<MinOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T>, T, D>
342  operator-(const VecExpr<A,T,D>& lhs, const VecExpr<B,T,D>& rhs) {
343  typedef BinaryOp<MinOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T> MinOpBinOp;
344
345  return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,rhs));
346 }
347
348
349 /**
350  Subtraction of a scalar from each vector element: v2(i) = v1(i) - a
351  returning a vector expression
352
353  @ingroup VectFunction
354 */
355 //==============================================================================
356 // operator- (SVector, binary, Constant)
357 //==============================================================================
358 template <class A, class T, unsigned int D>
359 inline VecExpr<BinaryOpCopyR<MinOp<T>, SVector<T,D>, Constant<A>, T>, T, D>
360  operator-(const SVector<T,D>& lhs, const A& rhs) {
361  typedef BinaryOpCopyR<MinOp<T>, SVector<T,D>, Constant<A>, T> MinOpBinOp;
362
363  return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,Constant<A>(rhs)));
364 }
365
366 /**
367  Subtraction scalar vector (for each vector element) v2(i) = a - v1(i)
368  returning a vector expression
369
370  @ingroup VectFunction
371 */
372 //==============================================================================
373 // operator- (SVector, binary, Constant)
374 //==============================================================================
375 template <class A, class T, unsigned int D>
376 inline VecExpr<BinaryOpCopyL<MinOp<T>, Constant<A>, SVector<T,D>, T>, T, D>
377  operator-(const A& lhs, const SVector<T,D>& rhs) {
378  typedef BinaryOpCopyL<MinOp<T>, Constant<A>, SVector<T,D>, T> MinOpBinOp;
379
380  return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),Constant<A>(lhs),rhs));
381 }
382
383
384 //==============================================================================
385 // operator- (SVector, binary, Constant)
386 //==============================================================================
387 template <class A, class B, class T, unsigned int D>
388 inline VecExpr<BinaryOpCopyR<MinOp<T>, VecExpr<B,T,D>, Constant<A>, T>, T, D>
389  operator-(const VecExpr<B,T,D>& lhs, const A& rhs) {
390  typedef BinaryOpCopyR<MinOp<T>, VecExpr<B,T,D>, Constant<A>, T> MinOpBinOp;
391
392  return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,Constant<A>(rhs)));
393 }
394
395 //==============================================================================
396 // operator- (SVector, binary, Constant)
397 //==============================================================================
398 template <class A, class B, class T, unsigned int D>
399 inline VecExpr<BinaryOpCopyL<MinOp<T>, Constant<A>, VecExpr<B,T,D>, T>, T, D>
400  operator-(const A& lhs, const VecExpr<B,T,D>& rhs) {
401  typedef BinaryOpCopyL<MinOp<T>, Constant<A>, VecExpr<B,T,D>, T> MinOpBinOp;
402
403  return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),Constant<A>(lhs),rhs));
404 }
405
406
407 /**
408  Subtraction of two matrices C = A-B
409  returning a matrix expression
410
411  @ingroup MatrixFunctions
412 */
413 //==============================================================================
414 // operator- (SMatrix, binary)
415 //==============================================================================
416 template < class T, unsigned int D, unsigned int D2, class R1, class R2>
417 inline Expr<BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
418  operator-(const SMatrix<T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
419  typedef BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> MinOpBinOp;
420
422 }
423
424
425 //==============================================================================
426 // operator- (SMatrix, binary)
427 //==============================================================================
428 template <class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
429 inline Expr<BinaryOp<MinOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>
430  operator-(const Expr<A,T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
431  typedef BinaryOp<MinOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> MinOpBinOp;
432
434 }
435
436
437 //==============================================================================
438 // operator- (SMatrix, binary)
439 //==============================================================================
440 template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
441 inline Expr<BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
442  operator-(const SMatrix<T,D,D2,R1>& lhs, const Expr<A,T,D,D2,R2>& rhs) {
443  typedef BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T> MinOpBinOp;
444
446 }
447
448
449 //==============================================================================
450 // operator- (SMatrix, binary)
451 //==============================================================================
452 template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
453 inline Expr<BinaryOp<MinOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T>, T, D, D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>
454  operator-(const Expr<A,T,D,D2,R1>& lhs, const Expr<B,T,D,D2,R2>& rhs) {
455  typedef BinaryOp<MinOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T> MinOpBinOp;
456
458 }
459
460
461 /**
462  Subtraction of a scalar and a matrix (element wise) B(i,j) = A(i,j) - s
463  returning a matrix expression
464
465  @ingroup MatrixFunctions
466 */
467 //==============================================================================
468 // operator- (SMatrix, binary, Constant)
469 //==============================================================================
470 template <class A, class T, unsigned int D, unsigned int D2, class R>
471 inline Expr<BinaryOpCopyR<MinOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
472  operator-(const SMatrix<T,D,D2,R>& lhs, const A& rhs) {
473  typedef BinaryOpCopyR<MinOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T> MinOpBinOp;
474
475  return Expr<MinOpBinOp,T,D,D2,R>(MinOpBinOp(MinOp<T>(),
476  lhs,Constant<A>(rhs)));
477 }
478
479 /**
480  Subtraction of a scalar and a matrix (element wise) B(i,j) = s - A(i,j)
481  returning a matrix expression
482
483  @ingroup MatrixFunctions
484 */
485 //==============================================================================
486 // operator- (SMatrix, binary, Constant)
487 //==============================================================================
488 template <class A, class T, unsigned int D, unsigned int D2, class R>
489 inline Expr<BinaryOpCopyL<MinOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
490  operator-(const A& lhs, const SMatrix<T,D,D2,R>& rhs) {
491  typedef BinaryOpCopyL<MinOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T> MinOpBinOp;
492
493  return Expr<MinOpBinOp,T,D,D2,R>(MinOpBinOp(MinOp<T>(),Constant<A>(lhs),rhs));
494 }
495
496 //==============================================================================
497 // operator- (SMatrix, binary, Constant)
498 //==============================================================================
499 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
500 inline Expr<BinaryOpCopyR<MinOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
501  operator-(const Expr<B,T,D,D2,R>& lhs, const A& rhs) {
502  typedef BinaryOpCopyR<MinOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T> MinOpBinOp;
503
504  return Expr<MinOpBinOp,T,D,D2,R>(MinOpBinOp(MinOp<T>(),lhs,Constant<A>(rhs)));
505 }
506
507 //==============================================================================
508 // operator- (SMatrix, binary, Constant)
509 //==============================================================================
510 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
511 inline Expr<BinaryOpCopyL<MinOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T>, T, D, D2, R>
512  operator-(const A& lhs, const Expr<B,T,D,D2,R>& rhs) {
513  typedef BinaryOpCopyL<MinOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T> MinOpBinOp;
514
515  return Expr<MinOpBinOp,T,D,D2,R>(MinOpBinOp(MinOp<T>(),
516  Constant<A>(lhs),rhs));
517 }
518
519
520 /**
521  Multiplication (element-wise) Operation Class
522
523  @ingroup Expression
524  */
525 //==============================================================================
526 // MulOp
527 //==============================================================================
528 template <class T>
529 class MulOp {
530 public:
531  static inline T apply(const T& lhs, const T& rhs) {
532  return lhs * rhs;
533  }
534 };
535
536 /**
537  Element by element vector product v3(i) = v1(i)*v2(i)
538  returning a vector expression.
539  Note this is NOT the Dot, Cross or Tensor product.
540
541  @ingroup VectFunction
542 */
543 //==============================================================================
544 // operator* (SVector, binary)
545 //==============================================================================
546 template < class T, unsigned int D>
547 inline VecExpr<BinaryOp<MulOp<T>, SVector<T,D>, SVector<T,D>, T>, T, D>
548  operator*(const SVector<T,D>& lhs, const SVector<T,D>& rhs) {
549  typedef BinaryOp<MulOp<T>, SVector<T,D>, SVector<T,D>, T> MulOpBinOp;
550
551  return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
552 }
553
554
555 //==============================================================================
556 // operator* (SVector, binary)
557 //==============================================================================
558 // template <class A, class T, unsigned int D, class R>
559 // inline VecExpr<BinaryOp<MulOp<T>, VecExpr<A,T,D>, SVector<T,D>, T>, T, D>
560 // operator*(const VecExpr<A,T,D,1,R>& lhs, const SVector<T,D>& rhs) {
561 // typedef BinaryOp<MulOp<T>, VecExpr<A,T,D,1,R>, SVector<T,D>, T> MulOpBinOp;
562 // return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
563 // }
564 template <class A, class T, unsigned int D>
565 inline VecExpr<BinaryOp<MulOp<T>, Expr<A,T,D>, SVector<T,D>, T>, T, D>
566  operator*(const VecExpr<A,T,D>& lhs, const SVector<T,D>& rhs) {
567  typedef BinaryOp<MulOp<T>, VecExpr<A,T,D>, SVector<T,D>, T> MulOpBinOp;
568  return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
569 }
570
571
572 //==============================================================================
573 // operator* (SVector, binary)
574 //==============================================================================
575 template < class A, class T, unsigned int D>
576 inline VecExpr<BinaryOp<MulOp<T>, SVector<T,D>, VecExpr<A,T,D>, T>, T, D>
577  operator*(const SVector<T,D>& lhs, const VecExpr<A,T,D>& rhs) {
578  typedef BinaryOp<MulOp<T>, SVector<T,D>, VecExpr<A,T,D>, T> MulOpBinOp;
579  return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
580 }
581
582
583 //==============================================================================
584 // operator* (SVector, binary)
585 //==============================================================================
586 template <class A, class B, class T, unsigned int D>
587 inline VecExpr<BinaryOp<MulOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T>, T, D>
588  operator*(const VecExpr<A,T,D>& lhs, const VecExpr<B,T,D>& rhs) {
589  typedef BinaryOp<MulOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T> MulOpBinOp;
590  return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
591 }
592
593
594 //==============================================================================
595 // operator* (SVector, binary, Constant)
596 //==============================================================================
597 template <class A, class T, unsigned int D>
598 inline VecExpr<BinaryOpCopyR<MulOp<T>, SVector<T,D>, Constant<A>, T>, T, D>
599  operator*(const SVector<T,D>& lhs, const A& rhs) {
600  typedef BinaryOpCopyR<MulOp<T>, SVector<T,D>, Constant<A>, T> MulOpBinOp;
601
602  return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,Constant<A>(rhs)));
603 }
604
605 //==============================================================================
606 // operator* (SVector, binary, Constant)
607 //==============================================================================
608 template <class A, class T, unsigned int D>
609 inline VecExpr<BinaryOpCopyL<MulOp<T>, Constant<A>, SVector<T,D>, T>, T, D>
610  operator*(const A& lhs, const SVector<T,D>& rhs) {
611  typedef BinaryOpCopyL<MulOp<T>, Constant<A>, SVector<T,D>, T> MulOpBinOp;
612
613  return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),Constant<A>(lhs),rhs));
614 }
615
616
617 //==============================================================================
618 // operator* (SVector, binary, Constant)
619 //==============================================================================
620 template <class A, class B, class T, unsigned int D>
621 inline VecExpr<BinaryOpCopyR<MulOp<T>, VecExpr<B,T,D>, Constant<A>, T>, T, D>
622  operator*(const VecExpr<B,T,D>& lhs, const A& rhs) {
623  typedef BinaryOpCopyR<MulOp<T>, VecExpr<B,T,D>, Constant<A>, T> MulOpBinOp;
624
625  return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,Constant<A>(rhs)));
626 }
627
628 //==============================================================================
629 // operator* (SVector, binary, Constant)
630 //==============================================================================
631 template <class A, class B, class T, unsigned int D>
632 inline VecExpr<BinaryOpCopyL<MulOp<T>, Constant<A>, VecExpr<B,T,D>, T>, T, D>
633  operator*(const A& lhs, const VecExpr<B,T,D>& rhs) {
634  typedef BinaryOpCopyL<MulOp<T>, Constant<A>, VecExpr<B,T,D>, T> MulOpBinOp;
635
636  return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),Constant<A>(lhs),rhs));
637 }
638
639 /**
640  Element by element matrix multiplication C(i,j) = A(i,j)*B(i,j)
641  returning a matrix expression. This is not a matrix-matrix multiplication and works only
642  for matrices of the same dimensions.
643
644  @ingroup MatrixFunctions
645 */
646 // Times: Function for element - wise multiplication
647 //==============================================================================
648 // Times (SMatrix, binary)
649 //==============================================================================
650 template < class T, unsigned int D, unsigned int D2, class R1, class R2>
651 inline Expr<BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
652  Times(const SMatrix<T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
653  typedef BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> MulOpBinOp;
654
656 }
657
658
659 //==============================================================================
660 // Times (SMatrix, binary)
661 //==============================================================================
662 template <class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
663 inline Expr<BinaryOp<MulOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
664  Times(const Expr<A,T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
665  typedef BinaryOp<MulOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> MulOpBinOp;
666
668 }
669
670
671 //==============================================================================
672 // Times (SMatrix, binary)
673 //==============================================================================
674 template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
675 inline Expr<BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
676  Times(const SMatrix<T,D,D2,R1>& lhs, const Expr<A,T,D,D2,R2>& rhs) {
677  typedef BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T> MulOpBinOp;
678
680 }
681
682
683 //==============================================================================
684 // Times (SMatrix, binary)
685 //==============================================================================
686 template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
687 inline Expr<BinaryOp<MulOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
688  Times(const Expr<A,T,D,D2,R1>& lhs, const Expr<B,T,D,D2,R2>& rhs) {
689  typedef BinaryOp<MulOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T> MulOpBinOp;
690
692 }
693
694
695 /**
696  Multiplication (element wise) of a matrix and a scalar, B(i,j) = A(i,j) * s
697  returning a matrix expression
698
699  @ingroup MatrixFunctions
700 */
701 //=============================================================================
702 // operator* (SMatrix, binary, Constant)
703 //=============================================================================
704 template <class A, class T, unsigned int D, unsigned int D2, class R>
705 inline Expr<BinaryOpCopyR<MulOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
706  operator*(const SMatrix<T,D,D2,R>& lhs, const A& rhs) {
707  typedef BinaryOpCopyR<MulOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T> MulOpBinOp;
708
709  return Expr<MulOpBinOp,T,D,D2,R>(MulOpBinOp(MulOp<T>(),
710  lhs,Constant<A>(rhs)));
711 }
712
713 /**
714  Multiplication (element wise) of a matrix and a scalar, B(i,j) = s * A(i,j)
715  returning a matrix expression
716
717  @ingroup MatrixFunctions
718 */
719 //=============================================================================
720 // operator* (SMatrix, binary, Constant)
721 //=============================================================================
722 template <class A, class T, unsigned int D, unsigned int D2, class R>
723 inline Expr<BinaryOpCopyL<MulOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
724  operator*(const A& lhs, const SMatrix<T,D,D2,R>& rhs) {
725  typedef BinaryOpCopyL<MulOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T> MulOpBinOp;
726
727  return Expr<MulOpBinOp,T,D,D2,R>(MulOpBinOp(MulOp<T>(),
728  Constant<A>(lhs),rhs));
729 }
730
731
732 //==============================================================================
733 // operator* (SMatrix, binary, Constant)
734 //==============================================================================
735 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
736 inline Expr<BinaryOpCopyR<MulOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
737  operator*(const Expr<B,T,D,D2,R>& lhs, const A& rhs) {
738  typedef BinaryOpCopyR<MulOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T> MulOpBinOp;
739
740  return Expr<MulOpBinOp,T,D,D2,R>(MulOpBinOp(MulOp<T>(),
741  lhs,Constant<A>(rhs)));
742 }
743
744 //==============================================================================
745 // operator* (SMatrix, binary, Constant)
746 //==============================================================================
747 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
748 inline Expr<BinaryOpCopyL<MulOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T>, T, D, D2, R>
749  operator*(const A& lhs, const Expr<B,T,D,D2,R>& rhs) {
750  typedef BinaryOpCopyL<MulOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T> MulOpBinOp;
751
752  return Expr<MulOpBinOp,T,D,D2,R>(MulOpBinOp(MulOp<T>(),
753  Constant<A>(lhs),rhs));
754 }
755
756
757 //=============================================================================
758 // DivOp
759 //=============================================================================
760 /**
761  Division (element-wise) Operation Class
762
763  @ingroup Expression
764  */
765 template <class T>
766 class DivOp {
767 public:
768  static inline T apply(const T& lhs, const T& rhs) {
769  return lhs / rhs;
770  }
771 };
772
773 /**
774  Element by element division of vectors of the same dimension: v3(i) = v1(i)/v2(i)
775  returning a vector expression
776
777  @ingroup VectFunction
778  */
779 //==============================================================================
780 // operator/ (SVector, binary)
781 //==============================================================================
782 template < class T, unsigned int D>
783 inline VecExpr<BinaryOp<DivOp<T>, SVector<T,D>, SVector<T,D>, T>, T, D>
784  operator/(const SVector<T,D>& lhs, const SVector<T,D>& rhs) {
785  typedef BinaryOp<DivOp<T>, SVector<T,D>, SVector<T,D>, T> DivOpBinOp;
786
787  return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,rhs));
788 }
789
790
791 //==============================================================================
792 // operator/ (SVector, binary)
793 //==============================================================================
794 template <class A, class T, unsigned int D>
795 inline VecExpr<BinaryOp<DivOp<T>, VecExpr<A,T,D>, SVector<T,D>, T>, T, D>
796  operator/(const VecExpr<A,T,D>& lhs, const SVector<T,D>& rhs) {
797  typedef BinaryOp<DivOp<T>, VecExpr<A,T,D>, SVector<T,D>, T> DivOpBinOp;
798  return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,rhs));
799 }
800
801
802 //==============================================================================
803 // operator/ (SVector, binary)
804 //==============================================================================
805 template < class A, class T, unsigned int D>
806 inline VecExpr<BinaryOp<DivOp<T>, SVector<T,D>, VecExpr<A,T,D>, T>, T, D>
807  operator/(const SVector<T,D>& lhs, const VecExpr<A,T,D>& rhs) {
808  typedef BinaryOp<DivOp<T>, SVector<T,D>, VecExpr<A,T,D>, T> DivOpBinOp;
809
810  return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,rhs));
811 }
812
813
814 //=============================================================================
815 // operator/ (SVector, binary)
816 //=============================================================================
817 template <class A, class B, class T, unsigned int D>
818 inline VecExpr<BinaryOp<DivOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T>, T, D>
819  operator/(const VecExpr<A,T,D>& lhs, const VecExpr<B,T,D>& rhs) {
820  typedef BinaryOp<DivOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T> DivOpBinOp;
821
822  return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,rhs));
823 }
824
825
826 /**
827  Division of the vector element by a scalar value: v2(i) = v1(i)/a
828  returning a vector expression
829
830  @ingroup VectFunction
831 */
832 //==============================================================================
833 // operator/ (SVector, binary, Constant)
834 //==============================================================================
835 template <class A, class T, unsigned int D>
836 inline VecExpr<BinaryOpCopyR<DivOp<T>, SVector<T,D>, Constant<A>, T>, T, D>
837  operator/(const SVector<T,D>& lhs, const A& rhs) {
838  typedef BinaryOpCopyR<DivOp<T>, SVector<T,D>, Constant<A>, T> DivOpBinOp;
839
840  return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,Constant<A>(rhs)));
841 }
842
843 /**
844  Division of a scalar value by the vector element: v2(i) = a/v1(i)
845  returning a vector expression
846
847  @ingroup VectFunction
848 */
849 //==============================================================================
850 // operator/ (SVector, binary, Constant)
851 //==============================================================================
852 template <class A, class T, unsigned int D>
853 inline VecExpr<BinaryOpCopyL<DivOp<T>, Constant<A>, SVector<T,D>, T>, T, D>
854  operator/(const A& lhs, const SVector<T,D>& rhs) {
855  typedef BinaryOpCopyL<DivOp<T>, Constant<A>, SVector<T,D>, T> DivOpBinOp;
856
857  return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),Constant<A>(lhs),rhs));
858 }
859
860
861 //==============================================================================
862 // operator/ (SVector, binary, Constant)
863 //==============================================================================
864 template <class A, class B, class T, unsigned int D>
865 inline VecExpr<BinaryOpCopyR<DivOp<T>, VecExpr<B,T,D>, Constant<A>, T>, T, D>
866  operator/(const VecExpr<B,T,D>& lhs, const A& rhs) {
867  typedef BinaryOpCopyR<DivOp<T>, VecExpr<B,T,D>, Constant<A>, T> DivOpBinOp;
868
869  return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,Constant<A>(rhs)));
870 }
871
872 //==============================================================================
873 // operator/ (SVector, binary, Constant)
874 //==============================================================================
875 template <class A, class B, class T, unsigned int D>
876 inline VecExpr<BinaryOpCopyL<DivOp<T>, Constant<A>, VecExpr<B,T,D>, T>, T, D>
877  operator/(const A& lhs, const VecExpr<B,T,D>& rhs) {
878  typedef BinaryOpCopyL<DivOp<T>, Constant<A>, VecExpr<B,T,D>, T> DivOpBinOp;
879
880  return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),Constant<A>(lhs),rhs));
881 }
882
883
884 /**
885  Division (element wise) of two matrices of the same dimensions: C(i,j) = A(i,j) / B(i,j)
886  returning a matrix expression
887
888  @ingroup MatrixFunctions
889 */
890 //==============================================================================
891 // Div (SMatrix, binary)
892 //==============================================================================
893 template < class T, unsigned int D, unsigned int D2, class R1, class R2>
894 inline Expr<BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
895  Div(const SMatrix<T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
896  typedef BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> DivOpBinOp;
897
899 }
900
901
902 //==============================================================================
903 // Div (SMatrix, binary)
904 //==============================================================================
905 template <class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
906 inline Expr<BinaryOp<DivOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
907  Div(const Expr<A,T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
908  typedef BinaryOp<DivOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> DivOpBinOp;
909
911 }
912
913
914 //==============================================================================
915 // Div (SMatrix, binary)
916 //==============================================================================
917 template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
918 inline Expr<BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
919  Div(const SMatrix<T,D,D2,R1>& lhs, const Expr<A,T,D,D2,R2>& rhs) {
920  typedef BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T> DivOpBinOp;
921
923 }
924
925
926 //==============================================================================
927 // Div (SMatrix, binary)
928 //==============================================================================
929 template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
930 inline Expr<BinaryOp<DivOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T>, T, D, D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>
931  Div(const Expr<A,T,D,D2,R1>& lhs, const Expr<B,T,D,D2,R2>& rhs) {
932  typedef BinaryOp<DivOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T> DivOpBinOp;
933
935 }
936
937
938 /**
939  Division (element wise) of a matrix and a scalar, B(i,j) = A(i,j) / s
940  returning a matrix expression
941
942  @ingroup MatrixFunctions
943 */
944 //=============================================================================
945 // operator/ (SMatrix, binary, Constant)
946 //=============================================================================
947 template <class A, class T, unsigned int D, unsigned int D2, class R>
948 inline Expr<BinaryOpCopyR<DivOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
949  operator/(const SMatrix<T,D,D2,R>& lhs, const A& rhs) {
950  typedef BinaryOpCopyR<DivOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T> DivOpBinOp;
951
952  return Expr<DivOpBinOp,T,D,D2,R>(DivOpBinOp(DivOp<T>(),
953  lhs,Constant<A>(rhs)));
954 }
955
956 /**
957  Division (element wise) of a matrix and a scalar, B(i,j) = s / A(i,j)
958  returning a matrix expression
959
960  @ingroup MatrixFunctions
961 */
962 //==============================================================================
963 // operator/ (SMatrix, binary, Constant)
964 //==============================================================================
965 template <class A, class T, unsigned int D, unsigned int D2, class R>
966 inline Expr<BinaryOpCopyL<DivOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
967  operator/(const A& lhs, const SMatrix<T,D,D2,R>& rhs) {
968  typedef BinaryOpCopyL<DivOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T> DivOpBinOp;
969
970  return Expr<DivOpBinOp,T,D,D2,R>(DivOpBinOp(DivOp<T>(),
971  Constant<A>(lhs),rhs));
972 }
973
974
975 //==============================================================================
976 // operator/ (SMatrix, binary, Constant)
977 //==============================================================================
978 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
979 inline Expr<BinaryOpCopyR<DivOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
980  operator/(const Expr<B,T,D,D2,R>& lhs, const A& rhs) {
981  typedef BinaryOpCopyR<DivOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T> DivOpBinOp;
982
983  return Expr<DivOpBinOp,T,D,D2,R>(DivOpBinOp(DivOp<T>(),
984  lhs,Constant<A>(rhs)));
985 }
986
987 //==============================================================================
988 // operator/ (SMatrix, binary, Constant)
989 //==============================================================================
990 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
991 inline Expr<BinaryOpCopyL<DivOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T>, T, D, D2,R>
992  operator/(const A& lhs, const Expr<B,T,D,D2,R>& rhs) {
993  typedef BinaryOpCopyL<DivOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T> DivOpBinOp;
994
995  return Expr<DivOpBinOp,T,D,D2,R>(DivOpBinOp(DivOp<T>(),Constant<A>(lhs),rhs));
996 }
997
998
999
1000  } // namespace Math
1001
1002 } // namespace ROOT
1003
1004
1005 #endif /*ROOT_Math_BinaryOperators */
Constant expression class A class representing constant expressions (literals) in the parse tree...
Definition: Expression.h:400
Multiplication (element-wise) Operation Class.
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Division (element-wise) Operation Class.
double T(double x)
Definition: ChebyshevPol.h:34
Binary Operation class with value storage for the left argument.
Definition: Expression.h:277
Expr< BinaryOp< MulOp< T >, SMatrix< T, D, D2, R1 >, SMatrix< T, D, D2, R2 >, T >, T, D, D2, typename AddPolicy< T, D, D2, R1, R2 >::RepType > Times(const SMatrix< T, D, D2, R1 > &lhs, const SMatrix< T, D, D2, R2 > &rhs)
Element by element matrix multiplication C(i,j) = A(i,j)*B(i,j) returning a matrix expression...
Subtraction Operation Class.
static double A[]
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.
static T apply(const T &lhs, const T &rhs)
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
SMatrix: a generic fixed size D1 x D2 Matrix class.
Expression wrapper class for Matrix objects.
Definition: Expression.h:134
Binary Operation class with value storage for the right argument.
Definition: Expression.h:318
static T apply(const T &lhs, const T &rhs)
BinaryOperation class A class representing binary operators in the parse tree.
Definition: Expression.h:234
static T apply(const T &lhs, const T &rhs)
VecExpr< BinaryOp< DivOp< T >, SVector< T, D >, SVector< T, D >, T >, T, D > operator/(const SVector< T, D > &lhs, const SVector< T, D > &rhs)
Element by element division of vectors of the same dimension: v3(i) = v1(i)/v2(i) returning a vector ...
Expr< BinaryOp< DivOp< T >, SMatrix< T, D, D2, R1 >, SMatrix< T, D, D2, R2 >, T >, T, D, D2, typename AddPolicy< T, D, D2, R1, R2 >::RepType > Div(const SMatrix< T, D, D2, R1 > &lhs, const SMatrix< T, D, D2, R2 > &rhs)
Division (element wise) of two matrices of the same dimensions: C(i,j) = A(i,j) / B(i...
static T apply(const T &lhs, const T &rhs)
Namespace for new Math classes and functions.
Expression wrapper class for Vector objects.
Definition: Expression.h:64
TRandom3 R
a TMatrixD.
Definition: testIO.cxx:28
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
SVector: a generic fixed size Vector class.