Logo ROOT  
Reference Guide
TMatrixTSparse.h
Go to the documentation of this file.
1 // @(#)root/matrix:$Id$
2 // Authors: Fons Rademakers, Eddy Offermann Feb 2004
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_TMatrixTSparse
13 #define ROOT_TMatrixTSparse
14 
15 #include "TMatrixTBase.h"
16 #include "TMatrixTUtils.h"
17 
18 #include <cstring>
19 
20 #ifdef CBLAS
21 #include <vecLib/vBLAS.h>
22 //#include <cblas.h>
23 #endif
24 
25 //////////////////////////////////////////////////////////////////////////
26 // //
27 // TMatrixTSparse //
28 // //
29 // Template class of a general sparse matrix in the Harwell-Boeing //
30 // format //
31 // //
32 //////////////////////////////////////////////////////////////////////////
33 
34 template<class Element> class TMatrixT;
35 
36 template<class Element> class TMatrixTSparse : public TMatrixTBase<Element> {
37 
38 protected:
39 
40  Int_t *fRowIndex; //[fNrowIndex] row index
41  Int_t *fColIndex; //[fNelems] column index
42  Element *fElements; //[fNelems]
43 
44  void Allocate(Int_t nrows,Int_t ncols,Int_t row_lwb = 0,Int_t col_lwb = 0,
45  Int_t init = 0,Int_t nr_nonzeros = 0);
46 
47  // Elementary constructors
50  void AMultB (const TMatrixTSparse<Element> &a,const TMatrixT<Element> &b,Int_t constr=0) {
51  const TMatrixTSparse<Element> bsp = b;
53  void AMultB (const TMatrixT<Element> &a,const TMatrixTSparse<Element> &b,Int_t constr=0) {
55 
56  void AMultBt(const TMatrixTSparse<Element> &a,const TMatrixTSparse<Element> &b,Int_t constr=0);
57  void AMultBt(const TMatrixTSparse<Element> &a,const TMatrixT<Element> &b,Int_t constr=0);
58  void AMultBt(const TMatrixT<Element> &a,const TMatrixTSparse<Element> &b,Int_t constr=0);
59 
60  void APlusB (const TMatrixTSparse<Element> &a,const TMatrixTSparse<Element> &b,Int_t constr=0);
61  void APlusB (const TMatrixTSparse<Element> &a,const TMatrixT<Element> &b,Int_t constr=0);
62  void APlusB (const TMatrixT<Element> &a,const TMatrixTSparse<Element> &b,Int_t constr=0) { APlusB(b,a,constr); }
63 
64  void AMinusB(const TMatrixTSparse<Element> &a,const TMatrixTSparse<Element> &b,Int_t constr=0);
65  void AMinusB(const TMatrixTSparse<Element> &a,const TMatrixT<Element> &b,Int_t constr=0);
66  void AMinusB(const TMatrixT<Element> &a,const TMatrixTSparse<Element> &b,Int_t constr=0);
67 
68 public:
69 
72 
74  TMatrixTSparse(Int_t nrows,Int_t ncols);
75  TMatrixTSparse(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
76  TMatrixTSparse(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,Int_t nr_nonzeros,
77  Int_t *row, Int_t *col,Element *data);
79  TMatrixTSparse(const TMatrixT<Element> &another);
80 
85 
87 
88  virtual const Element *GetMatrixArray () const;
89  virtual Element *GetMatrixArray ();
90  virtual const Int_t *GetRowIndexArray() const;
91  virtual Int_t *GetRowIndexArray();
92  virtual const Int_t *GetColIndexArray() const;
93  virtual Int_t *GetColIndexArray();
94 
95  virtual TMatrixTBase<Element> &SetRowIndexArray(Int_t *data) { memmove(fRowIndex,data,(this->fNrows+1)*sizeof(Int_t)); return *this; }
96  virtual TMatrixTBase<Element> &SetColIndexArray(Int_t *data) { memmove(fColIndex,data,this->fNelems*sizeof(Int_t)); return *this; }
97 
103  { return SetSparseIndexAB(b,a); }
104 
105  virtual void GetMatrix2Array (Element *data,Option_t * /*option*/ ="") const;
106  virtual TMatrixTBase<Element> &SetMatrixArray (const Element *data,Option_t * /*option*/="")
107  { memcpy(fElements,data,this->fNelems*sizeof(Element)); return *this; }
108  virtual TMatrixTBase<Element> &SetMatrixArray (Int_t nr_nonzeros,Int_t *irow,Int_t *icol,Element *data);
109  virtual TMatrixTBase<Element> &InsertRow (Int_t row,Int_t col,const Element *v,Int_t n=-1);
110  virtual void ExtractRow (Int_t row,Int_t col, Element *v,Int_t n=-1) const;
111 
112  virtual TMatrixTBase<Element> &ResizeTo(Int_t nrows,Int_t ncols,Int_t nr_nonzeros=-1);
113  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);
114  inline TMatrixTBase<Element> &ResizeTo(const TMatrixTSparse<Element> &m) {return ResizeTo(m.GetRowLwb(),m.GetRowUpb(),m.GetColLwb(),
115  m.GetColUpb(),m.GetNoElements()); }
116 
117  virtual void Clear(Option_t * /*option*/ ="") { if (this->fIsOwner) {
118  if (fElements) { delete [] fElements; fElements = 0; }
119  if (fRowIndex) { delete [] fRowIndex; fRowIndex = 0; }
120  if (fColIndex) { delete [] fColIndex; fColIndex = 0; }
121  }
122  this->fNelems = 0;
123  this->fNrowIndex = 0;
124  }
125 
126  TMatrixTSparse<Element> &Use (Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,Int_t nr_nonzeros,
127  Int_t *pRowIndex,Int_t *pColIndex,Element *pData);
128  const TMatrixTSparse<Element> &Use (Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,Int_t nr_nonzeros,
129  const Int_t *pRowIndex,const Int_t *pColIndex,const Element *pData) const
130  { return (const TMatrixTSparse<Element>&)
131  ((const_cast<TMatrixTSparse<Element> *>(this))->Use(row_lwb,row_upb,col_lwb,col_upb,nr_nonzeros,
132  const_cast<Int_t *>(pRowIndex),
133  const_cast<Int_t *>(pColIndex),
134  const_cast<Element *>(pData))); }
135  TMatrixTSparse<Element> &Use (Int_t nrows,Int_t ncols,Int_t nr_nonzeros,
136  Int_t *pRowIndex,Int_t *pColIndex,Element *pData);
137  const TMatrixTSparse<Element> &Use (Int_t nrows,Int_t ncols,Int_t nr_nonzeros,
138  const Int_t *pRowIndex,const Int_t *pColIndex,const Element *pData) const;
141 
142  virtual TMatrixTBase<Element> &GetSub(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,
143  TMatrixTBase<Element> &target,Option_t *option="S") const;
144  TMatrixTSparse<Element> GetSub(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,Option_t *option="S") const;
145  virtual TMatrixTBase<Element> &SetSub(Int_t row_lwb,Int_t col_lwb,const TMatrixTBase<Element> &source);
146 
147  virtual Bool_t IsSymmetric() const { return (*this == TMatrixTSparse<Element>(kTransposed,*this)); }
149  inline TMatrixTSparse<Element> &T () { return this->Transpose(*this); }
150 
151  inline void Mult(const TMatrixTSparse<Element> &a,const TMatrixTSparse<Element> &b) { AMultB(a,b,0); }
152 
153  virtual TMatrixTBase<Element> &Zero ();
154  virtual TMatrixTBase<Element> &UnitMatrix ();
155 
156  virtual Element RowNorm () const;
157  virtual Element ColNorm () const;
158  virtual Int_t NonZeros() const { return this->fNelems; }
159 
160  virtual TMatrixTBase<Element> &NormByDiag(const TVectorT<Element> &/*v*/,Option_t * /*option*/)
161  { MayNotUse("NormByDiag"); return *this; }
162 
163  // Either access a_ij as a(i,j)
164  Element operator()(Int_t rown,Int_t coln) const;
165  Element &operator()(Int_t rown,Int_t coln);
166 
167  // or as a[i][j]
170 
173 
174  TMatrixTSparse<Element> &operator= (Element val);
175  TMatrixTSparse<Element> &operator-=(Element val);
176  TMatrixTSparse<Element> &operator+=(Element val);
177  TMatrixTSparse<Element> &operator*=(Element val);
178 
180  if (this == &source) APlusB (tmp,tmp,1);
181  else APlusB (tmp,source,1);
182  return *this; }
184  APlusB(tmp,source,1); return *this; }
186  if (this == &source) AMinusB (tmp,tmp,1);
187  else AMinusB(tmp,source,1);
188  return *this; }
190  AMinusB(tmp,source,1); return *this; }
192  if (this == &source) AMultB (tmp,tmp,1);
193  else AMultB (tmp,source,1);
194  return *this; }
196  AMultB(tmp,source,1);
197  return *this; }
198 
199  virtual TMatrixTBase <Element> &Randomize (Element alpha,Element beta,Double_t &seed);
200  virtual TMatrixTSparse<Element> &RandomizePD(Element alpha,Element beta,Double_t &seed);
201 
202  ClassDef(TMatrixTSparse,3) // Template of Sparse Matrix class
203 };
204 
205 #ifndef __CINT__
206 // When building with -fmodules, it instantiates all pending instantiations,
207 // instead of delaying them until the end of the translation unit.
208 // We 'got away with' probably because the use and the definition of the
209 // explicit specialization do not occur in the same TU.
210 //
211 // In case we are building with -fmodules, we need to forward declare the
212 // specialization in order to compile the dictionary G__Matrix.cxx.
214 #endif // __CINT__
215 
216 template <class Element> inline const Element *TMatrixTSparse<Element>::GetMatrixArray () const { return fElements; }
217 template <class Element> inline Element *TMatrixTSparse<Element>::GetMatrixArray () { return fElements; }
218 template <class Element> inline const Int_t *TMatrixTSparse<Element>::GetRowIndexArray() const { return fRowIndex; }
219 template <class Element> inline Int_t *TMatrixTSparse<Element>::GetRowIndexArray() { return fRowIndex; }
220 template <class Element> inline const Int_t *TMatrixTSparse<Element>::GetColIndexArray() const { return fColIndex; }
221 template <class Element> inline Int_t *TMatrixTSparse<Element>::GetColIndexArray() { return fColIndex; }
222 
223 template <class Element>
225  Int_t *pRowIndex,Int_t *pColIndex,Element *pData)
226  { return Use(0,nrows-1,0,ncols-1,nr_nonzeros,pRowIndex,pColIndex,pData); }
227 template <class Element>
229  const Int_t *pRowIndex,const Int_t *pColIndex,const Element *pData) const
230  { return Use(0,nrows-1,0,ncols-1,nr_nonzeros,pRowIndex,pColIndex,pData); }
231 template <class Element>
233  { R__ASSERT(a.IsValid());
234  return Use(a.GetRowLwb(),a.GetRowUpb(),a.GetColLwb(),a.GetColUpb(),
235  a.GetNoElements(),a.GetRowIndexArray(),
236  a.GetColIndexArray(),a.GetMatrixArray()); }
237 template <class Element>
239  { R__ASSERT(a.IsValid());
240  return Use(a.GetRowLwb(),a.GetRowUpb(),a.GetColLwb(),a.GetColUpb(),
241  a.GetNoElements(),a.GetRowIndexArray(),
242  a.GetColIndexArray(),a.GetMatrixArray()); }
243 
244 template <class Element>
246  Option_t *option) const
247  {
249  this->GetSub(row_lwb,row_upb,col_lwb,col_upb,tmp,option);
250  return tmp;
251  }
252 
253 template <class Element> TMatrixTSparse<Element> operator+ (const TMatrixTSparse<Element> &source1,const TMatrixTSparse<Element> &source2);
254 template <class Element> TMatrixTSparse<Element> operator+ (const TMatrixTSparse<Element> &source1,const TMatrixT<Element> &source2);
255 template <class Element> TMatrixTSparse<Element> operator+ (const TMatrixT<Element> &source1,const TMatrixTSparse<Element> &source2);
256 template <class Element> TMatrixTSparse<Element> operator+ (const TMatrixTSparse<Element> &source , Element val );
257 template <class Element> TMatrixTSparse<Element> operator+ ( Element val ,const TMatrixTSparse<Element> &source );
258 template <class Element> TMatrixTSparse<Element> operator- (const TMatrixTSparse<Element> &source1,const TMatrixTSparse<Element> &source2);
259 template <class Element> TMatrixTSparse<Element> operator- (const TMatrixTSparse<Element> &source1,const TMatrixT<Element> &source2);
260 template <class Element> TMatrixTSparse<Element> operator- (const TMatrixT<Element> &source1,const TMatrixTSparse<Element> &source2);
261 template <class Element> TMatrixTSparse<Element> operator- (const TMatrixTSparse<Element> &source , Element val );
262 template <class Element> TMatrixTSparse<Element> operator- ( Element val ,const TMatrixTSparse<Element> &source );
263 template <class Element> TMatrixTSparse<Element> operator* (const TMatrixTSparse<Element> &source1,const TMatrixTSparse<Element> &source2);
264 template <class Element> TMatrixTSparse<Element> operator* (const TMatrixTSparse<Element> &source1,const TMatrixT<Element> &source2);
265 template <class Element> TMatrixTSparse<Element> operator* (const TMatrixT<Element> &source1,const TMatrixTSparse<Element> &source2);
266 template <class Element> TMatrixTSparse<Element> operator* ( Element val ,const TMatrixTSparse<Element> &source );
267 template <class Element> TMatrixTSparse<Element> operator* (const TMatrixTSparse<Element> &source, Element val );
268 
269 template <class Element> TMatrixTSparse<Element> &Add (TMatrixTSparse<Element> &target, Element scalar,
270  const TMatrixTSparse<Element> &source);
271 template <class Element> TMatrixTSparse<Element> &ElementMult(TMatrixTSparse<Element> &target,const TMatrixTSparse<Element> &source);
272 template <class Element> TMatrixTSparse<Element> &ElementDiv (TMatrixTSparse<Element> &target,const TMatrixTSparse<Element> &source);
273 
274 template <class Element> Bool_t AreCompatible(const TMatrixTSparse<Element> &m1,const TMatrixTSparse<Element> &m2,Int_t verbose=0);
275 
276 #endif
operator-
TMatrixTSparse< Element > operator-(const TMatrixTSparse< Element > &source1, const TMatrixTSparse< Element > &source2)
Definition: TMatrixTSparse.cxx:2579
TMatrixTSparse::operator-=
TMatrixTSparse< Element > & operator-=(Element val)
Subtract val from every element of the matrix.
Definition: TMatrixTSparse.cxx:2324
MayNotUse
void MayNotUse(const char *method)
This function can be used in classes that should override a certain function, but in the inherited cl...
Definition: TError.cxx:170
m
auto * m
Definition: textangle.C:8
n
const Int_t n
Definition: legend1.C:16
TMatrixTSparse::operator+=
TMatrixTSparse< Element > & operator+=(const TMatrixTSparse< Element > &source)
Definition: TMatrixTSparse.h:179
TMatrixTSparse::Allocate
void Allocate(Int_t nrows, Int_t ncols, Int_t row_lwb=0, Int_t col_lwb=0, Int_t init=0, Int_t nr_nonzeros=0)
Allocate new matrix.
Definition: TMatrixTSparse.cxx:325
TMatrixTSparse::AMultB
void AMultB(const TMatrixT< Element > &a, const TMatrixTSparse< Element > &b, Int_t constr=0)
Definition: TMatrixTSparse.h:53
TMatrixTSparse::AMultBt
void AMultBt(const TMatrixTSparse< Element > &a, const TMatrixTSparse< Element > &b, Int_t constr=0)
General matrix multiplication.
Definition: TMatrixTSparse.cxx:491
Option_t
const char Option_t
Definition: RtypesCore.h:66
TMatrixTSparse::SetMatrixArray
virtual TMatrixTBase< Element > & SetMatrixArray(const Element *data, Option_t *="")
Definition: TMatrixTSparse.h:106
TMatrixTSparse::SetColIndexArray
virtual TMatrixTBase< Element > & SetColIndexArray(Int_t *data)
Definition: TMatrixTSparse.h:96
TMatrixTSparseRow
Definition: TMatrixTUtils.h:615
TMatrixTSparse< Double_t >::EMatrixCreatorsOp1
EMatrixCreatorsOp1
Definition: TMatrixTSparse.h:70
TMatrixTSparse::GetMatrix2Array
virtual void GetMatrix2Array(Element *data, Option_t *="") const
Copy matrix data to array . It is assumed that array is of size >= fNelems.
Definition: TMatrixTSparse.cxx:1158
TMatrixTSparse::GetColIndexArray
virtual const Int_t * GetColIndexArray() const
Definition: TMatrixTSparse.h:220
TMatrixTSparse::UnitMatrix
virtual TMatrixTBase< Element > & UnitMatrix()
Make a unit matrix (matrix need not be a square one).
Definition: TMatrixTSparse.cxx:2058
TMatrixTUtils.h
TMatrixTSparse::kZero
@ kZero
Definition: TMatrixTSparse.h:70
operator+
TMatrixTSparse< Element > operator+(const TMatrixTSparse< Element > &source1, const TMatrixTSparse< Element > &source2)
Definition: TMatrixTSparse.cxx:2532
TMatrixTSparse::GetRowIndexArray
virtual const Int_t * GetRowIndexArray() const
Definition: TMatrixTSparse.h:218
BatchHelpers::init
EvaluateInfo init(std::vector< RooRealProxy > parameters, std::vector< ArrayWrapper * > wrappers, std::vector< double * > arrays, size_t begin, size_t batchSize)
Int_t
int Int_t
Definition: RtypesCore.h:45
TMatrixTSparse::AMultB
void AMultB(const TMatrixTSparse< Element > &a, const TMatrixTSparse< Element > &b, Int_t constr=0)
Definition: TMatrixTSparse.h:48
TMatrixTSparse::operator()
Element operator()(Int_t rown, Int_t coln) const
Definition: TMatrixTSparse.cxx:2201
TMatrixTSparse::kAtA
@ kAtA
Definition: TMatrixTSparse.h:70
TMatrixTSparse::operator+=
TMatrixTSparse< Element > & operator+=(Element val)
Add val to every element of the matrix.
Definition: TMatrixTSparse.cxx:2308
TMatrixTSparse::operator*=
TMatrixTSparse< Element > & operator*=(const TMatrixT< Element > &source)
Definition: TMatrixTSparse.h:195
TMatrixTSparse::fRowIndex
Int_t * fRowIndex
Definition: TMatrixTSparse.h:40
TMatrixTSparse::GetRowIndexArray
virtual Int_t * GetRowIndexArray()
Definition: TMatrixTSparse.h:219
TMatrixTSparse::Use
TMatrixTSparse< Element > & Use(Int_t nrows, Int_t ncols, Int_t nr_nonzeros, Int_t *pRowIndex, Int_t *pColIndex, Element *pData)
Definition: TMatrixTSparse.h:224
TMatrixTSparse::NonZeros
virtual Int_t NonZeros() const
Definition: TMatrixTSparse.h:158
TMatrixT
TMatrixT.
Definition: TMatrixT.h:39
TMatrixTSparse::Use
const TMatrixTSparse< Element > & Use(Int_t nrows, Int_t ncols, Int_t nr_nonzeros, const Int_t *pRowIndex, const Int_t *pColIndex, const Element *pData) const
Definition: TMatrixTSparse.h:228
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TMatrixTSparse::AMultB
void AMultB(const TMatrixTSparse< Element > &a, const TMatrixT< Element > &b, Int_t constr=0)
Definition: TMatrixTSparse.h:50
ROOT::Math::beta
double beta(double x, double y)
Calculates the beta function.
Definition: SpecFuncMathCore.cxx:111
TMatrixTSparse::operator-=
TMatrixTSparse< Element > & operator-=(const TMatrixTSparse< Element > &source)
Definition: TMatrixTSparse.h:185
v
@ v
Definition: rootcling_impl.cxx:3635
b
#define b(i)
Definition: RSha256.hxx:100
TMatrixTSparse::Randomize
virtual TMatrixTBase< Element > & Randomize(Element alpha, Element beta, Double_t &seed)
randomize matrix element values
Definition: TMatrixTSparse.cxx:2356
bool
TMatrixTSparse::Clear
virtual void Clear(Option_t *="")
Definition: TMatrixTSparse.h:117
TMatrixTSparse::operator=
TMatrixTSparse< Element > & operator=(const TMatrixT< Element > &source)
Notice that the sparsity of the matrix is NOT changed : its fRowIndex/fColIndex are used !
Definition: TMatrixTSparse.cxx:2256
TMatrixTSparse::SetSparseIndexAB
TMatrixTSparse< Element > & SetSparseIndexAB(const TMatrixTSparse< Element > &a, const TMatrixTSparse< Element > &b)
Set the row/column indices to the "sum" of matrices a and b It is checked that enough space has been ...
Definition: TMatrixTSparse.cxx:1339
TMatrixTSparse::kUnit
@ kUnit
Definition: TMatrixTSparse.h:70
AreCompatible
Bool_t AreCompatible(const TMatrixTSparse< Element > &m1, const TMatrixTSparse< Element > &m2, Int_t verbose=0)
Definition: TMatrixTSparse.cxx:2729
TGeant4Unit::m2
static constexpr double m2
Definition: TGeant4SystemOfUnits.h:123
TMatrixTSparse::kMult
@ kMult
Definition: TMatrixTSparse.h:71
TMatrixTSparse::TMatrixTSparse
TMatrixTSparse()
Definition: TMatrixTSparse.h:73
TMatrixTSparse::GetSub
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][col_lwb..col_upb]; The indexing range of the returned matrix depends...
Definition: TMatrixTSparse.cxx:1751
TMatrixTSparse::Use
TMatrixTSparse< Element > & Use(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, Int_t nr_nonzeros, Int_t *pRowIndex, Int_t *pColIndex, Element *pData)
Definition: TMatrixTSparse.cxx:1711
TMatrixTSparse::GetColIndexArray
virtual Int_t * GetColIndexArray()
Definition: TMatrixTSparse.h:221
TMatrixTSparse::operator[]
const TMatrixTSparseRow_const< Element > operator[](Int_t rown) const
Definition: TMatrixTSparse.h:168
a
auto * a
Definition: textangle.C:12
TMatrixTSparse::InsertRow
virtual TMatrixTBase< Element > & InsertRow(Int_t row, Int_t col, const Element *v, Int_t n=-1)
Insert in row rown, n elements of array v at column coln.
Definition: TMatrixTSparse.cxx:367
TMatrixTBase
TMatrixTBase.
Definition: TMatrixTBase.h:84
TMatrixTSparse::GetMatrixArray
virtual Element * GetMatrixArray()
Definition: TMatrixTSparse.h:217
TMatrixTSparse::Class
TClass * Class()
TMatrixTSparse::SetSparseIndex
TMatrixTSparse< Element > & SetSparseIndex(Int_t nelem_new)
Increase/decrease the number of non-zero elements to nelems_new.
Definition: TMatrixTSparse.cxx:1262
TMatrixTSparse::ExtractRow
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.
Definition: TMatrixTSparse.cxx:450
TMatrixTSparse::Use
const TMatrixTSparse< Element > & Use(const TMatrixTSparse< Element > &a) const
Definition: TMatrixTSparse.h:238
ElementDiv
TMatrixTSparse< Element > & ElementDiv(TMatrixTSparse< Element > &target, const TMatrixTSparse< Element > &source)
Divide target by the source, element-by-element.
Definition: TMatrixTSparse.cxx:2704
TMatrixTSparseRow_const
Definition: TMatrixTUtils.h:585
TMatrixTSparse::APlusB
void APlusB(const TMatrixT< Element > &a, const TMatrixTSparse< Element > &b, Int_t constr=0)
Definition: TMatrixTSparse.h:62
TMatrixTSparse::SetRowIndexArray
virtual TMatrixTBase< Element > & SetRowIndexArray(Int_t *data)
Definition: TMatrixTSparse.h:95
TMatrixTSparse::operator[]
TMatrixTSparseRow< Element > operator[](Int_t rown)
Definition: TMatrixTSparse.h:169
TMatrixTSparse::SetSub
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: TMatrixTSparse.cxx:1851
TMatrixTSparse::Zero
virtual TMatrixTBase< Element > & Zero()
Definition: TMatrixTSparse.cxx:2042
TMatrixTSparse::ResizeTo
TMatrixTBase< Element > & ResizeTo(const TMatrixTSparse< Element > &m)
Definition: TMatrixTSparse.h:114
TVectorT
TVectorT.
Definition: TVectorT.h:27
TMatrixTSparse::ColNorm
virtual Element ColNorm() const
Column matrix norm, MAX{ SUM{ |M(i,j)|, over i}, over j}.
Definition: TMatrixTSparse.cxx:2129
TMatrixTSparse
TMatrixTSparse.
Definition: TMatrixTSparse.h:36
Double_t
double Double_t
Definition: RtypesCore.h:59
operator*
TMatrixTSparse< Element > operator*(const TMatrixTSparse< Element > &source1, const TMatrixTSparse< Element > &source2)
Definition: TMatrixTSparse.cxx:2626
R__ASSERT
#define R__ASSERT(e)
Definition: TError.h:120
TMatrixTSparse::NormByDiag
virtual TMatrixTBase< Element > & NormByDiag(const TVectorT< Element > &, Option_t *)
Definition: TMatrixTSparse.h:160
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TMatrixTSparse::IsSymmetric
virtual Bool_t IsSymmetric() const
Definition: TMatrixTSparse.h:147
TMatrixTSparse::operator-=
TMatrixTSparse< Element > & operator-=(const TMatrixT< Element > &source)
Definition: TMatrixTSparse.h:189
TMatrixTSparse::Mult
void Mult(const TMatrixTSparse< Element > &a, const TMatrixTSparse< Element > &b)
Definition: TMatrixTSparse.h:151
TMatrixTSparse::ResizeTo
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t nr_nonzeros=-1)
Set size of the matrix to nrows x ncols with nr_nonzeros non-zero entries if nr_nonzeros > 0 .
Definition: TMatrixTSparse.cxx:1518
TMatrixTSparse::AMinusB
void AMinusB(const TMatrixTSparse< Element > &a, const TMatrixTSparse< Element > &b, Int_t constr=0)
General matrix subtraction.
Definition: TMatrixTSparse.cxx:935
TMatrixTSparse::Use
TMatrixTSparse< Element > & Use(TMatrixTSparse< Element > &a)
Definition: TMatrixTSparse.h:232
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMatrixTSparse::Transpose
TMatrixTSparse< Element > & Transpose(const TMatrixTSparse< Element > &source)
Transpose a matrix.
Definition: TMatrixTSparse.cxx:1987
TMatrixTSparse::kPlus
@ kPlus
Definition: TMatrixTSparse.h:71
TMatrixTSparse::T
TMatrixTSparse< Element > & T()
Definition: TMatrixTSparse.h:149
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
TMatrixTSparse::operator*=
TMatrixTSparse< Element > & operator*=(const TMatrixTSparse< Element > &source)
Definition: TMatrixTSparse.h:191
TMatrixTSparse::SetSparseIndexAB
TMatrixTSparse< Element > & SetSparseIndexAB(const TMatrixTSparse< Element > &a, const TMatrixT< Element > &b)
Definition: TMatrixTSparse.h:102
TMatrixTSparse::kMinus
@ kMinus
Definition: TMatrixTSparse.h:71
TMatrixTSparse::kTransposed
@ kTransposed
Definition: TMatrixTSparse.h:70
TMatrixTSparse::~TMatrixTSparse
virtual ~TMatrixTSparse()
Definition: TMatrixTSparse.h:86
TMatrixTSparse::RowNorm
virtual Element RowNorm() const
Row matrix norm, MAX{ SUM{ |M(i,j)|, over j}, over i}.
Definition: TMatrixTSparse.cxx:2100
TMatrixTSparse::APlusB
void APlusB(const TMatrixTSparse< Element > &a, const TMatrixTSparse< Element > &b, Int_t constr=0)
General matrix addition.
Definition: TMatrixTSparse.cxx:782
TMatrixTSparse::operator+=
TMatrixTSparse< Element > & operator+=(const TMatrixT< Element > &source)
Definition: TMatrixTSparse.h:183
TMatrixTSparse::fColIndex
Int_t * fColIndex
Definition: TMatrixTSparse.h:41
TMatrixTSparse::GetMatrixArray
virtual const Element * GetMatrixArray() const
Definition: TMatrixTSparse.h:216
TMatrixTBase.h
TMatrixTSparse::Use
const TMatrixTSparse< Element > & Use(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, Int_t nr_nonzeros, const Int_t *pRowIndex, const Int_t *pColIndex, const Element *pData) const
Definition: TMatrixTSparse.h:128
TMatrixTSparse::GetSub
TMatrixTSparse< Element > GetSub(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, Option_t *option="S") const
Definition: TMatrixTSparse.h:245
TMatrixTSparse::RandomizePD
virtual TMatrixTSparse< Element > & RandomizePD(Element alpha, Element beta, Double_t &seed)
randomize matrix element values but keep matrix symmetric positive definite
Definition: TMatrixTSparse.cxx:2403
TMatrixTSparse::operator*=
TMatrixTSparse< Element > & operator*=(Element val)
Multiply every element of the matrix with val.
Definition: TMatrixTSparse.cxx:2340
TMatrixTSparse::kMultTranspose
@ kMultTranspose
Definition: TMatrixTSparse.h:71
TMatrixTSparse< Double_t >::EMatrixCreatorsOp2
EMatrixCreatorsOp2
Definition: TMatrixTSparse.h:71
ElementMult
TMatrixTSparse< Element > & ElementMult(TMatrixTSparse< Element > &target, const TMatrixTSparse< Element > &source)
Multiply target by the source, element-by-element.
Definition: TMatrixTSparse.cxx:2684
int
Add
TMatrixTSparse< Element > & Add(TMatrixTSparse< Element > &target, Element scalar, const TMatrixTSparse< Element > &source)
Modify addition: target += scalar * source.
Definition: TMatrixTSparse.cxx:2674
TMatrixTSparse::fElements
Element * fElements
Definition: TMatrixTSparse.h:42