12 #ifndef ROOT_TMatrixTBase
13 #define ROOT_TMatrixTBase
73 #ifndef ROOT_TMatrixFBasefwd
76 #ifndef ROOT_TMatrixDBasefwd
79 #ifndef ROOT_TVectorFfwd
82 #ifndef ROOT_TVectorDfwd
127 fNrows(0), fNcols(0), fRowLwb(0), fColLwb(0), fNelems(0), fNrowIndex(0),
128 fTol(0), fIsOwner(
kTRUE) { }
184 virtual Element
RowNorm ()
const;
185 virtual Element
ColNorm ()
const;
186 virtual Element
E2Norm ()
const;
190 virtual Element
Sum ()
const;
191 virtual Element
Min ()
const;
192 virtual Element
Max ()
const;
220 const Element oldTol = fTol;
228 template<
class Element1,
class Element2>
virtual TMatrixTBase< Element > & UnitMatrix()
Make a unit matrix (matrix need not be a square one).
virtual const Element * GetMatrixArray() const =0
virtual TMatrixTBase< Element > & Sqrt()
Take square root of all elements.
virtual void Clear(Option_t *option="")=0
virtual TMatrixTBase< Element > & Shift(Int_t row_shift, Int_t col_shift)
Shift the row index by adding row_shift and the column index by adding col_shift, respectively...
virtual void ExtractRow(Int_t row, Int_t col, Element *v, Int_t n=-1) const
Store in array v, n matrix elements of row rown starting at column coln.
virtual TMatrixTBase< Element > & SetMatrixArray(const Element *data, Option_t *option="")
Copy array data to matrix .
virtual TMatrixTBase< Element > & Zero()
Set matrix elements to zero.
virtual Element RowNorm() const
Row matrix norm, MAX{ SUM{ |M(i,j)|, over j}, over i}.
virtual Element E2Norm() const
Square of the Euclidian norm, SUM{ m(i,j)^2 }.
Bool_t operator<=(Element val) const
Are all matrix elements <= val?
virtual TMatrixTBase< Element > & SetColIndexArray(Int_t *data)=0
Int_t GetNoElements() const
Bool_t VerifyMatrixValue(const TMatrixTBase< Element > &m, Element val, Int_t verbose, Element maxDevAllow)
Validate that all elements of matrix have value val within maxDevAllow.
virtual TMatrixTBase< Element > & Sqr()
Square each element of the matrix.
virtual Int_t NonZeros() const
Compute the number of elements != 0.0.
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t nr_nonzeros=-1)=0
virtual TMatrixTBase< Element > & SetRowIndexArray(Int_t *data)=0
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
double beta(double x, double y)
Calculates the beta function.
virtual Bool_t IsSymmetric() const
Check whether matrix is symmetric.
Bool_t VerifyMatrixIdentity(const TMatrixTBase< Element > &m1, const TMatrixTBase< Element > &m2, Int_t verbose, Element maxDevAllow)
Verify that elements of the two matrices are equal within MaxDevAllow .
Bool_t operator<(Element val) const
Are all matrix elements < val?
#define ClassDef(name, id)
virtual Element Sum() const
Compute sum of elements.
Bool_t AreCompatible(const TMatrixTBase< Element1 > &m1, const TMatrixTBase< Element2 > &m2, Int_t verbose=0)
Check that matrice sm1 and m2 areboth valid and have identical shapes .
Bool_t operator==(const TMatrixTBase< Element > &m1, const TMatrixTBase< Element > &m2)
Check to see if two matrices are identical.
virtual Element operator()(Int_t rown, Int_t coln) const =0
virtual TMatrixTBase< Element > & Apply(const TElementActionT< Element > &action)
Apply action to each matrix element.
void Print(Option_t *name="") const
Print the matrix as a table of elements.
virtual TMatrixTBase< Element > & NormByDiag(const TVectorT< Element > &v, Option_t *option="D")
option: "D" : b(i,j) = a(i,j)/sqrt(abs*(v(i)*v(j))) (default) else : b(i,j) = a(i,j)*sqrt(abs*(v(i)*v(j))) (default)
static void DoubleLexSort(Int_t n, Int_t *first, Int_t *second, Element *data)
default kTRUE, when Use array kFALSE
virtual TMatrixTBase< Element > & SetSub(Int_t row_lwb, Int_t col_lwb, const TMatrixTBase< Element > &source)=0
virtual TMatrixTBase< Element > & InsertRow(Int_t row, Int_t col, const Element *v, Int_t n=-1)
Copy n elements from array v to row rown starting at column coln.
virtual Element ColNorm() const
Column matrix norm, MAX{ SUM{ |M(i,j)|, over i}, over j}.
Bool_t operator==(Element val) const
Are all matrix elements equal to val?
Bool_t TestBit(UInt_t f) const
virtual TMatrixTBase< Element > & Randomize(Element alpha, Element beta, Double_t &seed)
Randomize matrix element values.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract...
virtual void Determinant(Double_t &d1, Double_t &d2) const
R__EXTERN Int_t gMatrixCheck
virtual Element Min() const
return minimum matrix element value
void Compare(const TMatrixTBase< Element > &m1, const TMatrixTBase< Element > &m2)
Compare two matrices and print out the result of the comparison.
Bool_t operator>=(Element val) const
Are all matrix elements >= val?
virtual Element Max() const
return maximum vector element value
void Draw(Option_t *option="")
Draw this matrix The histogram is named "TMatrixT" by default and no title.
Mother of all ROOT objects.
virtual Double_t Determinant() const
Bool_t operator>(Element val) const
Are all matrix elements > val?
static void IndexedLexSort(Int_t n, Int_t *first, Int_t swapFirst, Int_t *second, Int_t swapSecond, Int_t *index)
Lexical sort on array data using indices first and second.
static Element & NaNValue()
Bool_t operator!=(Element val) const
Are all matrix elements not equal to val?
virtual TMatrixTBase< Element > & GetSub(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, TMatrixTBase< Element > &target, Option_t *option="S") const =0
Element SetTol(Element tol)
Element E2Norm(const TMatrixTBase< Element > &m1, const TMatrixTBase< Element > &m2)
Square of the Euclidian norm of the difference between two matrices.
virtual const Int_t * GetColIndexArray() const =0
virtual const Int_t * GetRowIndexArray() const =0
virtual TMatrixTBase< Element > & Abs()
Take an absolute value of a matrix, i.e. apply Abs() to each element.
virtual void GetMatrix2Array(Element *data, Option_t *option="") const
Copy matrix data to array .