1 #ifndef ROOT_TRSymMatrix
2 #define ROOT_TRSymMatrix
24 void Inverse() {
TCL::trsinv(fArray,fArray, fNrows);}
25 Int_t GetNrows()
const {
return fNrows;}
26 Int_t GetNcols()
const {
return GetNrows();}
27 virtual ETRMatrixType GetMatrixType()
const {
return kSemiPosDefinedSymMatrix;}
28 virtual Double_t Product(
const TRVector& A,ETRMatrixCreatorsOp kop=kAxSxAT);
30 static Int_t spminv(Double_t *v, Double_t *b, Int_t n,
31 Int_t &nrank, Double_t *diag, Bool_t *flag);
32 virtual void Print(Option_t *opt=
"")
const;
33 Double_t &operator()(Int_t i) {
return TRArray::operator[](i);}
34 Double_t operator()(Int_t i)
const {
return TRArray::operator[](i);}
35 Double_t &operator()(Int_t i,Int_t j);
36 Double_t operator()(Int_t i,Int_t j)
const;
37 void AddRow(
const Double_t *row) {
38 fNrows++; Set(fNrows*(fNrows+1)/2); memcpy(fArray+(fNrows-1)*fNrows/2, row, fNrows*
sizeof(Double_t));
40 void AddRow(
const Double_t row) {
41 fNrows++; Set(fNrows*(fNrows+1)/2); fArray[(fNrows+1)*fNrows/2-1] = row;
43 static Int_t TrsInv(
const Double_t *g, Double_t *gi, Int_t n);
44 static Int_t TrInv(
const Double_t *g, Double_t *gi, Int_t n);
45 static Int_t TrchLU(
const Double_t *g, Double_t *gi, Int_t n);
46 static Int_t TrsmUL(
const Double_t *g, Double_t *gi, Int_t n);
52 std::ostream& operator<<(std::ostream& s,
const TRSymMatrix &target);
53 inline Double_t &TRSymMatrix::operator()(Int_t i,Int_t j){
55 if (j < 0 || j >= fNrows) {
56 ::Error(
"TRSymMatrix::operator()",
"index j %d out of bounds (size: %d, this: %p)",
62 if (i < 0 || i >= fNrows) {
63 ::Error(
"TRSymMatrix::operator()",
"index i %d out of bounds (size: %d, this: %p)",
70 if (i > j) {m = j; l = i;}
71 return TArrayD::operator[](m + (l+1)*l/2);
73 inline Double_t TRSymMatrix::operator()(Int_t i,Int_t j)
const {
75 if (j < 0 || j >= fNrows) {
76 ::Error(
"TRSymMatrix::operator()",
"index j %d out of bounds (size: %d, this: %p)",
82 if (i < 0 || i >= fNrows) {
83 ::Error(
"TRSymMatrix::operator()",
"index i %d out of bounds (size: %d, this: %p)",
90 if (i > j) {m = j; l = i;}
91 return TArrayD::operator[](m + (l+1)*l/2);
static float * trsinv(const float *g, float *gi, int n)