ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BinaryOpPolicy.h
Go to the documentation of this file.
1 // @(#)root/smatrix:$Id$
2 // Authors: J. Palacios 2006
3 #ifndef ROOT_Math_BinaryOpPolicy
4 #define ROOT_Math_BinaryOpPolicy 1
5 
6 // Include files
7 
8 /** @class BinaryOpPolicy BinaryOpPolicy.h Math/BinaryOpPolicy.h
9  *
10  *
11  * @author Juan PALACIOS
12  * @date 2006-01-10
13  *
14  * Classes to define matrix representation binary combination policy.
15  * At the moment deals with symmetric and generic representation, and
16  * establishes policies for multiplication (and division) and addition
17  * (and subtraction)
18  */
19 
20 
21 #ifndef ROOT_Math_MatrixRepresentationsStatic
23 #endif
24 
25 namespace ROOT {
26 
27  namespace Math {
28 
29  /**
30  matrix-matrix multiplication policy
31  */
32  template <class T, class R1, class R2>
33  struct MultPolicy
34  {
35  enum {
36  N1 = R1::kRows,
37  N2 = R2::kCols
38  };
40  };
41 
42  /**
43  matrix addition policy
44  */
45  template <class T, unsigned int D1, unsigned int D2, class R1, class R2>
46  struct AddPolicy
47  {
48  enum {
49  N1 = R1::kRows,
50  N2 = R1::kCols
51  };
53  };
54 
55  template <class T, unsigned int D1, unsigned int D2>
56  struct AddPolicy<T, D1, D2, MatRepSym<T,D1>, MatRepSym<T,D1> >
57  {
59  };
60 
61  /**
62  matrix transpose policy
63  */
64  template <class T, unsigned int D1, unsigned int D2, class R>
65  struct TranspPolicy
66  {
67  enum {
68  N1 = R::kRows,
69  N2 = R::kCols
70  };
72  };
73  // specialized case of transpose of sym matrices
74  template <class T, unsigned int D1, unsigned int D2>
75  struct TranspPolicy<T, D1, D2, MatRepSym<T,D1> >
76  {
78  };
79  } // namespace Math
80 
81 } // namespace ROOT
82 
83 #endif // MATH_BINARYOPPOLICY_H
MatRepStd< T, N2, N1 > RepType
MatRepStd< typename R1::value_type, N1, N2 > RepType
MatRepSym Matrix storage representation for a symmetric matrix of dimension NxN This class is a templ...
Definition: HelperOps.h:35
matrix transpose policy
matrix addition policy
matrix-matrix multiplication policy
TTree * T
Expression wrapper class for Matrix objects.
Definition: Expression.h:134
MatRepStd< T, N1, N2 > RepType