Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
24namespace ROOT {
25
26 namespace Math {
27
28
29
30template <class T, unsigned int D> class SVector;
31template <class T, unsigned int D1, unsigned int D2, class R> class SMatrix;
32
33
34//==============================================================================
35// AddOp
36//==============================================================================
37/**
38 Addition Operation Class
39
40 @ingroup Expression
41 */
42template <class T>
43class AddOp {
44public:
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//==============================================================================
60template < class T, unsigned int D>
67
68
69//==============================================================================
70// operator+ (SVector, binary)
71//==============================================================================
72template <class A, class T, unsigned int D>
79
80
81//==============================================================================
82// operator+ (SVector, binary)
83//==============================================================================
84template < class A, class T, unsigned int D>
91
92
93//==============================================================================
94// operator+ (SVector, binary)
95//==============================================================================
96template <class A, class B, class T, unsigned int D>
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//==============================================================================
114template <class A, class T, unsigned int D>
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//==============================================================================
131template <class A, class T, unsigned int D>
138
139
140//==============================================================================
141// operator+ (SVector, binary, Constant)
142//==============================================================================
143template <class A, class B, class T, unsigned int D>
150
151//==============================================================================
152// operator+ (SVector, binary, Constant)
153//==============================================================================
154template <class A, class B, class T, unsigned int D>
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//==============================================================================
172template < class T, unsigned int D, unsigned int D2, class R1, class R2>
179
180
181//==============================================================================
182// operator+ (SMatrix, binary)
183//==============================================================================
184template <class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
191
192
193//==============================================================================
194// operator+ (SMatrix, binary)
195//==============================================================================
196template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
203
204
205//==============================================================================
206// operator+ (SMatrix, binary)
207//==============================================================================
208template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
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//=============================================================================
226template <class A, class T, unsigned int D, unsigned int D2, class R>
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//==============================================================================
243template <class A, class T, unsigned int D, unsigned int D2, class R>
251
252
253//==============================================================================
254// operator+ (SMatrix, binary, Constant)
255//==============================================================================
256template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
264
265//==============================================================================
266// operator+ (SMatrix, binary, Constant)
267//==============================================================================
268template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
276
277
278//==============================================================================
279// MinOp
280//==============================================================================
281/**
282 Subtraction Operation Class
283
284 @ingroup Expression
285 */
286template <class T>
287class MinOp {
288public:
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//==============================================================================
304template < class T, unsigned int D>
311
312
313//==============================================================================
314// operator- (SVector, binary)
315//==============================================================================
316template <class A, class T, unsigned int D>
323
324
325//==============================================================================
326// operator- (SVector, binary)
327//==============================================================================
328template < class A, class T, unsigned int D>
335
336
337//==============================================================================
338// operator- (SVector, binary)
339//==============================================================================
340template <class A, class B, class T, unsigned int D>
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//==============================================================================
358template <class A, class T, unsigned int D>
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//==============================================================================
375template <class A, class T, unsigned int D>
382
383
384//==============================================================================
385// operator- (SVector, binary, Constant)
386//==============================================================================
387template <class A, class B, class T, unsigned int D>
394
395//==============================================================================
396// operator- (SVector, binary, Constant)
397//==============================================================================
398template <class A, class B, class T, unsigned int D>
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//==============================================================================
416template < class T, unsigned int D, unsigned int D2, class R1, class R2>
423
424
425//==============================================================================
426// operator- (SMatrix, binary)
427//==============================================================================
428template <class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
435
436
437//==============================================================================
438// operator- (SMatrix, binary)
439//==============================================================================
440template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
447
448
449//==============================================================================
450// operator- (SMatrix, binary)
451//==============================================================================
452template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
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//==============================================================================
470template <class A, class T, unsigned int D, unsigned int D2, class R>
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//==============================================================================
488template <class A, class T, unsigned int D, unsigned int D2, class R>
495
496//==============================================================================
497// operator- (SMatrix, binary, Constant)
498//==============================================================================
499template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
506
507//==============================================================================
508// operator- (SMatrix, binary, Constant)
509//==============================================================================
510template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
518
519
520/**
521 Multiplication (element-wise) Operation Class
522
523 @ingroup Expression
524 */
525//==============================================================================
526// MulOp
527//==============================================================================
528template <class T>
529class MulOp {
530public:
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//==============================================================================
546template < class T, unsigned int D>
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// }
564template <class A, class T, unsigned int D>
570
571
572//==============================================================================
573// operator* (SVector, binary)
574//==============================================================================
575template < class A, class T, unsigned int D>
581
582
583//==============================================================================
584// operator* (SVector, binary)
585//==============================================================================
586template <class A, class B, class T, unsigned int D>
592
593
594//==============================================================================
595// operator* (SVector, binary, Constant)
596//==============================================================================
597template <class A, class T, unsigned int D>
604
605//==============================================================================
606// operator* (SVector, binary, Constant)
607//==============================================================================
608template <class A, class T, unsigned int D>
615
616
617//==============================================================================
618// operator* (SVector, binary, Constant)
619//==============================================================================
620template <class A, class B, class T, unsigned int D>
627
628//==============================================================================
629// operator* (SVector, binary, Constant)
630//==============================================================================
631template <class A, class B, class T, unsigned int D>
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//==============================================================================
650template < class T, unsigned int D, unsigned int D2, class R1, class R2>
657
658
659//==============================================================================
660// Times (SMatrix, binary)
661//==============================================================================
662template <class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
669
670
671//==============================================================================
672// Times (SMatrix, binary)
673//==============================================================================
674template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
681
682
683//==============================================================================
684// Times (SMatrix, binary)
685//==============================================================================
686template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
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//=============================================================================
704template <class A, class T, unsigned int D, unsigned int D2, class R>
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//=============================================================================
722template <class A, class T, unsigned int D, unsigned int D2, class R>
730
731
732//==============================================================================
733// operator* (SMatrix, binary, Constant)
734//==============================================================================
735template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
743
744//==============================================================================
745// operator* (SMatrix, binary, Constant)
746//==============================================================================
747template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
755
756
757//=============================================================================
758// DivOp
759//=============================================================================
760/**
761 Division (element-wise) Operation Class
762
763 @ingroup Expression
764 */
765template <class T>
766class DivOp {
767public:
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//==============================================================================
782template < class T, unsigned int D>
789
790
791//==============================================================================
792// operator/ (SVector, binary)
793//==============================================================================
794template <class A, class T, unsigned int D>
800
801
802//==============================================================================
803// operator/ (SVector, binary)
804//==============================================================================
805template < class A, class T, unsigned int D>
812
813
814//=============================================================================
815// operator/ (SVector, binary)
816//=============================================================================
817template <class A, class B, class T, unsigned int D>
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//==============================================================================
835template <class A, class T, unsigned int D>
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//==============================================================================
852template <class A, class T, unsigned int D>
859
860
861//==============================================================================
862// operator/ (SVector, binary, Constant)
863//==============================================================================
864template <class A, class B, class T, unsigned int D>
871
872//==============================================================================
873// operator/ (SVector, binary, Constant)
874//==============================================================================
875template <class A, class B, class T, unsigned int D>
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//==============================================================================
893template < class T, unsigned int D, unsigned int D2, class R1, class R2>
900
901
902//==============================================================================
903// Div (SMatrix, binary)
904//==============================================================================
905template <class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
912
913
914//==============================================================================
915// Div (SMatrix, binary)
916//==============================================================================
917template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
924
925
926//==============================================================================
927// Div (SMatrix, binary)
928//==============================================================================
929template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
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//=============================================================================
947template <class A, class T, unsigned int D, unsigned int D2, class R>
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//==============================================================================
965template <class A, class T, unsigned int D, unsigned int D2, class R>
973
974
975//==============================================================================
976// operator/ (SMatrix, binary, Constant)
977//==============================================================================
978template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
986
987//==============================================================================
988// operator/ (SMatrix, binary, Constant)
989//==============================================================================
990template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
997
998
999
1000 } // namespace Math
1001
1002} // namespace ROOT
1003
1004
1005#endif /*ROOT_Math_BinaryOperators */
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Addition Operation Class.
static T apply(const T &lhs, const T &rhs)
Division (element-wise) Operation Class.
static T apply(const T &lhs, const T &rhs)
Subtraction Operation Class.
static T apply(const T &lhs, const T &rhs)
Multiplication (element-wise) Operation Class.
static T apply(const T &lhs, const T &rhs)
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,...
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.
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 ...
Namespace for new Math classes and functions.
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
MatRepStd< typename R1::value_type, N1, N2 > RepType