ROOT   Reference Guide
LaSum.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_LaSum
11#define ROOT_Minuit2_LaSum
12
13#include "Minuit2/ABSum.h"
14#include "Minuit2/LAVector.h"
15#include "Minuit2/LASymMatrix.h"
16
17namespace ROOT {
18
19 namespace Minuit2 {
20
21
23inline ABObj<MT,MAT1,T> operator-(const ABObj<MT,MAT1,T>& m) {\
24 return ABObj<MT,MAT1,T> (m.Obj(), T(-1.)*m.f());\
25}\
26 \
27inline ABObj<MT,ABSum<ABObj<MT,MAT1,T>, ABObj<MT,MAT1,T> >,T> operator+(const ABObj<MT,MAT1,T>& a, const ABObj<MT,MAT1,T>& b) { \
28 return ABObj<MT,ABSum<ABObj<MT,MAT1,T>, ABObj<MT,MAT1,T> >,T>(ABSum<ABObj<MT,MAT1,T>, ABObj<MT,MAT1,T> >(a, b)); \
29} \
30inline ABObj<MT,ABSum<ABObj<MT,MAT1,T>, ABObj<MT,MAT1,T> >,T> operator-(const ABObj<MT,MAT1,T>& a, const ABObj<MT,MAT1,T>& b) { \
31 return ABObj<MT,ABSum<ABObj<MT,MAT1,T>, ABObj<MT,MAT1,T> >,T>(ABSum<ABObj<MT,MAT1,T>, ABObj<MT,MAT1,T> >(a,ABObj<MT,MAT1,T> (b.Obj(),T(-1.)*b.f()))); \
32}
33
36
37#define OP_SCALE(MT,MAT1,T) \
38inline ABObj<MT,MAT1,T> operator*(T f, const MAT1& obj) { \
39 return ABObj<MT,MAT1,T>(obj, f); \
40}
41
42OP_SCALE(sym,LASymMatrix,double)
43OP_SCALE(vec,LAVector,double)
44
45#define OP_SCALE1(MT,MAT1,T) \
46inline ABObj<MT,MAT1,T> operator/(const MAT1& obj, T f) { \
47 return ABObj<MT,MAT1,T>(obj, 1./f); \
48}
49
50OP_SCALE1(sym,LASymMatrix,double)
51OP_SCALE1(vec,LAVector,double)
52
53#define OP_MIN(MT,MAT1,T) \
54inline ABObj<MT,MAT1,T> operator-(const MAT1& obj) { \
55 return ABObj<MT,MAT1,T>(obj, T(-1.)); \
56}
57
58OP_MIN(sym,LASymMatrix,double)
59OP_MIN(vec,LAVector,double)
60
61 } // namespace Minuit2
62
63} // namespace ROOT
64
65#endif // ROOT_Minuit2_LaSum
#define OP_MIN(MT, MAT1, T)
Definition: LaSum.h:53