File indexing completed on 2025-01-30 10:22:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef ROOT_Minuit2_LaSum
0011 #define ROOT_Minuit2_LaSum
0012
0013 #include "Minuit2/ABSum.h"
0014 #include "Minuit2/LAVector.h"
0015 #include "Minuit2/LASymMatrix.h"
0016
0017 namespace ROOT {
0018
0019 namespace Minuit2 {
0020
0021 #define OP_ADD1(MT, MAT1, T) \
0022 inline ABObj<MT, MAT1, T> operator-(const ABObj<MT, MAT1, T> &m) \
0023 { \
0024 return ABObj<MT, MAT1, T>(m.Obj(), T(-1.) * m.f()); \
0025 } \
0026 \
0027 inline ABObj<MT, ABSum<ABObj<MT, MAT1, T>, ABObj<MT, MAT1, T>>, T> operator+(const ABObj<MT, MAT1, T> &a, \
0028 const ABObj<MT, MAT1, T> &b) \
0029 { \
0030 return ABObj<MT, ABSum<ABObj<MT, MAT1, T>, ABObj<MT, MAT1, T>>, T>( \
0031 ABSum<ABObj<MT, MAT1, T>, ABObj<MT, MAT1, T>>(a, b)); \
0032 } \
0033 inline ABObj<MT, ABSum<ABObj<MT, MAT1, T>, ABObj<MT, MAT1, T>>, T> operator-(const ABObj<MT, MAT1, T> &a, \
0034 const ABObj<MT, MAT1, T> &b) \
0035 { \
0036 return ABObj<MT, ABSum<ABObj<MT, MAT1, T>, ABObj<MT, MAT1, T>>, T>( \
0037 ABSum<ABObj<MT, MAT1, T>, ABObj<MT, MAT1, T>>(a, ABObj<MT, MAT1, T>(b.Obj(), T(-1.) * b.f()))); \
0038 }
0039
0040 OP_ADD1(vec, LAVector, double)
0041 OP_ADD1(sym, LASymMatrix, double)
0042
0043 #define OP_SCALE(MT, MAT1, T) \
0044 inline ABObj<MT, MAT1, T> operator*(T f, const MAT1 &obj) { return ABObj<MT, MAT1, T>(obj, f); }
0045
0046 OP_SCALE(sym, LASymMatrix, double)
0047 OP_SCALE(vec, LAVector, double)
0048
0049 #define OP_SCALE1(MT, MAT1, T) \
0050 inline ABObj<MT, MAT1, T> operator/(const MAT1 &obj, T f) { return ABObj<MT, MAT1, T>(obj, 1. / f); }
0051
0052 OP_SCALE1(sym, LASymMatrix, double)
0053 OP_SCALE1(vec, LAVector, double)
0054
0055 #define OP_MIN(MT, MAT1, T) \
0056 inline ABObj<MT, MAT1, T> operator-(const MAT1 &obj) { return ABObj<MT, MAT1, T>(obj, T(-1.)); }
0057
0058 OP_MIN(sym, LASymMatrix, double)
0059 OP_MIN(vec, LAVector, double)
0060
0061 }
0062
0063 }
0064
0065 #endif