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
15namespace ROOT {
16
17namespace Minuit2 {
18
19template <class mtype, class M, class T>
20class ABObj {
21
22public:
23 typedef mtype Type;
24
25private:
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
41public:
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
59private:
62};
63
64class LAVector;
65template <>
67
68public:
69 typedef vec Type;
70
71private:
72 ABObj &operator=(const ABObj &) = delete;
73
74public:
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
95private:
97 double fFactor;
98};
99
100class LASymMatrix;
101template <>
103
104public:
105 typedef sym Type;
106
107private:
108 ABObj &operator=(const ABObj &) { return *this; }
109
110public:
111 ABObj(const LASymMatrix &obj) : fObject(obj), fFactor(double(1.)) {}
112
113 ABObj(const LASymMatrix &obj, double factor) : fObject(obj), fFactor(factor) {}
114
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
128private:
130 double fFactor;
131};
132
133// templated scaling operator *
134template <class mt, class M, class T>
135inline ABObj<mt, M, T> operator*(T f, const M &obj)
136{
137 return ABObj<mt, M, T>(obj, f);
138}
139
140// templated operator /
141template <class mt, class M, class T>
142inline 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 -
148template <class mt, class M, class T>
149inline 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
157inline ABObj<vec, LAVector, double> operator*(double f, const LAVector& obj) {
158 return ABObj<vec, LAVector, double>(obj, f);
159}
160
161inline ABObj<vec, LAVector, double> operator/(const LAVector& obj, double f) {
162 return ABObj<vec, LAVector, double>(obj, double(1.)/f);
163}
164
165inline 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
double
Definition: Converters.cxx:939
#define f(i)
Definition: RSha256.hxx:104
ABObj(const ABObj< vec, LASymMatrix, c > &obj)
Definition: ABObj.h:120
ABObj(const LASymMatrix &obj, double factor)
Definition: ABObj.h:113
const LASymMatrix & Obj() const
Definition: ABObj.h:124
ABObj & operator=(const ABObj &)=delete
ABObj(const LAVector &obj, double factor)
Definition: ABObj.h:77
const LAVector & Obj() const
Definition: ABObj.h:91
ABObj(const ABObj< vec, LAVector, c > &obj)
Definition: ABObj.h:87
ABObj(const ABObj< a, b, c > &)
Definition: ABObj.h:31
ABObj(const M &obj, T factor)
Definition: ABObj.h:44
ABObj(const ABObj &obj)
Definition: ABObj.h:48
ABObj(const M &obj)
Definition: ABObj.h:42
ABObj & operator=(const ABObj &)
Definition: ABObj.h:28
const M & Obj() const
Definition: ABObj.h:55
T f() const
Definition: ABObj.h:57
ABObj & operator=(const ABObj< a, b, c > &)
Definition: ABObj.h:36
ABObj(const ABObj< mtype, b, c > &obj)
Definition: ABObj.h:51
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:45
double T(double x)
Definition: ChebyshevPol.h:34
ABObj< mt, M, T > operator*(T f, const M &obj)
Definition: ABObj.h:135
ABObj< mt, M, T > operator/(const M &obj, T f)
Definition: ABObj.h:142
ABObj< mt, M, T > operator-(const M &obj)
Definition: ABObj.h:149
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: RNumpyDS.hxx:30