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