Logo ROOT  
Reference Guide
ABObj.h
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
10 #ifndef ROOT_Minuit2_ABObj
11 #define ROOT_Minuit2_ABObj
12 
13 #include "Minuit2/ABTypes.h"
14 
15 namespace ROOT {
16 
17 namespace Minuit2 {
18 
19 template <class mtype, class M, class T>
20 class ABObj {
21 
22 public:
23  typedef mtype Type;
24 
25 private:
26  ABObj() : fObject(M()), fFactor(T(0.)) {}
27 
28  ABObj &operator=(const ABObj &) { return *this; }
29 
30  template <class a, class b, class c>
31  ABObj(const ABObj<a, b, c> &) : fObject(M()), fFactor(T(0.))
32  {
33  }
34 
35  template <class a, class b, class c>
37  {
38  return *this;
39  }
40 
41 public:
42  ABObj(const M &obj) : fObject(obj), fFactor(T(1.)) {}
43 
44  ABObj(const M &obj, T factor) : fObject(obj), fFactor(factor) {}
45 
46  ~ABObj() {}
47 
48  ABObj(const ABObj &obj) : fObject(obj.fObject), fFactor(obj.fFactor) {}
49 
50  template <class b, class c>
51  ABObj(const ABObj<mtype, b, c> &obj) : fObject(M(obj.Obj())), fFactor(T(obj.f()))
52  {
53  }
54 
55  const M &Obj() const { return fObject; }
56 
57  T f() const { return fFactor; }
58 
59 private:
62 };
63 
64 class LAVector;
65 template <>
67 
68 public:
69  typedef vec Type;
70 
71 private:
72  ABObj &operator=(const ABObj &) = delete;
73 
74 public:
75  ABObj(const LAVector &obj) : fObject(obj), fFactor(double(1.)) {}
76 
77  ABObj(const LAVector &obj, double factor) : fObject(obj), fFactor(factor) {}
78 
79  ~ABObj() {}
80 
81  // remove copy constructure to Fix a problem in AIX
82  // should be able to use the compiler generated one
83  // ABObj(const ABObj& obj) :
84  // fObject(obj.fObject), fFactor(obj.fFactor) {}
85 
86  template <class c>
88  {
89  }
90 
91  const LAVector &Obj() const { return fObject; }
92 
93  double f() const { return fFactor; }
94 
95 private:
96  const LAVector &fObject;
97  double fFactor;
98 };
99 
100 class LASymMatrix;
101 template <>
103 
104 public:
105  typedef sym Type;
106 
107 private:
108  ABObj &operator=(const ABObj &) { return *this; }
109 
110 public:
111  ABObj(const LASymMatrix &obj) : fObject(obj), fFactor(double(1.)) {}
112 
113  ABObj(const LASymMatrix &obj, double factor) : fObject(obj), fFactor(factor) {}
114 
115  ~ABObj() {}
116 
117  ABObj(const ABObj &obj) : fObject(obj.fObject), fFactor(obj.fFactor) {}
118 
119  template <class c>
121  {
122  }
123 
124  const LASymMatrix &Obj() const { return fObject; }
125 
126  double f() const { return fFactor; }
127 
128 private:
130  double fFactor;
131 };
132 
133 // templated scaling operator *
134 template <class mt, class M, class T>
135 inline ABObj<mt, M, T> operator*(T f, const M &obj)
136 {
137  return ABObj<mt, M, T>(obj, f);
138 }
139 
140 // templated operator /
141 template <class mt, class M, class T>
142 inline ABObj<mt, M, T> operator/(const M &obj, T f)
143 {
144  return ABObj<mt, M, T>(obj, T(1.) / f);
145 }
146 
147 // templated unary operator -
148 template <class mt, class M, class T>
149 inline ABObj<mt, M, T> operator-(const M &obj)
150 {
151  return ABObj<mt, M, T>(obj, T(-1.));
152 }
153 
154 /*
155 // specialization for LAVector
156 
157 inline ABObj<vec, LAVector, double> operator*(double f, const LAVector& obj) {
158  return ABObj<vec, LAVector, double>(obj, f);
159 }
160 
161 inline ABObj<vec, LAVector, double> operator/(const LAVector& obj, double f) {
162  return ABObj<vec, LAVector, double>(obj, double(1.)/f);
163 }
164 
165 inline ABObj<vec,LAVector,double> operator-(const LAVector& obj) {
166  return ABObj<vec,LAVector,double>(obj, double(-1.));
167 }
168 */
169 
170 } // namespace Minuit2
171 
172 } // namespace ROOT
173 
174 #endif // ROOT_Minuit2_ABObj
ROOT::Minuit2::operator*
ABObj< mt, M, T > operator*(T f, const M &obj)
Definition: ABObj.h:135
ROOT::Minuit2::ABObj< vec, LAVector, double >::fObject
const LAVector & fObject
Definition: ABObj.h:96
ROOT::Minuit2::ABObj::~ABObj
~ABObj()
Definition: ABObj.h:46
f
#define f(i)
Definition: RSha256.hxx:104
ROOT::Minuit2::ABObj::ABObj
ABObj(const ABObj< a, b, c > &)
Definition: ABObj.h:31
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::ABObj
ABObj(const ABObj< vec, LASymMatrix, c > &obj)
Definition: ABObj.h:120
ROOT::Minuit2::vec
Definition: ABTypes.h:21
ROOT::Minuit2::LAVector
Definition: LAVector.h:32
ROOT::Minuit2::ABObj< vec, LAVector, double >::operator=
ABObj & operator=(const ABObj &)=delete
ROOT::Minuit2::ABObj::f
T f() const
Definition: ABObj.h:57
ROOT::Minuit2::ABObj
Definition: ABObj.h:20
ROOT::Minuit2::ABObj< vec, LAVector, double >::~ABObj
~ABObj()
Definition: ABObj.h:79
ROOT::Minuit2::LASymMatrix
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:45
ROOT::Minuit2::ABObj< vec, LAVector, double >::ABObj
ABObj(const LAVector &obj, double factor)
Definition: ABObj.h:77
ROOT::Minuit2::ABObj::ABObj
ABObj(const M &obj)
Definition: ABObj.h:42
ROOT::Minuit2::ABObj< vec, LAVector, double >::ABObj
ABObj(const LAVector &obj)
Definition: ABObj.h:75
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::~ABObj
~ABObj()
Definition: ABObj.h:115
ROOT::Minuit2::ABObj< vec, LAVector, double >::f
double f() const
Definition: ABObj.h:93
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::ABObj
ABObj(const ABObj &obj)
Definition: ABObj.h:117
ROOT::Minuit2::operator/
ABObj< mt, M, T > operator/(const M &obj, T f)
Definition: ABObj.h:142
ABTypes.h
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::ABObj
ABObj(const LASymMatrix &obj)
Definition: ABObj.h:111
ROOT::Minuit2::ABObj< vec, LAVector, double >::Type
vec Type
Definition: ABObj.h:69
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::ABObj
ABObj(const LASymMatrix &obj, double factor)
Definition: ABObj.h:113
ROOT::Minuit2::ABObj< vec, LAVector, double >::Obj
const LAVector & Obj() const
Definition: ABObj.h:91
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::fObject
const LASymMatrix & fObject
Definition: ABObj.h:129
double
double
Definition: Converters.cxx:921
ROOT::Minuit2::ABObj::fFactor
T fFactor
Definition: ABObj.h:61
ROOT::Minuit2::ABObj< vec, LAVector, double >::ABObj
ABObj(const ABObj< vec, LAVector, c > &obj)
Definition: ABObj.h:87
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::Type
sym Type
Definition: ABObj.h:105
ROOT::Minuit2::sym
Definition: ABTypes.h:19
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::operator=
ABObj & operator=(const ABObj &)
Definition: ABObj.h:108
ROOT::Minuit2::ABObj::fObject
M fObject
Definition: ABObj.h:60
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::f
double f() const
Definition: ABObj.h:126
ROOT::Minuit2::ABObj< vec, LAVector, double >::fFactor
double fFactor
Definition: ABObj.h:97
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::fFactor
double fFactor
Definition: ABObj.h:130
ROOT::Minuit2::ABObj::Obj
const M & Obj() const
Definition: ABObj.h:55
ROOT::Minuit2::ABObj::ABObj
ABObj(const ABObj &obj)
Definition: ABObj.h:48
ROOT::Minuit2::ABObj::ABObj
ABObj(const ABObj< mtype, b, c > &obj)
Definition: ABObj.h:51
ROOT::Minuit2::ABObj::operator=
ABObj & operator=(const ABObj< a, b, c > &)
Definition: ABObj.h:36
ROOT::Minuit2::ABObj::ABObj
ABObj(const M &obj, T factor)
Definition: ABObj.h:44
ROOT::Minuit2::ABObj::ABObj
ABObj()
Definition: ABObj.h:26
ROOT::Math::Chebyshev::T
double T(double x)
Definition: ChebyshevPol.h:34
ROOT::Minuit2::ABObj::operator=
ABObj & operator=(const ABObj &)
Definition: ABObj.h:28
ROOT::Minuit2::ABObj::Type
mtype Type
Definition: ABObj.h:23
ROOT::Minuit2::operator-
ABObj< mt, M, T > operator-(const M &obj)
Definition: ABObj.h:149
ROOT::Minuit2::ABObj< sym, LASymMatrix, double >::Obj
const LASymMatrix & Obj() const
Definition: ABObj.h:124
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4