Logo ROOT  
Reference Guide
TMatrixTUtils.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_TMatrixTUtils
13 #define ROOT_TMatrixTUtils
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // Matrix utility classes. //
18 // //
19 // Templates of utility classes in the Linear Algebra Package. //
20 // The following classes are defined here: //
21 // //
22 // Different matrix views without copying data elements : //
23 // TMatrixTRow_const TMatrixTRow //
24 // TMatrixTColumn_const TMatrixTColumn //
25 // TMatrixTDiag_const TMatrixTDiag //
26 // TMatrixTFlat_const TMatrixTFlat //
27 // TMatrixTSub_const TMatrixTSub //
28 // TMatrixTSparseRow_const TMatrixTSparseRow //
29 // TMatrixTSparseDiag_const TMatrixTSparseDiag //
30 // //
31 // TElementActionT //
32 // TElementPosActionT //
33 // //
34 //////////////////////////////////////////////////////////////////////////
35 
36 #include "TMatrixTBase.h"
37 
38 #include <initializer_list>
39 
40 template<class Element> class TVectorT;
41 template<class Element> class TMatrixT;
42 template<class Element> class TMatrixTSym;
43 template<class Element> class TMatrixTSparse;
44 
45 //////////////////////////////////////////////////////////////////////////
46 // //
47 // TElementActionT //
48 // //
49 // A class to do a specific operation on every vector or matrix element //
50 // (regardless of it position) as the object is being traversed. //
51 // This is an abstract class. Derived classes need to implement the //
52 // action function Operation(). //
53 // //
54 //////////////////////////////////////////////////////////////////////////
55 
56 template<class Element> class TElementActionT {
57 
58 #ifndef __CINT__
59 friend class TMatrixTBase <Element>;
60 friend class TMatrixT <Element>;
61 friend class TMatrixTSym <Element>;
62 friend class TMatrixTSparse<Element>;
63 friend class TVectorT <Element>;
64 #endif
65 
66 protected:
67  virtual ~TElementActionT() { }
68  virtual void Operation(Element &element) const = 0;
69 
70 private:
72 };
73 
74 //////////////////////////////////////////////////////////////////////////
75 // //
76 // TElementPosActionT //
77 // //
78 // A class to do a specific operation on every vector or matrix element //
79 // as the object is being traversed. This is an abstract class. //
80 // Derived classes need to implement the action function Operation(). //
81 // In the action function the location of the current element is //
82 // known (fI=row, fJ=columns). //
83 // //
84 //////////////////////////////////////////////////////////////////////////
85 
86 template<class Element> class TElementPosActionT {
87 
88 #ifndef __CINT__
89 friend class TMatrixTBase <Element>;
90 friend class TMatrixT <Element>;
91 friend class TMatrixTSym <Element>;
92 friend class TMatrixTSparse<Element>;
93 friend class TVectorT <Element>;
94 #endif
95 
96 protected:
97  mutable Int_t fI; // i position of element being passed to Operation()
98  mutable Int_t fJ; // j position of element being passed to Operation()
99  virtual ~TElementPosActionT() { }
100  virtual void Operation(Element &element) const = 0;
101 
102 private:
104 };
105 
106 //////////////////////////////////////////////////////////////////////////
107 // //
108 // TMatrixTRow_const //
109 // //
110 // Template class represents a row of a TMatrixT/TMatrixTSym //
111 // //
112 //////////////////////////////////////////////////////////////////////////
113 
114 template<class Element> class TMatrixTRow_const {
115 
116 protected:
117  const TMatrixTBase<Element> *fMatrix; // the matrix I am a row of
118  Int_t fRowInd; // effective row index
119  Int_t fInc; // if ptr = @a[row,i], then ptr+inc = @a[row,i+1]
120  const Element *fPtr; // pointer to the a[row,0]
121 
122 public:
123  TMatrixTRow_const() { fMatrix = 0; fRowInd = 0; fInc = 0; fPtr = 0; }
124  TMatrixTRow_const(const TMatrixT <Element> &matrix,Int_t row);
125  TMatrixTRow_const(const TMatrixTSym<Element> &matrix,Int_t row);
127  fMatrix(trc.fMatrix), fRowInd(trc.fRowInd), fInc(trc.fInc), fPtr(trc.fPtr) { }
129  if(this != &trc) { fMatrix=trc.fMatrix; fRowInd=trc.fRowInd; fInc=trc.fInc; fPtr=trc.fPtr; } return *this;}
130  virtual ~TMatrixTRow_const() { }
131 
132  inline const TMatrixTBase<Element> *GetMatrix () const { return fMatrix; }
133  inline Int_t GetRowIndex() const { return fRowInd; }
134  inline Int_t GetInc () const { return fInc; }
135  inline const Element *GetPtr () const { return fPtr; }
136  inline const Element &operator ()(Int_t i) const {
139  const Int_t acoln = i-fMatrix->GetColLwb();
140  if (acoln < fMatrix->GetNcols() && acoln >= 0)
141  return fPtr[acoln];
142  else {
143  Error("operator()","Request col(%d) outside matrix range of %d - %d",
146  }
147  }
148  inline const Element &operator [](Int_t i) const { return (*(const TMatrixTRow_const<Element> *)this)(i); }
149 
150  ClassDef(TMatrixTRow_const,0) // Template of General Matrix Row Access class
151 };
152 
153 template<class Element> class TMatrixTRow : public TMatrixTRow_const<Element> {
154 
155 public:
157  TMatrixTRow(TMatrixT <Element> &matrix,Int_t row);
160 
161  inline Element *GetPtr() const { return const_cast<Element *>(this->fPtr); }
162 
163  inline const Element &operator()(Int_t i) const {
164  if (!this->fMatrix) return TMatrixTBase<Element>::NaNValue();
165  R__ASSERT(this->fMatrix->IsValid());
166  const Int_t acoln = i-this->fMatrix->GetColLwb();
167  if (acoln < this->fMatrix->GetNcols() || acoln >= 0)
168  return (this->fPtr)[acoln];
169  else {
170  Error("operator()","Request col(%d) outside matrix range of %d - %d",
171  i,this->fMatrix->GetColLwb(),this->fMatrix->GetColLwb()+this->fMatrix->GetNcols());
173  }
174  }
175  inline Element &operator()(Int_t i) {
176  if (!this->fMatrix) return TMatrixTBase<Element>::NaNValue();
177  R__ASSERT(this->fMatrix->IsValid());
178  const Int_t acoln = i-this->fMatrix->GetColLwb();
179  if (acoln < this->fMatrix->GetNcols() && acoln >= 0)
180  return (const_cast<Element *>(this->fPtr))[acoln];
181  else {
182  Error("operator()","Request col(%d) outside matrix range of %d - %d",
183  i,this->fMatrix->GetColLwb(),this->fMatrix->GetColLwb()+this->fMatrix->GetNcols());
184  //return (const_cast<Element *>(this->fPtr))[0];
186  }
187  }
188  inline const Element &operator[](Int_t i) const { return (*(const TMatrixTRow<Element> *)this)(i); }
189  inline Element &operator[](Int_t i) { return (*( TMatrixTRow<Element> *)this)(i); }
190 
191  void Assign (Element val);
192  void operator= (std::initializer_list<Element> l);
193  void operator+=(Element val);
194  void operator*=(Element val);
195 
198  void operator=(const TVectorT <Element> &vec);
199 
202 
203  ClassDef(TMatrixTRow,0) // Template of General Matrix Row Access class
204 };
205 
206 //////////////////////////////////////////////////////////////////////////
207 // //
208 // TMatrixTColumn_const //
209 // //
210 // Template class represents a column of a TMatrixT/TMatrixTSym //
211 // //
212 //////////////////////////////////////////////////////////////////////////
213 
214 template<class Element> class TMatrixTColumn_const {
215 
216 protected:
217  const TMatrixTBase<Element> *fMatrix; // the matrix I am a column of
218  Int_t fColInd; // effective column index
219  Int_t fInc; // if ptr = @a[i,col], then ptr+inc = @a[i+1,col]
220  const Element *fPtr; // pointer to the a[0,col] column
221 
222 public:
223  TMatrixTColumn_const() { fMatrix = 0; fColInd = 0; fInc = 0; fPtr = 0; }
224  TMatrixTColumn_const(const TMatrixT <Element> &matrix,Int_t col);
227  fMatrix(trc.fMatrix), fColInd(trc.fColInd), fInc(trc.fInc), fPtr(trc.fPtr) { }
229  if(this != &trc) { fMatrix=trc.fMatrix; fColInd=trc.fColInd; fInc=trc.fInc; fPtr=trc.fPtr; } return *this;}
230  virtual ~TMatrixTColumn_const() { }
231 
232  inline const TMatrixTBase <Element> *GetMatrix () const { return fMatrix; }
233  inline Int_t GetColIndex() const { return fColInd; }
234  inline Int_t GetInc () const { return fInc; }
235  inline const Element *GetPtr () const { return fPtr; }
236  inline const Element &operator ()(Int_t i) const {
237  if (!this->fMatrix) return TMatrixTBase<Element>::NaNValue();
239  const Int_t arown = i-fMatrix->GetRowLwb();
240  if (arown < fMatrix->GetNrows() && arown >= 0)
241  return fPtr[arown*fInc];
242  else {
243  Error("operator()","Request row(%d) outside matrix range of %d - %d",
246  }
247  }
248  inline const Element &operator [](Int_t i) const { return (*(const TMatrixTColumn_const<Element> *)this)(i); }
249 
250  ClassDef(TMatrixTColumn_const,0) // Template of General Matrix Column Access class
251 };
252 
253 template<class Element> class TMatrixTColumn : public TMatrixTColumn_const<Element> {
254 
255 public:
260 
261  inline Element *GetPtr() const { return const_cast<Element *>(this->fPtr); }
262 
263  inline const Element &operator()(Int_t i) const {
264  if (!this->fMatrix) return TMatrixTBase<Element>::NaNValue();
265  R__ASSERT(this->fMatrix->IsValid());
266  const Int_t arown = i-this->fMatrix->GetRowLwb();
267  if (arown < this->fMatrix->GetNrows() && arown >= 0)
268  return (this->fPtr)[arown*this->fInc];
269  else {
270  Error("operator()","Request row(%d) outside matrix range of %d - %d",
271  i,this->fMatrix->GetRowLwb(),this->fMatrix->GetRowLwb()+this->fMatrix->GetNrows());
273  }
274  }
275  inline Element &operator()(Int_t i) {
276  if (!this->fMatrix) return TMatrixTBase<Element>::NaNValue();
277  R__ASSERT(this->fMatrix->IsValid());
278  const Int_t arown = i-this->fMatrix->GetRowLwb();
279 
280  if (arown < this->fMatrix->GetNrows() && arown >= 0)
281  return (const_cast<Element *>(this->fPtr))[arown*this->fInc];
282  else {
283  Error("operator()","Request row(%d) outside matrix range of %d - %d",
284  i,this->fMatrix->GetRowLwb(),this->fMatrix->GetRowLwb()+this->fMatrix->GetNrows());
286  }
287  }
288  inline const Element &operator[](Int_t i) const { return (*(const TMatrixTColumn<Element> *)this)(i); }
289  inline Element &operator[](Int_t i) { return (*( TMatrixTColumn<Element> *)this)(i); }
290 
291  void Assign (Element val);
292  // keep it for backward compatibility (but it has been removed for TMatrixTRow)
293  void operator= (Element val) { return Assign(val); }
294  void operator= (std::initializer_list<Element> l);
295  void operator+=(Element val);
296  void operator*=(Element val);
297 
300  void operator=(const TVectorT <Element> &vec);
301 
304 
305  ClassDef(TMatrixTColumn,0) // Template of General Matrix Column Access class
306 };
307 
308 //////////////////////////////////////////////////////////////////////////
309 // //
310 // TMatrixTDiag_const //
311 // //
312 // Template class represents the diagonal of a TMatrixT/TMatrixTSym //
313 // //
314 //////////////////////////////////////////////////////////////////////////
315 
316 template<class Element> class TMatrixTDiag_const {
317 
318 protected:
319  const TMatrixTBase<Element> *fMatrix; // the matrix I am the diagonal of
320  Int_t fInc; // if ptr=@a[i,i], then ptr+inc = @a[i+1,i+1]
321  Int_t fNdiag; // number of diag elems, min(nrows,ncols)
322  const Element *fPtr; // pointer to the a[0,0]
323 
324 public:
325  TMatrixTDiag_const() { fMatrix = 0; fInc = 0; fNdiag = 0; fPtr = 0; }
326  TMatrixTDiag_const(const TMatrixT <Element> &matrix);
329  fMatrix(trc.fMatrix), fInc(trc.fInc), fNdiag(trc.fNdiag), fPtr(trc.fPtr) { }
331  if(this != &trc) { fMatrix=trc.fMatrix; fInc=trc.fInc; fNdiag=trc.fNdiag; fPtr=trc.fPtr; } return *this;}
332  virtual ~TMatrixTDiag_const() { }
333 
334  inline const TMatrixTBase<Element> *GetMatrix() const { return fMatrix; }
335  inline const Element *GetPtr () const { return fPtr; }
336  inline Int_t GetInc () const { return fInc; }
337  inline const Element &operator ()(Int_t i) const {
339  if (i < fNdiag && i >= 0)
340  return fPtr[i*fInc];
341  else {
342  Error("operator()","Request diagonal(%d) outside matrix range of 0 - %d",i,fNdiag);
344  }
345  }
346  inline const Element &operator [](Int_t i) const { return (*(const TMatrixTDiag_const<Element> *)this)(i); }
347 
348  Int_t GetNdiags() const { return fNdiag; }
349 
350  ClassDef(TMatrixTDiag_const,0) // Template of General Matrix Diagonal Access class
351 };
352 
353 template<class Element> class TMatrixTDiag : public TMatrixTDiag_const<Element> {
354 
355 public:
360 
361  inline Element *GetPtr() const { return const_cast<Element *>(this->fPtr); }
362 
363  inline const Element &operator()(Int_t i) const {
364  R__ASSERT(this->fMatrix->IsValid());
365  if (i < this->fNdiag && i >= 0)
366  return (this->fPtr)[i*this->fInc];
367  else {
368  Error("operator()","Request diagonal(%d) outside matrix range of 0 - %d",i,this->fNdiag);
370  }
371  }
372  inline Element &operator()(Int_t i) {
373  R__ASSERT(this->fMatrix->IsValid());
374  if (i < this->fNdiag && i >= 0)
375  return (const_cast<Element *>(this->fPtr))[i*this->fInc];
376  else {
377  Error("operator()","Request diagonal(%d) outside matrix range of 0 - %d",i,this->fNdiag);
378  return (const_cast<Element *>(this->fPtr))[0];
379  }
380  }
381  inline const Element &operator[](Int_t i) const { return (*(const TMatrixTDiag<Element> *)this)(i); }
382  inline Element &operator[](Int_t i) { return (*( TMatrixTDiag *)this)(i); }
383 
384  void operator= (Element val);
385  void operator+=(Element val);
386  void operator*=(Element val);
387 
390  void operator=(const TVectorT <Element> &vec);
391 
394 
395  ClassDef(TMatrixTDiag,0) // Template of General Matrix Diagonal Access class
396 };
397 
398 //////////////////////////////////////////////////////////////////////////
399 // //
400 // TMatrixTFlat_const //
401 // //
402 // Template class represents a flat TMatrixT/TMatrixTSym //
403 // //
404 //////////////////////////////////////////////////////////////////////////
405 
406 template<class Element> class TMatrixTFlat_const {
407 
408 protected:
409  const TMatrixTBase<Element> *fMatrix; // the matrix I am the diagonal of
411  const Element *fPtr; // pointer to the a[0,0]
412 
413 public:
414  TMatrixTFlat_const() { fMatrix = 0; fNelems = 0; fPtr = 0; }
415  TMatrixTFlat_const(const TMatrixT <Element> &matrix);
418  fMatrix(trc.fMatrix), fNelems(trc.fNelems), fPtr(trc.fPtr) { }
420  if(this != &trc) { fMatrix=trc.fMatrix; fNelems=trc.fNelems; fPtr=trc.fPtr; } return *this;}
421  virtual ~TMatrixTFlat_const() { }
422 
423  inline const TMatrixTBase<Element> *GetMatrix() const { return fMatrix; }
424  inline const Element *GetPtr () const { return fPtr; }
425  inline const Element &operator ()(Int_t i) const {
427  if (i < fNelems && i >= 0)
428  return fPtr[i];
429  else {
430  Error("operator()","Request element(%d) outside matrix range of 0 - %d",i,fNelems);
432  }
433  }
434  inline const Element &operator [](Int_t i) const { return (*(const TMatrixTFlat_const<Element> *)this)(i); }
435 
436  ClassDef(TMatrixTFlat_const,0) // Template of General Matrix Flat Representation class
437 };
438 
439 template<class Element> class TMatrixTFlat : public TMatrixTFlat_const<Element> {
440 
441 public:
446 
447  inline Element *GetPtr() const { return const_cast<Element *>(this->fPtr); }
448 
449  inline const Element &operator()(Int_t i) const {
450  R__ASSERT(this->fMatrix->IsValid());
451  if (i < this->fNelems && i >= 0)
452  return (this->fPtr)[i];
453  else {
454  Error("operator()","Request element(%d) outside matrix range of 0 - %d",i,this->fNelems);
456  }
457  }
458  inline Element &operator()(Int_t i) {
459  R__ASSERT(this->fMatrix->IsValid());
460  if (i < this->fNelems && i >= 0)
461  return (const_cast<Element *>(this->fPtr))[i];
462  else {
463  Error("operator()","Request element(%d) outside matrix range of 0 - %d",i,this->fNelems);
465  }
466  }
467  inline const Element &operator[](Int_t i) const { return (*(const TMatrixTFlat<Element> *)this)(i); }
468  inline Element &operator[](Int_t i) { return (*( TMatrixTFlat<Element> *)this)(i); }
469 
470  void operator= (Element val);
471  void operator+=(Element val);
472  void operator*=(Element val);
473 
476  void operator=(const TVectorT <Element> &vec);
477 
480 
481  ClassDef(TMatrixTFlat,0) // Template of General Matrix Flat Representation class
482 };
483 
484 //////////////////////////////////////////////////////////////////////////
485 // //
486 // TMatrixTSub_const //
487 // //
488 // Template class represents a sub matrix of TMatrixT/TMatrixTSym //
489 // //
490 //////////////////////////////////////////////////////////////////////////
491 
492 template<class Element> class TMatrixTSub_const {
493 
494 protected:
495  const TMatrixTBase<Element> *fMatrix; // the matrix I am a submatrix of
500 
501 public:
503  TMatrixTSub_const(const TMatrixT <Element> &matrix,Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
504  TMatrixTSub_const(const TMatrixTSym<Element> &matrix,Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
505  virtual ~TMatrixTSub_const() { }
506 
507  inline const TMatrixTBase<Element> *GetMatrix() const { return fMatrix; }
508  inline Int_t GetRowOff() const { return fRowOff; }
509  inline Int_t GetColOff() const { return fColOff; }
510  inline Int_t GetNrows () const { return fNrowsSub; }
511  inline Int_t GetNcols () const { return fNcolsSub; }
512  inline const Element &operator ()(Int_t rown,Int_t coln) const {
514 
515  const Element *ptr = fMatrix->GetMatrixArray();
516  if (rown >= fNrowsSub || rown < 0) {
517  Error("operator()","Request row(%d) outside matrix range of 0 - %d",rown,fNrowsSub);
519  }
520  if (coln >= fNcolsSub || coln < 0) {
521  Error("operator()","Request column(%d) outside matrix range of 0 - %d",coln,fNcolsSub);
523  }
524  const Int_t index = (rown+fRowOff)*fMatrix->GetNcols()+coln+fColOff;
525  return ptr[index];
526  }
527 
528  ClassDef(TMatrixTSub_const,0) // Template of Sub Matrix Access class
529 };
530 
531 template<class Element> class TMatrixTSub : public TMatrixTSub_const<Element> {
532 
533 public:
534 
535  enum {kWorkMax = 100};
536 
538  TMatrixTSub(TMatrixT <Element> &matrix,Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
539  TMatrixTSub(TMatrixTSym<Element> &matrix,Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
541 
542  inline Element &operator()(Int_t rown,Int_t coln) {
543  R__ASSERT(this->fMatrix->IsValid());
544 
545  const Element *ptr = this->fMatrix->GetMatrixArray();
546  if (rown >= this->fNrowsSub || rown < 0) {
547  Error("operator()","Request row(%d) outside matrix range of 0 - %d",rown,this->fNrowsSub);
549  }
550  if (coln >= this->fNcolsSub || coln < 0) {
551  Error("operator()","Request column(%d) outside matrix range of 0 - %d",coln,this->fNcolsSub);
553  }
554  const Int_t index = (rown+this->fRowOff)*this->fMatrix->GetNcols()+coln+this->fColOff;
555  return (const_cast<Element *>(ptr))[index];
556  }
557 
558  void Rank1Update(const TVectorT<Element> &vec,Element alpha=1.0);
559 
560  void operator= (Element val);
561  void operator+=(Element val);
562  void operator*=(Element val);
563 
566  void operator=(const TMatrixTBase <Element> &m);
567 
570  void operator+=(const TMatrixTBase <Element> &m);
571  void operator*=(const TMatrixT <Element> &m);
572  void operator*=(const TMatrixTSym <Element> &m);
573 
574  ClassDef(TMatrixTSub,0) // Template of Sub Matrix Access class
575 };
576 
577 //////////////////////////////////////////////////////////////////////////
578 // //
579 // TMatrixTSparseRow_const //
580 // //
581 // Template class represents a row of TMatrixTSparse //
582 // //
583 //////////////////////////////////////////////////////////////////////////
584 
585 template<class Element> class TMatrixTSparseRow_const {
586 
587 protected:
588  const TMatrixTSparse<Element> *fMatrix; // the matrix I am a row of
589  Int_t fRowInd; // effective row index
590  Int_t fNindex; // index range
591  const Int_t *fColPtr; // column index pointer
592  const Element *fDataPtr; // data pointer
593 
594 public:
598  fMatrix(trc.fMatrix), fRowInd(trc.fRowInd), fNindex(trc.fNindex), fColPtr(trc.fColPtr), fDataPtr(trc.fDataPtr) { }
600  if(this != &trc) { fMatrix=trc.fMatrix; fRowInd=trc.fRowInd; fNindex=trc.fNindex; fColPtr=trc.fColPtr; fDataPtr=trc.fDataPtr; } return *this;}
602 
603  inline const TMatrixTBase<Element> *GetMatrix () const { return fMatrix; }
604  inline const Element *GetDataPtr () const { return fDataPtr; }
605  inline const Int_t *GetColPtr () const { return fColPtr; }
606  inline Int_t GetRowIndex() const { return fRowInd; }
607  inline Int_t GetNindex () const { return fNindex; }
608 
609  Element operator()(Int_t i) const;
610  inline Element operator[](Int_t i) const { return (*(const TMatrixTSparseRow_const<Element> *)this)(i); }
611 
612  ClassDef(TMatrixTSparseRow_const,0) // Template of Sparse Matrix Row Access class
613 };
614 
615 template<class Element> class TMatrixTSparseRow : public TMatrixTSparseRow_const<Element> {
616 
617 public:
621 
622  inline Element *GetDataPtr() const { return const_cast<Element *>(this->fDataPtr); }
623 
624  Element operator()(Int_t i) const;
625  Element &operator()(Int_t i);
626  inline Element operator[](Int_t i) const { return (*(const TMatrixTSparseRow<Element> *)this)(i); }
627  inline Element &operator[](Int_t i) { return (*(TMatrixTSparseRow<Element> *)this)(i); }
628 
629  void operator= (Element val);
630  void operator+=(Element val);
631  void operator*=(Element val);
632 
635  void operator=(const TVectorT <Element> &vec);
636 
639 
640  ClassDef(TMatrixTSparseRow,0) // Template of Sparse Matrix Row Access class
641 };
642 
643 //////////////////////////////////////////////////////////////////////////
644 // //
645 // TMatrixTSparseDiag_const //
646 // //
647 // Template class represents the diagonal of TMatrixTSparse //
648 // //
649 //////////////////////////////////////////////////////////////////////////
650 
651 template<class Element> class TMatrixTSparseDiag_const {
652 
653 protected:
654  const TMatrixTSparse<Element> *fMatrix; // the matrix I am the diagonal of
655  Int_t fNdiag; // number of diag elems, min(nrows,ncols)
656  const Element *fDataPtr; // data pointer
657 
658 public:
662  fMatrix(trc.fMatrix), fNdiag(trc.fNdiag), fDataPtr(trc.fDataPtr) { }
664  if(this != &trc) { fMatrix=trc.fMatrix; fNdiag=trc.fNdiag; fDataPtr=trc.fDataPtr; } return *this;}
666 
667  inline const TMatrixTBase<Element> *GetMatrix () const { return fMatrix; }
668  inline const Element *GetDataPtr() const { return fDataPtr; }
669  inline Int_t GetNdiags () const { return fNdiag; }
670 
671  Element operator ()(Int_t i) const;
672  inline Element operator [](Int_t i) const { return (*(const TMatrixTSparseRow_const<Element> *)this)(i); }
673 
674  ClassDef(TMatrixTSparseDiag_const,0) // Template of Sparse Matrix Diagonal Access class
675 };
676 
677 template<class Element> class TMatrixTSparseDiag : public TMatrixTSparseDiag_const<Element> {
678 
679 public:
683 
684  inline Element *GetDataPtr() const { return const_cast<Element *>(this->fDataPtr); }
685 
686  Element operator()(Int_t i) const;
687  Element &operator()(Int_t i);
688  inline Element operator[](Int_t i) const { return (*(const TMatrixTSparseDiag<Element> *)this)(i); }
689  inline Element &operator[](Int_t i) { return (*(TMatrixTSparseDiag<Element> *)this)(i); }
690 
691  void operator= (Element val);
692  void operator+=(Element val);
693  void operator*=(Element val);
694 
697  void operator=(const TVectorT <Element> &vec);
698 
701 
702  ClassDef(TMatrixTSparseDiag,0) // Template of Sparse Matrix Diagonal Access class
703 };
704 
705 Double_t Drand(Double_t &ix);
706 #endif
TMatrixTColumn_const::operator=
TMatrixTColumn_const< Element > & operator=(const TMatrixTColumn_const< Element > &trc)
Definition: TMatrixTUtils.h:228
TMatrixTFlat
Definition: TMatrixDUtilsfwd.h:46
c
#define c(i)
Definition: RSha256.hxx:119
l
auto * l
Definition: textangle.C:4
TMatrixTFlat::TMatrixTFlat
TMatrixTFlat()
Definition: TMatrixTUtils.h:442
TMatrixTRow_const::operator()
const Element & operator()(Int_t i) const
Definition: TMatrixTUtils.h:136
TElementActionT::~TElementActionT
virtual ~TElementActionT()
Definition: TMatrixTUtils.h:67
m
auto * m
Definition: textangle.C:8
TMatrixTSub::TMatrixTSub
TMatrixTSub()
Definition: TMatrixTUtils.h:537
TMatrixTSparseDiag::TMatrixTSparseDiag
TMatrixTSparseDiag()
Definition: TMatrixTUtils.h:680
TMatrixTDiag::TMatrixTDiag
TMatrixTDiag()
Definition: TMatrixTUtils.h:356
TMatrixTRow_const::TMatrixTRow_const
TMatrixTRow_const(const TMatrixTRow_const< Element > &trc)
Definition: TMatrixTUtils.h:126
TMatrixTDiag_const::GetNdiags
Int_t GetNdiags() const
Definition: TMatrixTUtils.h:348
TMatrixTDiag_const::GetPtr
const Element * GetPtr() const
Definition: TMatrixTUtils.h:335
TMatrixTSparseRow_const::TMatrixTSparseRow_const
TMatrixTSparseRow_const(const TMatrixTSparseRow_const< Element > &trc)
Definition: TMatrixTUtils.h:597
TMatrixTRow_const::operator=
TMatrixTRow_const< Element > & operator=(const TMatrixTRow_const< Element > &trc)
Definition: TMatrixTUtils.h:128
TMatrixTSub::Rank1Update
void Rank1Update(const TVectorT< Element > &vec, Element alpha=1.0)
Perform a rank 1 operation on the matrix: A += alpha * v * v^T.
Definition: TMatrixTUtils.cxx:950
TMatrixTColumn::Assign
void Assign(Element val)
Assign val to every element of the matrix column.
Definition: TMatrixTUtils.cxx:323
TMatrixTSparseDiag::GetDataPtr
Element * GetDataPtr() const
Definition: TMatrixTUtils.h:684
TMatrixTDiag::operator=
TMatrixTDiag< Element > & operator=(const TMatrixTDiag< Element > &d)
Definition: TMatrixTUtils.h:389
TMatrixTFlat::operator()
Element & operator()(Int_t i)
Definition: TMatrixTUtils.h:458
TMatrixTRow_const::GetRowIndex
Int_t GetRowIndex() const
Definition: TMatrixTUtils.h:133
f
#define f(i)
Definition: RSha256.hxx:122
TMatrixTSparseDiag::operator()
Element operator()(Int_t i) const
Definition: TMatrixTUtils.cxx:1702
TMatrixTRow::Assign
void Assign(Element val)
Assign val to every element of the matrix row.
Definition: TMatrixTUtils.cxx:117
TMatrixTFlat::operator+=
void operator+=(Element val)
Add val to every element of the matrix.
Definition: TMatrixTUtils.cxx:705
TMatrixTSub_const::GetRowOff
Int_t GetRowOff() const
Definition: TMatrixTUtils.h:508
TMatrixTSparseDiag_const::fNdiag
Int_t fNdiag
Definition: TMatrixTUtils.h:655
TMatrixTColumn_const::~TMatrixTColumn_const
virtual ~TMatrixTColumn_const()
Definition: TMatrixTUtils.h:230
TMatrixTColumn_const::GetInc
Int_t GetInc() const
Definition: TMatrixTUtils.h:234
TMatrixTSub::operator*=
void operator*=(Element val)
Multiply every element of the sub matrix by val .
Definition: TMatrixTUtils.cxx:1010
TMatrixTSparseRow
Definition: TMatrixDUtilsfwd.h:48
TMatrixTDiag::operator()
const Element & operator()(Int_t i) const
Definition: TMatrixTUtils.h:363
TMatrixTColumn_const::fColInd
Int_t fColInd
Definition: TMatrixTUtils.h:218
TMatrixTRow::operator()
Element & operator()(Int_t i)
Definition: TMatrixTUtils.h:175
TMatrixTDiag_const::operator[]
const Element & operator[](Int_t i) const
Definition: TMatrixTUtils.h:346
TElementPosActionT::fI
Int_t fI
Definition: TMatrixTUtils.h:97
TMatrixTRow_const::GetInc
Int_t GetInc() const
Definition: TMatrixTUtils.h:134
TMatrixTSparseDiag_const::~TMatrixTSparseDiag_const
virtual ~TMatrixTSparseDiag_const()
Definition: TMatrixTUtils.h:665
TMatrixTFlat::operator=
TMatrixTFlat< Element > & operator=(const TMatrixTFlat< Element > &f)
Definition: TMatrixTUtils.h:475
TElementPosActionT::~TElementPosActionT
virtual ~TElementPosActionT()
Definition: TMatrixTUtils.h:99
TMatrixTSparseRow::operator=
TMatrixTSparseRow< Element > & operator=(const TMatrixTSparseRow< Element > &r)
Definition: TMatrixTUtils.h:634
TMatrixTSparseDiag_const::GetMatrix
const TMatrixTBase< Element > * GetMatrix() const
Definition: TMatrixTUtils.h:667
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TMatrixTColumn_const::TMatrixTColumn_const
TMatrixTColumn_const(const TMatrixTColumn_const< Element > &trc)
Definition: TMatrixTUtils.h:226
TMatrixTFlat_const::~TMatrixTFlat_const
virtual ~TMatrixTFlat_const()
Definition: TMatrixTUtils.h:421
TMatrixTSparseDiag_const::fDataPtr
const Element * fDataPtr
Definition: TMatrixTUtils.h:656
TMatrixTBase::NaNValue
static Element & NaNValue()
TMatrixTSparseDiag::operator*=
void operator*=(Element val)
Multiply every element of the matrix diagonal by val.
Definition: TMatrixTUtils.cxx:1788
TMatrixTSparseRow::operator[]
Element operator[](Int_t i) const
Definition: TMatrixTUtils.h:626
TMatrixTDiag::operator[]
Element & operator[](Int_t i)
Definition: TMatrixTUtils.h:382
TMatrixTColumn_const
Definition: TMatrixDUtilsfwd.h:36
TElementPosActionT::operator=
TElementPosActionT< Element > & operator=(const TElementPosActionT< Element > &)
Definition: TMatrixTUtils.h:103
TMatrixTDiag_const::fNdiag
Int_t fNdiag
Definition: TMatrixTUtils.h:321
TMatrixTRow_const::fRowInd
Int_t fRowInd
Definition: TMatrixTUtils.h:118
TMatrixTColumn_const::fInc
Int_t fInc
Definition: TMatrixTUtils.h:219
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
Int_t
int Int_t
Definition: RtypesCore.h:45
TMatrixTColumn_const::fPtr
const Element * fPtr
Definition: TMatrixTUtils.h:220
TMatrixTFlat_const
Definition: TMatrixDUtilsfwd.h:38
TMatrixTSparseDiag_const::operator[]
Element operator[](Int_t i) const
Definition: TMatrixTUtils.h:672
TMatrixTColumn_const::GetPtr
const Element * GetPtr() const
Definition: TMatrixTUtils.h:235
TMatrixTSparseRow_const::fMatrix
const TMatrixTSparse< Element > * fMatrix
Definition: TMatrixTUtils.h:588
TMatrixTSparseDiag
Definition: TMatrixDUtilsfwd.h:49
TMatrixTBase::GetNcols
Int_t GetNcols() const
Definition: TMatrixTBase.h:126
TMatrixTFlat_const::TMatrixTFlat_const
TMatrixTFlat_const()
Definition: TMatrixTUtils.h:414
TMatrixTColumn::operator()
const Element & operator()(Int_t i) const
Definition: TMatrixTUtils.h:263
TMatrixTFlat::operator()
const Element & operator()(Int_t i) const
Definition: TMatrixTUtils.h:449
TMatrixTRow::operator*=
void operator*=(Element val)
Multiply every element of the matrix row with val.
Definition: TMatrixTUtils.cxx:151
TMatrixTFlat::operator[]
Element & operator[](Int_t i)
Definition: TMatrixTUtils.h:468
TMatrixTSparseRow::operator()
Element operator()(Int_t i) const
Definition: TMatrixTUtils.cxx:1425
TMatrixTSym
Definition: TMatrixDSymfwd.h:22
TMatrixTFlat::operator*=
void operator*=(Element val)
Multiply every element of the matrix with val.
Definition: TMatrixTUtils.cxx:717
TMatrixTRow::operator=
void operator=(std::initializer_list< Element > l)
Definition: TMatrixTUtils.cxx:126
TMatrixTSub::operator()
Element & operator()(Int_t rown, Int_t coln)
Definition: TMatrixTUtils.h:542
TMatrixTBase::GetColLwb
Int_t GetColLwb() const
Definition: TMatrixTBase.h:124
TMatrixT
Definition: TMatrixDfwd.h:22
TElementPosActionT::fJ
Int_t fJ
Definition: TMatrixTUtils.h:98
TMatrixTSparseRow::operator+=
void operator+=(Element val)
Add val to every non-zero (!) element of the matrix row.
Definition: TMatrixTUtils.cxx:1496
TMatrixTSparseDiag_const::GetNdiags
Int_t GetNdiags() const
Definition: TMatrixTUtils.h:669
TMatrixTSparseDiag_const::TMatrixTSparseDiag_const
TMatrixTSparseDiag_const()
Definition: TMatrixTUtils.h:659
TMatrixTSparseRow_const::GetMatrix
const TMatrixTBase< Element > * GetMatrix() const
Definition: TMatrixTUtils.h:603
TMatrixTDiag::operator=
void operator=(Element val)
Assign val to every element of the matrix diagonal.
Definition: TMatrixTUtils.cxx:517
TMatrixTColumn::GetPtr
Element * GetPtr() const
Definition: TMatrixTUtils.h:261
TMatrixTSparseRow_const::GetColPtr
const Int_t * GetColPtr() const
Definition: TMatrixTUtils.h:605
TMatrixTFlat_const::fPtr
const Element * fPtr
Definition: TMatrixTUtils.h:411
TMatrixTSparseRow_const::operator()
Element operator()(Int_t i) const
Definition: TMatrixTUtils.cxx:1387
TMatrixTSparseDiag_const::operator=
TMatrixTSparseDiag_const< Element > & operator=(const TMatrixTSparseDiag_const< Element > &trc)
Definition: TMatrixTUtils.h:663
TMatrixTColumn_const::TMatrixTColumn_const
TMatrixTColumn_const()
Definition: TMatrixTUtils.h:223
TMatrixTSub_const::GetNcols
Int_t GetNcols() const
Definition: TMatrixTUtils.h:511
TMatrixTDiag_const
Definition: TMatrixDUtilsfwd.h:37
TMatrixTDiag_const::fMatrix
const TMatrixTBase< Element > * fMatrix
Definition: TMatrixTUtils.h:319
TMatrixTSub_const::GetMatrix
const TMatrixTBase< Element > * GetMatrix() const
Definition: TMatrixTUtils.h:507
TMatrixTSub::operator=
TMatrixTSub< Element > & operator=(const TMatrixTSub< Element > &s)
Definition: TMatrixTUtils.h:565
TMatrixTSub_const
Definition: TMatrixDUtilsfwd.h:39
TMatrixTBase::GetRowLwb
Int_t GetRowLwb() const
Definition: TMatrixTBase.h:121
TMatrixTSparseRow::GetDataPtr
Element * GetDataPtr() const
Definition: TMatrixTUtils.h:622
TMatrixTSub_const::fNcolsSub
Int_t fNcolsSub
Definition: TMatrixTUtils.h:499
TMatrixTSparseDiag::operator[]
Element operator[](Int_t i) const
Definition: TMatrixTUtils.h:688
TMatrixTSub_const::GetNrows
Int_t GetNrows() const
Definition: TMatrixTUtils.h:510
TMatrixTRow_const::GetMatrix
const TMatrixTBase< Element > * GetMatrix() const
Definition: TMatrixTUtils.h:132
TMatrixTSparseRow::operator[]
Element & operator[](Int_t i)
Definition: TMatrixTUtils.h:627
TMatrixTSub_const::operator()
const Element & operator()(Int_t rown, Int_t coln) const
Definition: TMatrixTUtils.h:512
TMatrixTBase
Definition: TMatrixDBasefwd.h:25
TMatrixTRow_const::GetPtr
const Element * GetPtr() const
Definition: TMatrixTUtils.h:135
TElementPosActionT::Operation
virtual void Operation(Element &element) const =0
TMatrixTSparseRow_const::fColPtr
const Int_t * fColPtr
Definition: TMatrixTUtils.h:591
TMatrixTRow::operator[]
Element & operator[](Int_t i)
Definition: TMatrixTUtils.h:189
TMatrixTSub_const::fColOff
Int_t fColOff
Definition: TMatrixTUtils.h:497
TMatrixTSparseDiag_const::TMatrixTSparseDiag_const
TMatrixTSparseDiag_const(const TMatrixTSparseDiag_const< Element > &trc)
Definition: TMatrixTUtils.h:661
TMatrixTColumn_const::fMatrix
const TMatrixTBase< Element > * fMatrix
Definition: TMatrixTUtils.h:217
TMatrixTRow::GetPtr
Element * GetPtr() const
Definition: TMatrixTUtils.h:161
TMatrixTSub::operator=
void operator=(Element val)
Assign val to every element of the sub matrix.
Definition: TMatrixTUtils.cxx:976
TMatrixTRow::operator()
const Element & operator()(Int_t i) const
Definition: TMatrixTUtils.h:163
TMatrixTSparseDiag_const::operator()
Element operator()(Int_t i) const
Definition: TMatrixTUtils.cxx:1661
TMatrixTSparseDiag::operator[]
Element & operator[](Int_t i)
Definition: TMatrixTUtils.h:689
TMatrixTDiag::operator*=
void operator*=(Element val)
Assign val to every element of the matrix diagonal.
Definition: TMatrixTUtils.cxx:541
TMatrixTColumn::operator[]
const Element & operator[](Int_t i) const
Definition: TMatrixTUtils.h:288
TMatrixTSub::operator+=
void operator+=(Element val)
Add val to every element of the sub matrix.
Definition: TMatrixTUtils.cxx:993
TMatrixTDiag_const::TMatrixTDiag_const
TMatrixTDiag_const()
Definition: TMatrixTUtils.h:325
TMatrixTSparseRow_const
Definition: TMatrixDUtilsfwd.h:40
TMatrixTSparseRow_const::~TMatrixTSparseRow_const
virtual ~TMatrixTSparseRow_const()
Definition: TMatrixTUtils.h:601
TMatrixTFlat::operator[]
const Element & operator[](Int_t i) const
Definition: TMatrixTUtils.h:467
TElementActionT::Operation
virtual void Operation(Element &element) const =0
TMatrixTFlat_const::fMatrix
const TMatrixTBase< Element > * fMatrix
Definition: TMatrixTUtils.h:409
TMatrixTRow::operator[]
const Element & operator[](Int_t i) const
Definition: TMatrixTUtils.h:188
TMatrixTSparseRow_const::TMatrixTSparseRow_const
TMatrixTSparseRow_const()
Definition: TMatrixTUtils.h:595
TMatrixTSparseRow_const::GetDataPtr
const Element * GetDataPtr() const
Definition: TMatrixTUtils.h:604
TMatrixTColumn::operator=
TMatrixTColumn< Element > & operator=(const TMatrixTColumn< Element > &c)
Definition: TMatrixTUtils.h:299
TMatrixTColumn
Definition: TMatrixDUtilsfwd.h:44
TMatrixTSub_const::~TMatrixTSub_const
virtual ~TMatrixTSub_const()
Definition: TMatrixTUtils.h:505
TMatrixTDiag::operator()
Element & operator()(Int_t i)
Definition: TMatrixTUtils.h:372
TElementActionT
Definition: TMatrixDUtilsfwd.h:51
TVectorT
Definition: TMatrixTBase.h:78
TMatrixTSparse
Definition: TMatrixDSparsefwd.h:22
TMatrixTRow_const
Definition: TMatrixDUtilsfwd.h:35
TMatrixTColumn_const::operator[]
const Element & operator[](Int_t i) const
Definition: TMatrixTUtils.h:248
TMatrixTDiag_const::TMatrixTDiag_const
TMatrixTDiag_const(const TMatrixTDiag_const< Element > &trc)
Definition: TMatrixTUtils.h:328
Double_t
double Double_t
Definition: RtypesCore.h:59
TMatrixTColumn::operator[]
Element & operator[](Int_t i)
Definition: TMatrixTUtils.h:289
TMatrixTSparseRow_const::operator[]
Element operator[](Int_t i) const
Definition: TMatrixTUtils.h:610
TMatrixTBase::GetMatrixArray
virtual const Element * GetMatrixArray() const =0
R__ASSERT
#define R__ASSERT(e)
Definition: TError.h:120
TMatrixTFlat_const::operator=
TMatrixTFlat_const< Element > & operator=(const TMatrixTFlat_const< Element > &trc)
Definition: TMatrixTUtils.h:419
TMatrixTBase::IsValid
Bool_t IsValid() const
Definition: TMatrixTBase.h:146
TMatrixTDiag
Definition: TMatrixDUtilsfwd.h:45
TMatrixTDiag_const::~TMatrixTDiag_const
virtual ~TMatrixTDiag_const()
Definition: TMatrixTUtils.h:332
TMatrixTSparseRow::operator=
void operator=(Element val)
Assign val to every non-zero (!) element of the matrix row.
Definition: TMatrixTUtils.cxx:1484
TElementPosActionT
Definition: TMatrixDUtilsfwd.h:52
TMatrixTSparseRow_const::fDataPtr
const Element * fDataPtr
Definition: TMatrixTUtils.h:592
TMatrixTRow::operator=
TMatrixTRow< Element > & operator=(const TMatrixTRow< Element > &r)
Definition: TMatrixTUtils.h:197
TMatrixTSub_const::fNrowsSub
Int_t fNrowsSub
Definition: TMatrixTUtils.h:498
TMatrixTSub::kWorkMax
@ kWorkMax
Definition: TMatrixTUtils.h:535
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMatrixTSparseDiag_const::fMatrix
const TMatrixTSparse< Element > * fMatrix
Definition: TMatrixTUtils.h:654
TMatrixTColumn::operator*=
void operator*=(Element val)
Multiply every element of the matrix column with val.
Definition: TMatrixTUtils.cxx:360
TMatrixTRow_const::fPtr
const Element * fPtr
Definition: TMatrixTUtils.h:120
TMatrixTSub_const::fRowOff
Int_t fRowOff
Definition: TMatrixTUtils.h:496
TMatrixTSparseDiag::operator+=
void operator+=(Element val)
Add val to every element of the matrix diagonal.
Definition: TMatrixTUtils.cxx:1777
TMatrixTColumn_const::GetColIndex
Int_t GetColIndex() const
Definition: TMatrixTUtils.h:233
TMatrixTColumn::operator=
void operator=(Element val)
Definition: TMatrixTUtils.h:293
d
#define d(i)
Definition: RSha256.hxx:120
TMatrixTSparseRow_const::operator=
TMatrixTSparseRow_const< Element > & operator=(const TMatrixTSparseRow_const< Element > &trc)
Definition: TMatrixTUtils.h:599
TMatrixTSparseRow_const::GetNindex
Int_t GetNindex() const
Definition: TMatrixTUtils.h:607
TMatrixTSparseDiag_const::GetDataPtr
const Element * GetDataPtr() const
Definition: TMatrixTUtils.h:668
TMatrixTSub_const::GetColOff
Int_t GetColOff() const
Definition: TMatrixTUtils.h:509
TMatrixTDiag_const::operator()
const Element & operator()(Int_t i) const
Definition: TMatrixTUtils.h:337
TMatrixTSub_const::TMatrixTSub_const
TMatrixTSub_const()
Definition: TMatrixTUtils.h:502
TMatrixTDiag::operator[]
const Element & operator[](Int_t i) const
Definition: TMatrixTUtils.h:381
TMatrixTDiag_const::GetMatrix
const TMatrixTBase< Element > * GetMatrix() const
Definition: TMatrixTUtils.h:334
TMatrixTRow::TMatrixTRow
TMatrixTRow()
Definition: TMatrixTUtils.h:156
TGeant4Unit::ms
static constexpr double ms
Definition: TGeant4SystemOfUnits.h:169
TMatrixTSparseDiag::operator=
TMatrixTSparseDiag< Element > & operator=(const TMatrixTSparseDiag< Element > &d)
Definition: TMatrixTUtils.h:696
TMatrixTSparseRow_const::GetRowIndex
Int_t GetRowIndex() const
Definition: TMatrixTUtils.h:606
TMatrixTRow
Definition: TMatrixDUtilsfwd.h:43
TMatrixTRow_const::~TMatrixTRow_const
virtual ~TMatrixTRow_const()
Definition: TMatrixTUtils.h:130
TMatrixTFlat_const::GetMatrix
const TMatrixTBase< Element > * GetMatrix() const
Definition: TMatrixTUtils.h:423
TMatrixTSparseDiag::operator=
void operator=(Element val)
Assign val to every element of the matrix diagonal.
Definition: TMatrixTUtils.cxx:1766
TMatrixTColumn::TMatrixTColumn
TMatrixTColumn()
Definition: TMatrixTUtils.h:256
TMatrixTRow_const::fInc
Int_t fInc
Definition: TMatrixTUtils.h:119
TMatrixTDiag::operator+=
void operator+=(Element val)
Assign val to every element of the matrix diagonal.
Definition: TMatrixTUtils.cxx:529
TMatrixTColumn::operator+=
void operator+=(Element val)
Add val to every element of the matrix column.
Definition: TMatrixTUtils.cxx:348
TMatrixTFlat_const::TMatrixTFlat_const
TMatrixTFlat_const(const TMatrixTFlat_const< Element > &trc)
Definition: TMatrixTUtils.h:417
TElementActionT::operator=
TElementActionT & operator=(const TElementActionT< Element > &)
Definition: TMatrixTUtils.h:71
TMatrixTSub
Definition: TMatrixDUtilsfwd.h:47
TMatrixTRow_const::operator[]
const Element & operator[](Int_t i) const
Definition: TMatrixTUtils.h:148
TMatrixTFlat::GetPtr
Element * GetPtr() const
Definition: TMatrixTUtils.h:447
TMatrixTFlat::operator=
void operator=(Element val)
Assign val to every element of the matrix.
Definition: TMatrixTUtils.cxx:693
TMatrixTBase.h
TMatrixTRow_const::TMatrixTRow_const
TMatrixTRow_const()
Definition: TMatrixTUtils.h:123
TMatrixTSparseRow::TMatrixTSparseRow
TMatrixTSparseRow()
Definition: TMatrixTUtils.h:618
TMatrixTDiag_const::fInc
Int_t fInc
Definition: TMatrixTUtils.h:320
TMatrixTColumn_const::GetMatrix
const TMatrixTBase< Element > * GetMatrix() const
Definition: TMatrixTUtils.h:232
TMatrixTSparseRow::operator*=
void operator*=(Element val)
Multiply every element of the matrix row by val.
Definition: TMatrixTUtils.cxx:1508
TMatrixTSparseDiag_const
Definition: TMatrixDUtilsfwd.h:41
TMatrixTRow::operator+=
void operator+=(Element val)
Add val to every element of the matrix row.
Definition: TMatrixTUtils.cxx:139
TMatrixTRow_const::fMatrix
const TMatrixTBase< Element > * fMatrix
Definition: TMatrixTUtils.h:117
TMatrixTFlat_const::fNelems
Int_t fNelems
Definition: TMatrixTUtils.h:410
TMatrixTDiag_const::operator=
TMatrixTDiag_const< Element > & operator=(const TMatrixTDiag_const< Element > &trc)
Definition: TMatrixTUtils.h:330
TMatrixTFlat_const::GetPtr
const Element * GetPtr() const
Definition: TMatrixTUtils.h:424
TMatrixTFlat_const::operator()
const Element & operator()(Int_t i) const
Definition: TMatrixTUtils.h:425
TMatrixTSub_const::fMatrix
const TMatrixTBase< Element > * fMatrix
Definition: TMatrixTUtils.h:495
TMatrixTColumn::operator()
Element & operator()(Int_t i)
Definition: TMatrixTUtils.h:275
TMatrixTBase::GetNrows
Int_t GetNrows() const
Definition: TMatrixTBase.h:123
TMatrixTFlat_const::operator[]
const Element & operator[](Int_t i) const
Definition: TMatrixTUtils.h:434
int
TMatrixTColumn_const::operator()
const Element & operator()(Int_t i) const
Definition: TMatrixTUtils.h:236
TMatrixTDiag::GetPtr
Element * GetPtr() const
Definition: TMatrixTUtils.h:361
TMatrixTDiag_const::GetInc
Int_t GetInc() const
Definition: TMatrixTUtils.h:336
Error
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition: TError.cxx:188
Drand
Double_t Drand(Double_t &ix)
Random number generator [0....1] with seed ix.
Definition: TMatrixTUtils.cxx:1877
TMatrixTDiag_const::fPtr
const Element * fPtr
Definition: TMatrixTUtils.h:322
TMatrixTSparseRow_const::fRowInd
Int_t fRowInd
Definition: TMatrixTUtils.h:589
TMatrixTSparseRow_const::fNindex
Int_t fNindex
Definition: TMatrixTUtils.h:590