Logo ROOT   6.18/05
Reference Guide
TMatrixT.h
Go to the documentation of this file.
1// @(#)root/matrix:$Id$
2// Authors: Fons Rademakers, Eddy Offermann Nov 2003
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TMatrixT
13#define ROOT_TMatrixT
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TMatrixT //
18// //
19// Template class of a general matrix in the linear algebra package //
20// //
21//////////////////////////////////////////////////////////////////////////
22
23#include "TMatrixTBase.h"
24#include "TMatrixTUtils.h"
25
26#ifdef CBLAS
27#include <vecLib/vBLAS.h>
28//#include <cblas.h>
29#endif
30
31#include "Rtypes.h"
32#include "TError.h"
33
34
35template<class Element> class TMatrixTSym;
36template<class Element> class TMatrixTSparse;
37template<class Element> class TMatrixTLazy;
38
39template<class Element> class TMatrixT : public TMatrixTBase<Element> {
40
41protected:
42
43 Element fDataStack[TMatrixTBase<Element>::kSizeMax]; //! data container
44 Element *fElements; //[fNelems] elements themselves
45
46 Element *New_m (Int_t size);
47 void Delete_m(Int_t size,Element*&);
48 Int_t Memcpy_m(Element *newp,const Element *oldp,Int_t copySize,
49 Int_t newSize,Int_t oldSize);
50 void Allocate(Int_t nrows,Int_t ncols,Int_t row_lwb = 0,Int_t col_lwb = 0,Int_t init = 0,
51 Int_t /*nr_nonzeros*/ = -1);
52
53
54public:
55
56
57 enum {kWorkMax = 100};
60
62 TMatrixT(Int_t nrows,Int_t ncols);
63 TMatrixT(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
64 TMatrixT(Int_t nrows,Int_t ncols,const Element *data,Option_t *option="");
65 TMatrixT(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,const Element *data,Option_t *option="");
66 TMatrixT(const TMatrixT <Element> &another);
67 TMatrixT(const TMatrixTSym <Element> &another);
68 TMatrixT(const TMatrixTSparse<Element> &another);
69 template <class Element2> TMatrixT(const TMatrixT<Element2> &another): fElements(0)
70 {
71 R__ASSERT(another.IsValid());
72 Allocate(another.GetNrows(),another.GetNcols(),another.GetRowLwb(),another.GetColLwb());
73 *this = another;
74 }
75
81 TMatrixT(const TMatrixTLazy<Element> &lazy_constructor);
82
83 virtual ~TMatrixT() { Clear(); }
84
85 // Elementary constructors
86
87 void Plus (const TMatrixT <Element> &a,const TMatrixT <Element> &b);
88 void Plus (const TMatrixT <Element> &a,const TMatrixTSym<Element> &b);
90
91 void Minus(const TMatrixT <Element> &a,const TMatrixT <Element> &b);
94
95 void Mult (const TMatrixT <Element> &a,const TMatrixT <Element> &b);
96 void Mult (const TMatrixT <Element> &a,const TMatrixTSym<Element> &b);
97 void Mult (const TMatrixTSym<Element> &a,const TMatrixT <Element> &b);
99
100 void TMult(const TMatrixT <Element> &a,const TMatrixT <Element> &b);
101 void TMult(const TMatrixT <Element> &a,const TMatrixTSym<Element> &b);
104
105 void MultT(const TMatrixT <Element> &a,const TMatrixT <Element> &b);
107 void MultT(const TMatrixTSym<Element> &a,const TMatrixT <Element> &b);
109
110 virtual const Element *GetMatrixArray () const;
111 virtual Element *GetMatrixArray ();
112 virtual const Int_t *GetRowIndexArray() const { return 0; }
113 virtual Int_t *GetRowIndexArray() { return 0; }
114 virtual const Int_t *GetColIndexArray() const { return 0; }
115 virtual Int_t *GetColIndexArray() { return 0; }
116
117 virtual TMatrixTBase<Element> &SetRowIndexArray(Int_t * /*data*/) { MayNotUse("SetRowIndexArray(Int_t *)"); return *this; }
118 virtual TMatrixTBase<Element> &SetColIndexArray(Int_t * /*data*/) { MayNotUse("SetColIndexArray(Int_t *)"); return *this; }
119
120 virtual void Clear(Option_t * /*option*/ ="") { if (this->fIsOwner) Delete_m(this->fNelems,fElements);
121 else fElements = 0;
122 this->fNelems = 0; }
123
124 TMatrixT <Element> &Use (Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,Element *data);
125 const TMatrixT <Element> &Use (Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,const Element *data) const
126 { return (const TMatrixT<Element>&)
127 ((const_cast<TMatrixT<Element> *>(this))->Use(row_lwb,row_upb,col_lwb,col_upb, const_cast<Element *>(data))); }
128 TMatrixT <Element> &Use (Int_t nrows,Int_t ncols,Element *data);
129 const TMatrixT <Element> &Use (Int_t nrows,Int_t ncols,const Element *data) const;
132
133 virtual TMatrixTBase<Element> &GetSub (Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,
134 TMatrixTBase<Element> &target,Option_t *option="S") const;
135 TMatrixT <Element> GetSub (Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,Option_t *option="S") const;
136 virtual TMatrixTBase<Element> &SetSub (Int_t row_lwb,Int_t col_lwb,const TMatrixTBase<Element> &source);
137
138 virtual TMatrixTBase<Element> &ResizeTo(Int_t nrows,Int_t ncols,Int_t /*nr_nonzeros*/ =-1);
139 virtual TMatrixTBase<Element> &ResizeTo(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,Int_t /*nr_nonzeros*/ =-1);
141 return ResizeTo(m.GetRowLwb(),m.GetRowUpb(),m.GetColLwb(),m.GetColUpb());
142 }
143
144 virtual Double_t Determinant () const;
145 virtual void Determinant (Double_t &d1,Double_t &d2) const;
146
150 inline TMatrixT<Element> &T () { return this->Transpose(*this); }
151 TMatrixT<Element> &Rank1Update (const TVectorT<Element> &v,Element alpha=1.0);
152 TMatrixT<Element> &Rank1Update (const TVectorT<Element> &v1,const TVectorT<Element> &v2,Element alpha=1.0);
153 Element Similarity (const TVectorT<Element> &v) const;
154
157
158 // Either access a_ij as a(i,j)
159 inline Element operator()(Int_t rown,Int_t coln) const;
160 inline Element &operator()(Int_t rown,Int_t coln);
161
162 // or as a[i][j]
163 inline const TMatrixTRow_const<Element> operator[](Int_t rown) const { return TMatrixTRow_const<Element>(*this,rown); }
164 inline TMatrixTRow <Element> operator[](Int_t rown) { return TMatrixTRow <Element>(*this,rown); }
165
170 template <class Element2> TMatrixT<Element> &operator= (const TMatrixT<Element2> &source)
171 {
172 if (!AreCompatible(*this,source)) {
173 Error("operator=(const TMatrixT2 &)","matrices not compatible");
174 return *this;
175 }
176
177 TObject::operator=(source);
178 const Element2 * const ps = source.GetMatrixArray();
179 Element * const pt = this->GetMatrixArray();
180 for (Int_t i = 0; i < this->fNelems; i++)
181 pt[i] = ps[i];
182 this->fTol = source.GetTol();
183 return *this;
184 }
185
186 TMatrixT<Element> &operator= (Element val);
187 TMatrixT<Element> &operator-=(Element val);
188 TMatrixT<Element> &operator+=(Element val);
189 TMatrixT<Element> &operator*=(Element val);
190
195
204
205 const TMatrixT<Element> EigenVectors(TVectorT<Element> &eigenValues) const;
206
207 ClassDef(TMatrixT,4) // Template of General Matrix class
208};
209
210#ifndef __CINT__
211// When building with -fmodules, it instantiates all pending instantiations,
212// instead of delaying them until the end of the translation unit.
213// We 'got away with' probably because the use and the definition of the
214// explicit specialization do not occur in the same TU.
215//
216// In case we are building with -fmodules, we need to forward declare the
217// specialization in order to compile the dictionary G__Matrix.cxx.
219#endif // __CINT__
220
221
222template <class Element> inline const Element *TMatrixT<Element>::GetMatrixArray() const { return fElements; }
223template <class Element> inline Element *TMatrixT<Element>::GetMatrixArray() { return fElements; }
224
225template <class Element> inline TMatrixT<Element> &TMatrixT<Element>::Use (Int_t nrows,Int_t ncols,Element *data)
226 { return Use(0,nrows-1,0,ncols-1,data); }
227template <class Element> inline const TMatrixT<Element> &TMatrixT<Element>::Use (Int_t nrows,Int_t ncols,const Element *data) const
228 { return Use(0,nrows-1,0,ncols-1,data); }
229template <class Element> inline TMatrixT<Element> &TMatrixT<Element>::Use (TMatrixT &a)
230 {
231 R__ASSERT(a.IsValid());
232 return Use(a.GetRowLwb(),a.GetRowUpb(),
233 a.GetColLwb(),a.GetColUpb(),a.GetMatrixArray());
234 }
235template <class Element> inline const TMatrixT<Element> &TMatrixT<Element>::Use (const TMatrixT &a) const
236 {
237 R__ASSERT(a.IsValid());
238 return Use(a.GetRowLwb(),a.GetRowUpb(),
239 a.GetColLwb(),a.GetColUpb(),a.GetMatrixArray());
240 }
241
242template <class Element> inline TMatrixT<Element> TMatrixT<Element>::GetSub (Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,
243 Option_t *option) const
244 {
245 TMatrixT tmp;
246 this->GetSub(row_lwb,row_upb,col_lwb,col_upb,tmp,option);
247 return tmp;
248 }
249
250template <class Element> inline Element TMatrixT<Element>::operator()(Int_t rown,Int_t coln) const
251{
252 R__ASSERT(this->IsValid());
253 const Int_t arown = rown-this->fRowLwb;
254 const Int_t acoln = coln-this->fColLwb;
255 if (arown >= this->fNrows || arown < 0) {
256 Error("operator()","Request row(%d) outside matrix range of %d - %d",rown,this->fRowLwb,this->fRowLwb+this->fNrows);
258 }
259 if (acoln >= this->fNcols || acoln < 0) {
260 Error("operator()","Request column(%d) outside matrix range of %d - %d",coln,this->fColLwb,this->fColLwb+this->fNcols);
262
263 }
264 return (fElements[arown*this->fNcols+acoln]);
265}
266
267template <class Element> inline Element &TMatrixT<Element>::operator()(Int_t rown,Int_t coln)
268{
269 R__ASSERT(this->IsValid());
270 const Int_t arown = rown-this->fRowLwb;
271 const Int_t acoln = coln-this->fColLwb;
272 if (arown >= this->fNrows || arown < 0) {
273 Error("operator()","Request row(%d) outside matrix range of %d - %d",rown,this->fRowLwb,this->fRowLwb+this->fNrows);
275 }
276 if (acoln >= this->fNcols || acoln < 0) {
277 Error("operator()","Request column(%d) outside matrix range of %d - %d",coln,this->fColLwb,this->fColLwb+this->fNcols);
279 }
280 return (fElements[arown*this->fNcols+acoln]);
281}
282
283template <class Element> TMatrixT<Element> operator+ (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
284template <class Element> TMatrixT<Element> operator+ (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
285template <class Element> TMatrixT<Element> operator+ (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
286template <class Element> TMatrixT<Element> operator+ (const TMatrixT <Element> &source , Element val );
287template <class Element> TMatrixT<Element> operator+ ( Element val ,const TMatrixT <Element> &source );
288template <class Element> TMatrixT<Element> operator- (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
289template <class Element> TMatrixT<Element> operator- (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
290template <class Element> TMatrixT<Element> operator- (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
291template <class Element> TMatrixT<Element> operator- (const TMatrixT <Element> &source , Element val );
292template <class Element> TMatrixT<Element> operator- ( Element val ,const TMatrixT <Element> &source );
293template <class Element> TMatrixT<Element> operator* ( Element val ,const TMatrixT <Element> &source );
294template <class Element> TMatrixT<Element> operator* (const TMatrixT <Element> &source , Element val );
295template <class Element> TMatrixT<Element> operator* (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
296template <class Element> TMatrixT<Element> operator* (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
297template <class Element> TMatrixT<Element> operator* (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
298template <class Element> TMatrixT<Element> operator* (const TMatrixTSym<Element> &source1,const TMatrixTSym<Element> &source2);
299// Preventing warnings with -Weffc++ in GCC since overloading the || and && operators was a design choice.
300#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
301#pragma GCC diagnostic push
302#pragma GCC diagnostic ignored "-Weffc++"
303#endif
304template <class Element> TMatrixT<Element> operator&& (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
305template <class Element> TMatrixT<Element> operator&& (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
306template <class Element> TMatrixT<Element> operator&& (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
307template <class Element> TMatrixT<Element> operator|| (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
308template <class Element> TMatrixT<Element> operator|| (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
309template <class Element> TMatrixT<Element> operator|| (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
310#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
311#pragma GCC diagnostic pop
312#endif
313template <class Element> TMatrixT<Element> operator> (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
314template <class Element> TMatrixT<Element> operator> (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
315template <class Element> TMatrixT<Element> operator> (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
316template <class Element> TMatrixT<Element> operator>= (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
317template <class Element> TMatrixT<Element> operator>= (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
318template <class Element> TMatrixT<Element> operator>= (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
319template <class Element> TMatrixT<Element> operator<= (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
320template <class Element> TMatrixT<Element> operator<= (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
321template <class Element> TMatrixT<Element> operator<= (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
322template <class Element> TMatrixT<Element> operator< (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
323template <class Element> TMatrixT<Element> operator< (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
324template <class Element> TMatrixT<Element> operator< (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
325template <class Element> TMatrixT<Element> operator!= (const TMatrixT <Element> &source1,const TMatrixT <Element> &source2);
326template <class Element> TMatrixT<Element> operator!= (const TMatrixT <Element> &source1,const TMatrixTSym<Element> &source2);
327template <class Element> TMatrixT<Element> operator!= (const TMatrixTSym<Element> &source1,const TMatrixT <Element> &source2);
328
329template <class Element> TMatrixT<Element> &Add (TMatrixT<Element> &target, Element scalar,const TMatrixT <Element> &source);
330template <class Element> TMatrixT<Element> &Add (TMatrixT<Element> &target, Element scalar,const TMatrixTSym<Element> &source);
331template <class Element> TMatrixT<Element> &ElementMult(TMatrixT<Element> &target,const TMatrixT <Element> &source);
332template <class Element> TMatrixT<Element> &ElementMult(TMatrixT<Element> &target,const TMatrixTSym<Element> &source);
333template <class Element> TMatrixT<Element> &ElementDiv (TMatrixT<Element> &target,const TMatrixT <Element> &source);
334template <class Element> TMatrixT<Element> &ElementDiv (TMatrixT<Element> &target,const TMatrixTSym<Element> &source);
335
336template <class Element> void AMultB (const Element * const ap,Int_t na,Int_t ncolsa,
337 const Element * const bp,Int_t nb,Int_t ncolsb,Element *cp);
338template <class Element> void AtMultB(const Element * const ap,Int_t ncolsa,
339 const Element * const bp,Int_t nb,Int_t ncolsb,Element *cp);
340template <class Element> void AMultBt(const Element * const ap,Int_t na,Int_t ncolsa,
341 const Element * const bp,Int_t nb,Int_t ncolsb,Element *cp);
342
343#endif
SVector< double, 2 > v
Definition: Dict.h:5
#define b(i)
Definition: RSha256.hxx:100
static Int_t init()
int Int_t
Definition: RtypesCore.h:41
double Double_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
#define R__ASSERT(e)
Definition: TError.h:96
void Error(const char *location, const char *msgfmt,...)
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 .
TMatrixT< Element > operator<(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 < source2
Definition: TMatrixT.cxx:2784
TMatrixT< Element > operator>=(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 >= source2
Definition: TMatrixT.cxx:2662
TMatrixT< Element > operator||(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical OR.
Definition: TMatrixT.cxx:2542
TMatrixT< Element > & ElementMult(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Multiply target by the source, element-by-element.
Definition: TMatrixT.cxx:2981
TMatrixT< Element > operator!=(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 != source2
Definition: TMatrixT.cxx:2843
TMatrixT< Element > operator*(Element val, const TMatrixT< Element > &source)
operation this = val*source
Definition: TMatrixT.cxx:2423
TMatrixT< Element > operator<=(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 <= source2
Definition: TMatrixT.cxx:2723
TMatrixT< Element > & ElementDiv(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Divide target by the source, element-by-element.
Definition: TMatrixT.cxx:3021
void AtMultB(const Element *const ap, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A^T*B.
Definition: TMatrixT.cxx:3100
TMatrixT< Element > operator>(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 > source2
Definition: TMatrixT.cxx:2601
TMatrixT< Element > operator-(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
operation this = source1-source2
Definition: TMatrixT.cxx:2372
TMatrixT< Element > operator+(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
operation this = source1+source2
Definition: TMatrixT.cxx:2321
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.
Definition: TMatrixT.cxx:2933
void AMultBt(const Element *const ap, Int_t na, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A*B^T.
Definition: TMatrixT.cxx:3124
TMatrixT< Element > operator&&(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical AND.
Definition: TMatrixT.cxx:2483
void AMultB(const Element *const ap, Int_t na, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A*B.
Definition: TMatrixT.cxx:3077
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
Linear Algebra Package.
Definition: TMatrixTBase.h:85
Int_t GetNrows() const
Definition: TMatrixTBase.h:124
Bool_t fIsOwner
Definition: TMatrixTBase.h:101
Element fTol
Definition: TMatrixTBase.h:98
Int_t GetRowLwb() const
Definition: TMatrixTBase.h:122
Int_t GetColLwb() const
Definition: TMatrixTBase.h:125
static Element & NaNValue()
Bool_t IsValid() const
Definition: TMatrixTBase.h:147
Int_t GetNcols() const
Definition: TMatrixTBase.h:127
Element GetTol() const
Definition: TMatrixTBase.h:129
Templates of Lazy Matrix classes.
Definition: TMatrixTLazy.h:43
TMatrixTSparse.
TMatrixTSym.
Definition: TMatrixTSym.h:34
TMatrixT.
Definition: TMatrixT.h:39
void MultT(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
Definition: TMatrixT.h:108
TMatrixT< Element > & Rank1Update(const TVectorT< Element > &v, Element alpha=1.0)
Perform a rank 1 operation on matrix A: A += alpha * v * v^T.
Definition: TMatrixT.cxx:1539
const TMatrixT< Element > & Use(Int_t nrows, Int_t ncols, const Element *data) const
Definition: TMatrixT.h:227
void TMult(const TMatrixTSym< Element > &a, const TMatrixT< Element > &b)
Definition: TMatrixT.h:102
TMatrixT< Element > & Use(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, Element *data)
Use the array data to fill the matrix ([row_lwb..row_upb] x [col_lwb..col_upb])
Definition: TMatrixT.cxx:1053
const TMatrixTRow_const< Element > operator[](Int_t rown) const
Definition: TMatrixT.h:163
void Delete_m(Int_t size, Element *&)
Delete data pointer m, if it was assigned on the heap.
Definition: TMatrixT.cxx:407
TClass * Class()
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1)
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
Definition: TMatrixT.cxx:1210
virtual ~TMatrixT()
Definition: TMatrixT.h:83
TMatrixT< Element > & operator*=(Element val)
Multiply every element of the matrix with val.
Definition: TMatrixT.cxx:1874
TMatrixT< Element > GetSub(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, Option_t *option="S") const
Definition: TMatrixT.h:242
Element fDataStack[TMatrixTBase< Element >::kSizeMax]
Definition: TMatrixT.h:43
TMatrixT(const TMatrixT< Element2 > &another)
Definition: TMatrixT.h:69
TMatrixT< Element > & Use(TMatrixT< Element > &a)
Definition: TMatrixT.h:229
virtual const Element * GetMatrixArray() const
Definition: TMatrixT.h:222
TMatrixT< Element > & T()
Definition: TMatrixT.h:150
TMatrixT< Element > & operator=(const TMatrixT< Element > &source)
Assignment operator.
Definition: TMatrixT.cxx:1732
const TMatrixT< Element > & Use(const TMatrixT< Element > &a) const
Definition: TMatrixT.h:235
TMatrixT< Element > & NormByRow(const TVectorT< Element > &v, Option_t *option="D")
Multiply/divide matrix rows with a vector: option: "D" : b(i,j) = a(i,j)/v(j) i = 0,...
Definition: TMatrixT.cxx:1689
void MultT(const TMatrixT< Element > &a, const TMatrixTSym< Element > &b)
Definition: TMatrixT.h:106
EMatrixCreatorsOp2
Definition: TMatrixT.h:59
@ kMult
Definition: TMatrixT.h:59
@ kMultTranspose
Definition: TMatrixT.h:59
@ kTransposeMult
Definition: TMatrixT.h:59
@ kInvMult
Definition: TMatrixT.h:59
@ kMinus
Definition: TMatrixT.h:59
@ kPlus
Definition: TMatrixT.h:59
virtual TMatrixTBase< Element > & SetColIndexArray(Int_t *)
Definition: TMatrixT.h:118
void Minus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix summation. Create a matrix C such that C = A - B.
Definition: TMatrixT.cxx:580
Element Similarity(const TVectorT< Element > &v) const
Calculate scalar v * (*this) * v^T.
Definition: TMatrixT.cxx:1601
TMatrixT< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant.
Definition: TMatrixT.cxx:1396
virtual Double_t Determinant() const
Return the matrix determinant.
Definition: TMatrixT.cxx:1361
TMatrixT< Element > & Use(Int_t nrows, Int_t ncols, Element *data)
Definition: TMatrixT.h:225
void Plus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix summation. Create a matrix C such that C = A + B.
Definition: TMatrixT.cxx:512
TMatrixTBase< Element > & ResizeTo(const TMatrixT< Element > &m)
Definition: TMatrixT.h:140
virtual TMatrixTBase< Element > & SetRowIndexArray(Int_t *)
Definition: TMatrixT.h:117
virtual void Clear(Option_t *="")
Definition: TMatrixT.h:120
virtual const Int_t * GetRowIndexArray() const
Definition: TMatrixT.h:112
void Minus(const TMatrixTSym< Element > &a, const TMatrixT< Element > &b)
Definition: TMatrixT.h:93
TMatrixT< Element > & InvertFast(Double_t *det=0)
Invert the matrix and calculate its determinant, however upto (6x6) a fast Cramer inversion is used .
Definition: TMatrixT.cxx:1410
virtual Element * GetMatrixArray()
Definition: TMatrixT.h:223
TMatrixT< Element > & operator-=(Element val)
Subtract val from every element of the matrix.
Definition: TMatrixT.cxx:1858
TMatrixT< Element > & Transpose(const TMatrixT< Element > &source)
Transpose matrix source.
Definition: TMatrixT.cxx:1469
void MultT(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Create a matrix C such that C = A * B^T.
Definition: TMatrixT.cxx:951
virtual TMatrixTBase< Element > & SetSub(Int_t row_lwb, Int_t col_lwb, const TMatrixTBase< Element > &source)
Insert matrix source starting at [row_lwb][col_lwb], thereby overwriting the part [row_lwb....
Definition: TMatrixT.cxx:1156
void TMult(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
Definition: TMatrixT.h:103
@ kWorkMax
Definition: TMatrixT.h:57
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
Get submatrix [row_lwb..row_upb] x [col_lwb..col_upb]; The indexing range of the returned matrix depe...
Definition: TMatrixT.cxx:1089
Element operator()(Int_t rown, Int_t coln) const
Definition: TMatrixT.h:250
Element * New_m(Int_t size)
Return data pointer .
Definition: TMatrixT.cxx:421
EMatrixCreatorsOp1
Definition: TMatrixT.h:58
@ kZero
Definition: TMatrixT.h:58
@ kAtA
Definition: TMatrixT.h:58
@ kUnit
Definition: TMatrixT.h:58
@ kInverted
Definition: TMatrixT.h:58
@ kTransposed
Definition: TMatrixT.h:58
virtual const Int_t * GetColIndexArray() const
Definition: TMatrixT.h:114
TMatrixTRow< Element > operator[](Int_t rown)
Definition: TMatrixT.h:164
virtual Int_t * GetColIndexArray()
Definition: TMatrixT.h:115
virtual Int_t * GetRowIndexArray()
Definition: TMatrixT.h:113
void Allocate(Int_t nrows, Int_t ncols, Int_t row_lwb=0, Int_t col_lwb=0, Int_t init=0, Int_t=-1)
Allocate new matrix.
Definition: TMatrixT.cxx:466
TMatrixT()
Definition: TMatrixT.h:61
void Plus(const TMatrixTSym< Element > &a, const TMatrixT< Element > &b)
Definition: TMatrixT.h:89
TMatrixT< Element > & operator+=(Element val)
Add val to every element of the matrix.
Definition: TMatrixT.cxx:1842
TMatrixT< Element > & NormByColumn(const TVectorT< Element > &v, Option_t *option="D")
Multiply/divide matrix columns by a vector: option: "D" : b(i,j) = a(i,j)/v(i) i = 0,...
Definition: TMatrixT.cxx:1642
Element & operator()(Int_t rown, Int_t coln)
Definition: TMatrixT.h:267
void TMult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
Create a matrix C such that C = A' * B.
Definition: TMatrixT.cxx:852
const TMatrixT< Element > EigenVectors(TVectorT< Element > &eigenValues) const
Return a matrix containing the eigen-vectors ordered by descending values of Re^2+Im^2 of the complex...
Definition: TMatrixT.cxx:2307
void Mult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Create a matrix C such that C = A * B.
Definition: TMatrixT.cxx:648
Element * fElements
data container
Definition: TMatrixT.h:44
Int_t Memcpy_m(Element *newp, const Element *oldp, Int_t copySize, Int_t newSize, Int_t oldSize)
Copy copySize doubles from *oldp to *newp .
Definition: TMatrixT.cxx:439
TMatrixT< Element > & operator/=(const TMatrixTDiag_const< Element > &diag)
Divide a matrix row by the diagonal of another matrix matrix(i,j) /= diag(j)
Definition: TMatrixT.cxx:2127
const TMatrixT< Element > & Use(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, const Element *data) const
Definition: TMatrixT.h:125
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Definition: TObject.h:268
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
Definition: TObject.cxx:933
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
TVectorT.
Definition: TVectorT.h:27
TPaveText * pt
static constexpr double ps
auto * m
Definition: textangle.C:8
auto * a
Definition: textangle.C:12