1 #ifndef ROOT_TRDiagMatrix
2 #define ROOT_TRDiagMatrix
17 void Inverse() {
TCL::trsinv(fArray,fArray, fNrows);}
18 Int_t GetNrows()
const {
return fNrows;}
19 Int_t GetNcols()
const {
return GetNrows();}
20 virtual ETRMatrixType GetMatrixType()
const {
return kDiagonalMatrix;}
21 virtual Double_t Product(
const TRVector& A,ETRMatrixCreatorsOp kop);
22 virtual void Print(Option_t *opt=
"")
const;
23 Double_t &operator()(Int_t i) {
return TRArray::operator[](i);}
24 Double_t operator()(Int_t i)
const {
return TRArray::operator[](i);}
25 Double_t &operator()(Int_t i,Int_t j);
26 Double_t operator()(Int_t i,Int_t j)
const {
return operator()(i,j);}
27 void AddRow(
const Double_t *row) {
28 fNrows++; Set(fNrows*(fNrows+1)/2); memcpy(fArray+(fNrows-1)*fNrows/2, row, fNrows*
sizeof(Double_t));
30 void AddRow(
const Double_t row) {
31 fNrows++; Set(fNrows*(fNrows+1)/2); fArray[(fNrows+1)*fNrows/2-1] = row;
38 ostream& operator<<(ostream& s,
const TRDiagMatrix &target);
39 inline Double_t &TRDiagMatrix::operator()(Int_t i,Int_t j){
40 if (j < 0 || j >= fNrows) {
41 ::Error(
"TRDiagMatrix::operator()",
"index j %d out of bounds (size: %d, this: %p)",
45 if (i < 0 || i >= fNrows) {
46 ::Error(
"TRDiagMatrix::operator()",
"index i %d out of bounds (size: %d, this: %p)",
52 if (i > j) {m = j; l = i;}
53 return TArrayD::operator[](m + (l+1)*l/2);
static float * trsinv(const float *g, float *gi, int n)