6 #include "TRSymMatrix.h"
9 TRMatrix(Int_t nrows=0,Int_t ncols=0) :
TRArray(nrows*ncols), fNrows(nrows), fNcols(ncols) {}
10 TRMatrix(Int_t nrows,Int_t ncols,
const Double_t *Array) :
TRArray(nrows*ncols,Array), fNrows(nrows), fNcols(ncols) {}
11 TRMatrix(Int_t nrows,Int_t ncols,
const Float_t *Array) :
TRArray(nrows*ncols,Array), fNrows(nrows), fNcols(ncols) {}
13 TRMatrix(ETRMatrixCreatorsOp kop,Int_t nrows);
15 TRMatrix(Int_t nrows,Int_t ncols,
const Char_t *s) :
TRArray(nrows*ncols,s), fNrows(nrows), fNcols(ncols) {}
21 TRMatrix(Int_t nrows,Int_t ncols,Double_t a0, ...);
25 Int_t GetNrows()
const {
return fNrows;}
26 Int_t GetNcols()
const {
return fNcols;}
27 Int_t NI()
const {
return fNrows;}
28 Int_t NJ()
const {
return fNcols;}
29 void SetMatrix(Int_t nrows,Int_t ncols,
const Double_t *array=0);
30 ETRMatrixType GetMatrixType()
const {
return kRectangular;}
31 Double_t &operator()(Int_t i) {
return TRArray::operator[](i);}
32 Double_t operator()(Int_t i)
const {
return TRArray::operator[](i);}
33 Double_t &operator()(Int_t i,Int_t j);
34 Double_t operator()(Int_t i,Int_t j)
const {
return operator()(i,j);}
40 void Substruct(
const TRMatrix& A, ETRMatrixCreatorsOp kop,
const TRMatrix& B);
41 void AddRow(
const Double_t *row) {
42 fNrows++; Set(fNrows*fNcols); TCL::ucopy(row, fArray+(fNrows-1)*fNcols, fNcols);
44 void AddRow(
const Float_t *row) {
45 fNrows++; Set(fNrows*fNcols); TCL::ucopy(row, fArray+(fNrows-1)*fNcols, fNcols);
47 const Double_t *GetRow(UInt_t col = 0)
const {
return GetArray() + col*fNcols;}
48 virtual void Print(Option_t *opt=
"")
const;
58 std::ostream& operator<<(std::ostream& s,
const TRMatrix &target);
59 inline Double_t &TRMatrix::operator()(Int_t i,Int_t j){
60 if (j < 0 || j >= fNcols) {
61 ::Error(
"TRMatrix::operator()",
"index j %d out of bounds (size: %d, this: %p)",
65 if (i < 0 || i >= fNrows) {
66 ::Error(
"TRMatrix::operator()",
"index i %d out of bounds (size: %d, this: %p)",
70 return TArrayD::operator[](j + i*fNcols);