10 #ifndef ROOT_Minuit2_LASymMatrix 11 #define ROOT_Minuit2_LASymMatrix 35 int Mndaxpy(
unsigned int,
double,
const double*,
int,
double*,
int);
36 int Mndscal(
unsigned int,
double,
double*,
int);
40 int Invert ( LASymMatrix & );
100 template<
class A,
class B,
class T>
104 (*this) =
sum.Obj().A();
105 (*this) +=
sum.Obj().B();
109 template<
class A,
class T>
115 (*this)=
sum.Obj().B();
117 (*this)+=
sum.Obj().A();
121 template<
class A,
class T>
124 (*this) = something.Obj();
125 (*this) *= something.f();
131 memcpy(
fData,
inv.Obj().Obj().Obj().Data(),
fSize*
sizeof(double));
137 template<
class A,
class T>
138 LASymMatrix(
const ABObj<
sym,
ABSum<
ABObj<
sym,
MatrixInverse<
sym,
ABObj<sym, LASymMatrix, T>,
T>,
T>,
ABObj<sym, A, T> >,
T>&
sum) :
fSize(0),
fNRow(0),
fData(0) {
142 (*this)=
sum.Obj().B();
143 (*this)+=
sum.Obj().A();
149 template<
class A,
class T>
150 LASymMatrix(
const ABObj<
sym,
ABSum<
ABObj<
sym,
VectorOuterProduct<
ABObj<vec, LAVector, T>,
T>,
T>,
ABObj<sym, A, T> >,
T>&
sum) :
fSize(0),
fNRow(0),
fData(0) {
154 (*this)=
sum.Obj().B();
155 (*this)+=
sum.Obj().A();
186 template<
class A,
class T>
199 tmp *= double(
m.f());
208 Outer_prod(*
this,
m.Obj().Obj().Obj(),
m.f()*
m.Obj().Obj().f()*
m.Obj().Obj().f());
217 double operator()(
unsigned int row,
unsigned int col)
const {
220 return fData[col+row*(row+1)/2];
222 return fData[row+col*(col+1)/2];
228 return fData[col+row*(row+1)/2];
230 return fData[row+col*(col+1)/2];
254 if(fSize == 0 && fData == 0) {
255 fSize = v.
Obj().size();
256 fNRow = v.
Obj().Nrow();
259 assert(fSize == v.
Obj().size());
262 memcpy(fData, v.
Obj().Data(), fSize*
sizeof(double));
267 template<
class A,
class T>
270 if(fSize == 0 && fData == 0) {
271 (*this) = something.Obj();
272 (*this) *= something.f();
275 tmp *= something.f();
276 assert(fSize == tmp.size());
277 memcpy(fData, tmp.Data(), fSize*
sizeof(double));
283 template<
class A,
class B,
class T>
287 if(fSize == 0 && fData == 0) {
288 (*this) =
sum.Obj().A();
289 (*this) +=
sum.Obj().B();
293 tmp +=
sum.Obj().B();
295 assert(fSize == tmp.size());
296 memcpy(fData, tmp.Data(), fSize*
sizeof(double));
301 template<
class A,
class T>
305 if(fSize == 0 && fData == 0) {
307 (*this) =
sum.Obj().B();
308 (*this) +=
sum.Obj().A();
313 tmp +=
sum.Obj().A();
315 assert(fSize == tmp.size());
316 memcpy(fData, tmp.Data(), fSize*
sizeof(double));
324 if(fSize == 0 && fData == 0) {
325 fSize =
inv.Obj().Obj().Obj().size();
326 fNRow =
inv.Obj().Obj().Obj().Nrow();
328 memcpy(fData,
inv.Obj().Obj().Obj().Data(), fSize*
sizeof(double));
329 (*this) *=
inv.Obj().Obj().f();
335 tmp *= double(
inv.f());
336 assert(fSize == tmp.size());
337 memcpy(fData, tmp.Data(), fSize*
sizeof(double));
349 #endif // ROOT_Minuit2_LASymMatrix
static long int sum(long int i)
int Invert(LASymMatrix &)
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
LASymMatrix(unsigned int n)
int Mndaxpy(unsigned int, double, const double *, int, double *, int)
Class describing a symmetric matrix of size n.
unsigned int size() const
LASymMatrix & operator+=(const LASymMatrix &m)
double operator()(unsigned int row, unsigned int col) const
double inv(double x)
For comparisons.
LASymMatrix(const ABObj< sym, LASymMatrix, T > &v)
unsigned int Nrow() const
LASymMatrix(const ABObj< sym, ABSum< ABObj< sym, MatrixInverse< sym, ABObj< sym, LASymMatrix, T >, T >, T >, ABObj< sym, A, T > >, T > &sum)
LASymMatrix & operator+=(const ABObj< sym, VectorOuterProduct< ABObj< vec, LAVector, T >, T >, T > &m)
LASymMatrix & operator+=(const ABObj< sym, LASymMatrix, T > &m)
LASymMatrix & operator=(const ABObj< sym, ABObj< sym, A, T >, T > &something)
void Outer_prod(LASymMatrix &, const LAVector &, double f=1.)
LASymMatrix(const ABObj< sym, ABObj< sym, A, T >, T > &something)
LASymMatrix(const ABObj< sym, MatrixInverse< sym, ABObj< sym, LASymMatrix, T >, T >, T > &inv)
LASymMatrix & operator=(const ABObj< sym, ABSum< ABObj< sym, A, T >, ABObj< sym, B, T > >, T > &sum)
LASymMatrix(const LASymMatrix &v)
LASymMatrix & operator*=(double scal)
void * Allocate(size_t nBytes)
LASymMatrix & operator-=(const LASymMatrix &m)
LASymMatrix(const ABObj< sym, ABSum< ABObj< sym, VectorOuterProduct< ABObj< vec, LAVector, T >, T >, T >, ABObj< sym, A, T > >, T > &sum)
LASymMatrix & operator=(const ABObj< sym, ABSum< ABObj< sym, LASymMatrix, T >, ABObj< sym, A, T > >, T > &sum)
LASymMatrix & operator=(const LASymMatrix &v)
int Mndscal(unsigned int, double, double *, int)
TCppObject_t Allocate(TCppType_t type)
LASymMatrix & operator=(const ABObj< sym, LASymMatrix, T > &v)
LASymMatrix(const ABObj< sym, ABSum< ABObj< sym, LASymMatrix, T >, ABObj< sym, A, T > >, T > &sum)
double & operator()(unsigned int row, unsigned int col)
LASymMatrix(const ABObj< sym, ABSum< ABObj< sym, A, T >, ABObj< sym, B, T > >, T > &sum)
const double * Data() const
LASymMatrix & operator+=(const ABObj< sym, MatrixInverse< sym, ABObj< sym, LASymMatrix, T >, T >, T > &m)
static StackAllocator & Get()
unsigned int Ncol() const
LASymMatrix & operator+=(const ABObj< sym, A, T > &m)
LASymMatrix & operator=(const ABObj< sym, MatrixInverse< sym, ABObj< sym, LASymMatrix, T >, T >, T > &inv)