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
int Invert(LASymMatrix &)
Namespace for new ROOT classes and functions.
LASymMatrix(unsigned int n)
int Mndaxpy(unsigned int, double, const double *, int, double *, int)
Class describing a symmetric matrix of size n.
LASymMatrix & operator+=(const LASymMatrix &m)
LASymMatrix(const ABObj< sym, LASymMatrix, T > &v)
double operator()(unsigned int row, unsigned int col) 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)
const double * Data() const
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)
unsigned int Ncol() const
void * Allocate(size_t nBytes)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t Int_t m
unsigned int Nrow() const
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)
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)
unsigned int size() const
LASymMatrix(const ABObj< sym, ABSum< ABObj< sym, A, T >, ABObj< sym, B, T > >, T > &sum)
LASymMatrix & operator+=(const ABObj< sym, MatrixInverse< sym, ABObj< sym, LASymMatrix, T >, T >, T > &m)
static StackAllocator & Get()
LASymMatrix & operator+=(const ABObj< sym, A, T > &m)
LASymMatrix & operator=(const ABObj< sym, MatrixInverse< sym, ABObj< sym, LASymMatrix, T >, T >, T > &inv)