Logo ROOT  
Reference Guide
TVectorT.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_TVectorT
13 #define ROOT_TVectorT
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TVectorT //
18 // //
19 // Template class of Vectors in the linear algebra package //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TMatrixT.h"
24 #include "TMatrixTSym.h"
25 #include "TMatrixTSparse.h"
26 
27 template<class Element> class TVectorT : public TObject {
28 
29 protected:
30  Int_t fNrows{0}; // number of rows
31  Int_t fRowLwb{0}; // lower bound of the row index
32  Element *fElements{nullptr}; //[fNrows] elements themselves
33 
34  enum {kSizeMax = 5}; // size data container on stack, see New_m(),Delete_m()
35  enum {kWorkMax = 100}; // size of work array's in several routines
36 
37  Element fDataStack[kSizeMax]; //! data container
38  Bool_t fIsOwner{kTRUE}; //!default kTRUE, when Use array kFALSE
39 
40  Element* New_m (Int_t size);
41  void Delete_m(Int_t size,Element*&);
42  Int_t Memcpy_m(Element *newp,const Element *oldp,Int_t copySize,
43  Int_t newSize,Int_t oldSize);
44 
45  void Allocate(Int_t nrows,Int_t row_lwb = 0,Int_t init = 0);
46 
48  kStatus = BIT(14) // set if vector object is valid
49  };
50 
51 public:
52 
54  explicit TVectorT(Int_t n);
55  TVectorT(Int_t lwb,Int_t upb);
56  TVectorT(Int_t n,const Element *elements);
57  TVectorT(Int_t lwb,Int_t upb,const Element *elements);
58  TVectorT(const TVectorT <Element> &another);
62  template <class Element2> TVectorT(const TVectorT<Element2> &another)
63  {
64  R__ASSERT(another.IsValid());
65  Allocate(another.GetUpb()-another.GetLwb()+1,another.GetLwb());
66  *this = another;
67  }
68 #ifndef __CINT__
69  TVectorT(Int_t lwb,Int_t upb,Double_t iv1, ...);
70 #endif
71  virtual ~TVectorT() { TVectorT::Clear(); }
72 
73  inline Int_t GetLwb () const { return fRowLwb; }
74  inline Int_t GetUpb () const { return fNrows+fRowLwb-1; }
75  inline Int_t GetNrows () const { return fNrows; }
76  inline Int_t GetNoElements() const { return fNrows; }
77 
78  inline Element *GetMatrixArray () { return fElements; }
79  inline const Element *GetMatrixArray () const { return fElements; }
80 
81  inline void Invalidate () { SetBit(kStatus); }
82  inline void MakeValid () { ResetBit(kStatus); }
83  inline Bool_t IsValid () const { return !TestBit(kStatus); }
84  inline Bool_t IsOwner () const { return fIsOwner; }
85  inline void SetElements(const Element *elements) { R__ASSERT(IsValid());
86  memcpy(fElements,elements,fNrows*sizeof(Element)); }
87  inline TVectorT<Element> &Shift (Int_t row_shift) { fRowLwb += row_shift; return *this; }
89  inline TVectorT<Element> &ResizeTo (Int_t n) { return ResizeTo(0,n-1); }
90  inline TVectorT<Element> &ResizeTo (const TVectorT<Element> &v) { return ResizeTo(v.GetLwb(),v.GetUpb()); }
91 
92  TVectorT<Element> &Use (Int_t lwb,Int_t upb,Element *data);
93  const TVectorT<Element> &Use (Int_t lwb,Int_t upb,const Element *data) const
94  { return (const TVectorT<Element>&)(const_cast<TVectorT<Element> *>(this))->Use(lwb,upb,const_cast<Element *>(data)); }
95  TVectorT<Element> &Use (Int_t n,Element *data);
96  const TVectorT<Element> &Use (Int_t n,const Element *data) const ;
98  const TVectorT<Element> &Use (const TVectorT<Element> &v) const ;
99 
100  TVectorT<Element> &GetSub (Int_t row_lwb,Int_t row_upb,TVectorT<Element> &target,Option_t *option="S") const;
101  TVectorT<Element> GetSub (Int_t row_lwb,Int_t row_upb,Option_t *option="S") const;
102  TVectorT<Element> &SetSub (Int_t row_lwb,const TVectorT<Element> &source);
103 
110 
111  Element Norm1 () const;
112  Element Norm2Sqr() const;
113  Element NormInf () const;
114  Int_t NonZeros() const;
115  Element Sum () const;
116  Element Min () const;
117  Element Max () const;
118 
119  inline const Element &operator()(Int_t index) const;
120  inline Element &operator()(Int_t index);
121  inline const Element &operator[](Int_t index) const { return (*this)(index); }
122  inline Element &operator[](Int_t index) { return (*this)(index); }
123 
130  template <class Element2> TVectorT<Element> &operator= (const TVectorT<Element2> &source)
131  {
132  if (!AreCompatible(*this,source)) {
133  Error("operator=(const TVectorT2 &)","vectors not compatible");
134  return *this;
135  }
136 
137  TObject::operator=(source);
138  const Element2 * const ps = source.GetMatrixArray();
139  Element * const pt = GetMatrixArray();
140  for (Int_t i = 0; i < this->fNrows; i++)
141  pt[i] = ps[i];
142  return *this;
143  }
144 
145  TVectorT<Element> &operator= (Element val);
146  TVectorT<Element> &operator+=(Element val);
147  TVectorT<Element> &operator-=(Element val);
148  TVectorT<Element> &operator*=(Element val);
149 
155 
156  Bool_t operator==(Element val) const;
157  Bool_t operator!=(Element val) const;
158  Bool_t operator< (Element val) const;
159  Bool_t operator<=(Element val) const;
160  Bool_t operator> (Element val) const;
161  Bool_t operator>=(Element val) const;
162 
164  Bool_t SomePositive (const TVectorT<Element> &select);
165  void AddSomeConstant (Element val,const TVectorT<Element> &select);
166 
167  void Randomize (Element alpha,Element beta,Double_t &seed);
168 
171 
172  void Add(const TVectorT<Element> &v);
173  void Add(const TVectorT<Element> &v1, const TVectorT<Element> &v2);
174  void Clear(Option_t * /*option*/ ="") { if (fIsOwner) Delete_m(fNrows,fElements);
175  else fElements = 0;
176  fNrows = 0; }
177  void Draw (Option_t *option=""); // *MENU*
178  void Print(Option_t *option="") const; // *MENU*
179 
180  ClassDef(TVectorT,4) // Template of Vector class
181 };
182 
183 #ifndef __CINT__
184 // When building with -fmodules, it instantiates all pending instantiations,
185 // instead of delaying them until the end of the translation unit.
186 // We 'got away with' probably because the use and the definition of the
187 // explicit specialization do not occur in the same TU.
188 //
189 // In case we are building with -fmodules, we need to forward declare the
190 // specialization in order to compile the dictionary G__Matrix.cxx.
192 #endif // __CINT__
193 
194 template<class Element> inline TVectorT<Element> &TVectorT<Element>::Use (Int_t n,Element *data) { return Use(0,n-1,data); }
195 template<class Element> inline const TVectorT<Element> &TVectorT<Element>::Use (Int_t n,const Element *data) const { return Use(0,n-1,data); }
196 template<class Element> inline TVectorT<Element> &TVectorT<Element>::Use (TVectorT &v)
197  {
198  R__ASSERT(v.IsValid());
199  return Use(v.GetLwb(),v.GetUpb(),v.GetMatrixArray());
200  }
201 template<class Element> inline const TVectorT<Element> &TVectorT<Element>::Use (const TVectorT &v) const
202  {
203  R__ASSERT(v.IsValid());
204  return Use(v.GetLwb(),v.GetUpb(),v.GetMatrixArray());
205  }
206 template<class Element> inline TVectorT<Element> TVectorT<Element>::GetSub (Int_t row_lwb,Int_t row_upb,Option_t *option) const
207  {
208  TVectorT tmp;
209  this->GetSub(row_lwb,row_upb,tmp,option);
210  return tmp;
211  }
212 
213 template<class Element> inline const Element &TVectorT<Element>::operator()(Int_t ind) const
214 {
215  // Access a vector element.
216 
217  R__ASSERT(IsValid());
218  const Int_t aind = ind-fRowLwb;
219  if (aind >= fNrows || aind < 0) {
220  Error("operator()","Request index(%d) outside vector range of %d - %d",ind,fRowLwb,fRowLwb+fNrows);
222  }
223 
224  return fElements[aind];
225 }
226 template<class Element> inline Element &TVectorT<Element>::operator()(Int_t ind)
227 {
228  // Access a vector element.
229 
230  R__ASSERT(IsValid());
231  const Int_t aind = ind-fRowLwb;
232  if (aind >= fNrows || aind < 0) {
233  Error("operator()","Request index(%d) outside vector range of %d - %d",ind,fRowLwb,fRowLwb+fNrows);
235  }
236 
237  return fElements[aind];
238 }
239 
240 template<class Element> Bool_t operator== (const TVectorT <Element> &source1,const TVectorT <Element> &source2);
241 template<class Element> TVectorT<Element> operator+ (const TVectorT <Element> &source1,const TVectorT <Element> &source2);
242 template<class Element> TVectorT<Element> operator- (const TVectorT <Element> &source1,const TVectorT <Element> &source2);
243 template<class Element> Element operator* (const TVectorT <Element> &source1,const TVectorT <Element> &source2);
244 template<class Element> TVectorT<Element> operator* (const TMatrixT <Element> &a, const TVectorT <Element> &source);
245 template<class Element> TVectorT<Element> operator* (const TMatrixTSym <Element> &a, const TVectorT <Element> &source);
246 template<class Element> TVectorT<Element> operator* (const TMatrixTSparse<Element> &a, const TVectorT <Element> &source);
247 template<class Element> TVectorT<Element> operator* ( Element val, const TVectorT <Element> &source);
248 template<class Element>
249 inline
250 TVectorT<Element> operator* (const TVectorT <Element> &source, Element val) { return val * source; }
251 
252 template<class Element> Element Dot (const TVectorT <Element> &source1,const TVectorT <Element> &source2);
253 template <class Element1,class Element2>
255 template <class Element1,class Element2,class Element3>
257 template <class Element1,class Element2,class Element3>
258  Element1 Mult (const TVectorT <Element1> &v1, const TMatrixT <Element2> &m, const TVectorT <Element3> &v2);
259 
260 template<class Element> TVectorT<Element> &Add ( TVectorT <Element> &target, Element scalar, const TVectorT <Element> &source);
261 template<class Element> TVectorT<Element> &Add ( TVectorT <Element> &target, Element scalar, const TMatrixT <Element> &a,
262  const TVectorT<Element> &source);
263 template<class Element> TVectorT<Element> &Add ( TVectorT <Element> &target, Element scalar, const TMatrixTSym <Element> &a,
264  const TVectorT<Element> &source);
265 template<class Element> TVectorT<Element> &Add ( TVectorT <Element> &target, Element scalar, const TMatrixTSparse<Element> &a,
266  const TVectorT<Element> &source);
267 template<class Element> TVectorT<Element> &AddElemMult ( TVectorT <Element> &target, Element scalar, const TVectorT <Element> &source1,
268  const TVectorT <Element> &source2);
269 template<class Element> TVectorT<Element> &AddElemMult ( TVectorT <Element> &target, Element scalar, const TVectorT <Element> &source1,
270  const TVectorT <Element> &source2,const TVectorT <Element> &select);
271 template<class Element> TVectorT<Element> &AddElemDiv ( TVectorT <Element> &target, Element scalar, const TVectorT <Element> &source1,
272  const TVectorT <Element> &source2);
273 template<class Element> TVectorT<Element> &AddElemDiv ( TVectorT <Element> &target, Element scalar, const TVectorT <Element> &source1,
274  const TVectorT <Element> &source2,const TVectorT <Element> &select);
275 template<class Element> TVectorT<Element> &ElementMult ( TVectorT <Element> &target, const TVectorT <Element> &source);
276 template<class Element> TVectorT<Element> &ElementMult ( TVectorT <Element> &target, const TVectorT <Element> &source, const TVectorT <Element> &select);
277 template<class Element> TVectorT<Element> &ElementDiv ( TVectorT <Element> &target, const TVectorT <Element> &source);
278 template<class Element> TVectorT<Element> &ElementDiv ( TVectorT <Element> &target, const TVectorT <Element> &source, const TVectorT <Element> &select);
279 
280 template<class Element1,class Element2> Bool_t AreCompatible(const TVectorT<Element1> &v1,const TVectorT<Element2> &v2,Int_t verbose=0);
281 // Check matrix and vector for compatibility in multiply: M * v and v * M
282 template<class Element1,class Element2> Bool_t AreCompatible(const TMatrixT<Element1> &m, const TVectorT<Element2> &v, Int_t verbose=0);
283 template<class Element1,class Element2> Bool_t AreCompatible(const TVectorT<Element1> &v, const TMatrixT<Element2> &m, Int_t verbose=0);
284 
285 template<class Element> void Compare (const TVectorT <Element> &source1,const TVectorT <Element> &source2);
286 template<class Element> Bool_t VerifyVectorValue (const TVectorT <Element> &m, Element val,Int_t verbose, Element maxDevAllow);
287 template<class Element> Bool_t VerifyVectorValue (const TVectorT <Element> &m, Element val,Int_t verbose)
288  { return VerifyVectorValue(m,val,verbose,Element(0.0)); }
289 template<class Element> Bool_t VerifyVectorValue (const TVectorT <Element> &m, Element val)
290  { return VerifyVectorValue(m,val,1,Element(0.0)); }
291 template<class Element> Bool_t VerifyVectorIdentity (const TVectorT <Element> &m1,const TVectorT <Element> &m2, Int_t verbose, Element maxDevAllow);
293  { return VerifyVectorIdentity(m1,m2,verbose,Element(0.0)); }
294 template<class Element> Bool_t VerifyVectorIdentity (const TVectorT <Element> &m1,const TVectorT <Element> &m2)
295  { return VerifyVectorIdentity(m1,m2,1,Element(0.0)); }
296 
297 #endif
m
auto * m
Definition: textangle.C:8
TVectorT::operator()
Element & operator()(Int_t index)
Definition: TVectorT.h:226
n
const Int_t n
Definition: legend1.C:16
AddElemDiv
TVectorT< Element > & AddElemDiv(TVectorT< Element > &target, Element scalar, const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Modify addition: target += scalar * ElementDiv(source1,source2) .
Definition: TVectorT.cxx:1917
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TMatrixTBase::NaNValue
static Element & NaNValue()
Definition: TMatrixTBase.cxx:1086
TVectorT::operator>=
Bool_t operator>=(Element val) const
Are all vector elements >= val?
Definition: TVectorT.cxx:1221
operator*
Element operator*(const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Compute the scalar product.
Definition: TVectorT.cxx:1396
TVectorT::operator[]
Element & operator[](Int_t index)
Definition: TVectorT.h:122
TVectorT::~TVectorT
virtual ~TVectorT()
Definition: TVectorT.h:71
TVectorT< Double_t >::EVectorStatusBits
EVectorStatusBits
Definition: TVectorT.h:47
Option_t
const char Option_t
Definition: RtypesCore.h:66
TVectorT::Use
TVectorT< Element > & Use(Int_t lwb, Int_t upb, Element *data)
Use the array data to fill the vector lwb..upb].
Definition: TVectorT.cxx:349
TVectorT::ResizeTo
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
Definition: TVectorT.cxx:294
TVectorT::Max
Element Max() const
return maximum vector element value
Definition: TVectorT.cxx:666
TVectorT::operator()
const Element & operator()(Int_t index) const
Definition: TVectorT.h:213
TVectorT::GetMatrixArray
const Element * GetMatrixArray() const
Definition: TVectorT.h:79
TVectorT::operator!=
Bool_t operator!=(Element val) const
Are all vector elements not equal to val?
Definition: TVectorT.cxx:1153
TVectorT::operator<
Bool_t operator<(Element val) const
Are all vector elements < val?
Definition: TVectorT.cxx:1170
TMatrixTColumn_const
Definition: TMatrixTUtils.h:214
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
TVectorT::SetElements
void SetElements(const Element *elements)
Definition: TVectorT.h:85
TVectorT::Class
TClass * Class()
TGeant4Unit::ps
static constexpr double ps
Definition: TGeant4SystemOfUnits.h:165
TVectorT::Delete_m
void Delete_m(Int_t size, Element *&)
Delete data pointer m, if it was assigned on the heap.
Definition: TVectorT.cxx:53
TVectorT::Invalidate
void Invalidate()
Definition: TVectorT.h:81
TVectorT::Shift
TVectorT< Element > & Shift(Int_t row_shift)
Definition: TVectorT.h:87
TVectorT::New_m
Element * New_m(Int_t size)
default kTRUE, when Use array kFALSE
Definition: TVectorT.cxx:67
TVectorT::AddSomeConstant
void AddSomeConstant(Element val, const TVectorT< Element > &select)
Add to vector elements as selected through array select the value val.
Definition: TVectorT.cxx:1284
TMatrixTSym
TMatrixTSym.
Definition: TMatrixTSym.h:34
TVectorT::operator+=
TVectorT< Element > & operator+=(Element val)
Add val to every element of the vector.
Definition: TVectorT.cxx:863
TVectorT::GetNoElements
Int_t GetNoElements() const
Definition: TVectorT.h:76
TVectorT::kStatus
@ kStatus
Definition: TVectorT.h:48
TMatrixT.h
TVectorT::SetSub
TVectorT< Element > & SetSub(Int_t row_lwb, const TVectorT< Element > &source)
Insert vector source starting at [row_lwb], thereby overwriting the part [row_lwb....
Definition: TVectorT.cxx:422
TVectorT::operator<=
Bool_t operator<=(Element val) const
Are all vector elements <= val?
Definition: TVectorT.cxx:1187
VerifyVectorIdentity
Bool_t VerifyVectorIdentity(const TVectorT< Element > &m1, const TVectorT< Element > &m2, Int_t verbose, Element maxDevAllow)
Verify that elements of the two vectors are equal within maxDevAllow .
Definition: TVectorT.cxx:2297
TVectorT::operator==
Bool_t operator==(Element val) const
Are all vector elements equal to val?
Definition: TVectorT.cxx:1136
TMatrixT
TMatrixT.
Definition: TMatrixT.h:39
TVectorT::operator[]
const Element & operator[](Int_t index) const
Definition: TVectorT.h:121
AddElemMult
TVectorT< Element > & AddElemMult(TVectorT< Element > &target, Element scalar, const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Modify addition: target += scalar * ElementMult(source1,source2) .
Definition: TVectorT.cxx:1844
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TVectorT::Draw
void Draw(Option_t *option="")
Draw this vector The histogram is named "TVectorT" by default and no title.
Definition: TVectorT.cxx:1353
ROOT::Math::beta
double beta(double x, double y)
Calculates the beta function.
Definition: SpecFuncMathCore.cxx:111
OuterProduct
TMatrixT< Element1 > OuterProduct(const TVectorT< Element1 > &v1, const TVectorT< Element2 > &v2)
Return the matrix M = v1 * v2'.
Definition: TVectorT.cxx:1495
VerifyVectorValue
Bool_t VerifyVectorValue(const TVectorT< Element > &m, Element val, Int_t verbose, Element maxDevAllow)
Validate that all elements of vector have value val within maxDevAllow .
Definition: TVectorT.cxx:2262
v
@ v
Definition: rootcling_impl.cxx:3635
TVectorT::NonZeros
Int_t NonZeros() const
Compute the number of elements != 0.0.
Definition: TVectorT.cxx:620
bool
TVectorT::GetUpb
Int_t GetUpb() const
Definition: TVectorT.h:74
TVectorT::GetNrows
Int_t GetNrows() const
Definition: TVectorT.h:75
AreCompatible
Bool_t AreCompatible(const TVectorT< Element1 > &v1, const TVectorT< Element2 > &v2, Int_t verbose=0)
Check if v1 and v2 are both valid and have the same shape.
Definition: TVectorT.cxx:2131
TVectorT::Norm2Sqr
Element Norm2Sqr() const
Compute the square of the 2-norm SUM{ v[i]^2 }.
Definition: TVectorT.cxx:584
TVectorT::IsValid
Bool_t IsValid() const
Definition: TVectorT.h:83
TVectorT::Use
TVectorT< Element > & Use(TVectorT< Element > &v)
Definition: TVectorT.h:196
TVectorT::kSizeMax
@ kSizeMax
Definition: TVectorT.h:34
TVectorT::IsOwner
Bool_t IsOwner() const
Definition: TVectorT.h:84
TVectorT::fDataStack
Element fDataStack[kSizeMax]
Definition: TVectorT.h:37
TMatrixTDiag_const
Definition: TMatrixTUtils.h:316
TGeant4Unit::m2
static constexpr double m2
Definition: TGeant4SystemOfUnits.h:123
TVectorT::NormInf
Element NormInf() const
Compute the infinity-norm of the vector MAX{ |v[i]| }.
Definition: TVectorT.cxx:603
operator-
TVectorT< Element > operator-(const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Return source1-source2.
Definition: TVectorT.cxx:1423
TVectorT::Randomize
void Randomize(Element alpha, Element beta, Double_t &seed)
randomize vector elements value
Definition: TVectorT.cxx:1305
TVectorT::Sqr
TVectorT< Element > & Sqr()
Square each element of the vector.
Definition: TVectorT.cxx:482
TVectorT::Invert
TVectorT< Element > & Invert()
v[i] = 1/v[i]
Definition: TVectorT.cxx:522
Dot
Element Dot(const TVectorT< Element > &source1, const TVectorT< Element > &source2)
return inner-produvt v1 . v2
Definition: TVectorT.cxx:1478
TVectorT::operator>
Bool_t operator>(Element val) const
Are all vector elements > val?
Definition: TVectorT.cxx:1204
TVectorT::Sqrt
TVectorT< Element > & Sqrt()
Take square root of all elements.
Definition: TVectorT.cxx:500
a
auto * a
Definition: textangle.C:12
TVectorT::fNrows
Int_t fNrows
Definition: TVectorT.h:30
TVectorT::Min
Element Min() const
return minimum vector element value
Definition: TVectorT.cxx:654
TVectorT::ResizeTo
TVectorT< Element > & ResizeTo(const TVectorT< Element > &v)
Definition: TVectorT.h:90
TVectorT::MatchesNonZeroPattern
Bool_t MatchesNonZeroPattern(const TVectorT< Element > &select)
Check if vector elements as selected through array select are non-zero.
Definition: TVectorT.cxx:1238
TVectorT::ResizeTo
TVectorT< Element > & ResizeTo(Int_t n)
Definition: TVectorT.h:89
TVectorT::Use
const TVectorT< Element > & Use(Int_t n, const Element *data) const
Definition: TVectorT.h:195
Compare
void Compare(const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Compare two vectors and print out the result of the comparison.
Definition: TVectorT.cxx:2209
BIT
#define BIT(n)
Definition: Rtypes.h:85
TVectorT::Memcpy_m
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: TVectorT.cxx:124
TVectorT::Clear
void Clear(Option_t *="")
Definition: TVectorT.h:174
TVectorT::GetSub
TVectorT< Element > GetSub(Int_t row_lwb, Int_t row_upb, Option_t *option="S") const
Definition: TVectorT.h:206
operator+
TVectorT< Element > operator+(const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Return source1+source2.
Definition: TVectorT.cxx:1412
ElementDiv
TVectorT< Element > & ElementDiv(TVectorT< Element > &target, const TVectorT< Element > &source)
Divide target by the source, element-by-element.
Definition: TVectorT.cxx:2075
TMatrixTSparseRow_const
Definition: TMatrixTUtils.h:585
TVectorT::fRowLwb
Int_t fRowLwb
Definition: TVectorT.h:31
TVectorT::Abs
TVectorT< Element > & Abs()
Take an absolute value of a vector, i.e. apply Abs() to each element.
Definition: TVectorT.cxx:464
TVectorT::fElements
Element * fElements
Definition: TVectorT.h:32
TVectorT::GetMatrixArray
Element * GetMatrixArray()
Definition: TVectorT.h:78
TVectorT::Apply
TVectorT< Element > & Apply(const TElementActionT< Element > &action)
Apply action to each element of the vector.
Definition: TVectorT.cxx:1322
TVectorT::Allocate
void Allocate(Int_t nrows, Int_t row_lwb=0, Int_t init=0)
Allocate new vector.
Definition: TVectorT.cxx:151
ElementMult
TVectorT< Element > & ElementMult(TVectorT< Element > &target, const TVectorT< Element > &source)
Multiply target by the source, element-by-element.
Definition: TVectorT.cxx:2032
TElementActionT
Definition: TMatrixTUtils.h:56
TVectorT
TVectorT.
Definition: TVectorT.h:27
TMatrixTSparse
TMatrixTSparse.
Definition: TMatrixTSparse.h:36
TVectorT::Use
const TVectorT< Element > & Use(const TVectorT< Element > &v) const
Definition: TVectorT.h:201
TMatrixTRow_const
Definition: TMatrixTUtils.h:114
v1
@ v1
Definition: rootcling_impl.cxx:3637
Double_t
double Double_t
Definition: RtypesCore.h:59
Add
TVectorT< Element > & Add(TVectorT< Element > &target, Element scalar, const TVectorT< Element > &source)
Modify addition: target += scalar * source.
Definition: TVectorT.cxx:1587
TVectorT::operator=
TVectorT< Element > & operator=(const TVectorT< Element > &source)
Notice that this assignment does NOT change the ownership : if the storage space was adopted,...
Definition: TVectorT.cxx:680
TObject::operator=
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Definition: TObject.h:268
R__ASSERT
#define R__ASSERT(e)
Definition: TError.h:120
TVectorT::kWorkMax
@ kWorkMax
Definition: TVectorT.h:35
TVectorT::SomePositive
Bool_t SomePositive(const TVectorT< Element > &select)
Check if vector elements as selected through array select are all positive.
Definition: TVectorT.cxx:1261
TVectorT::TVectorT
TVectorT(const TVectorT< Element2 > &another)
Definition: TVectorT.h:62
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TElementPosActionT
Definition: TMatrixTUtils.h:86
v2
@ v2
Definition: rootcling_impl.cxx:3638
TVectorT::GetSub
TVectorT< Element > & GetSub(Int_t row_lwb, Int_t row_upb, TVectorT< Element > &target, Option_t *option="S") const
Get subvector [row_lwb..row_upb]; The indexing range of the returned vector depends on the argument o...
Definition: TVectorT.cxx:373
TVectorT::Sum
Element Sum() const
Compute sum of elements.
Definition: TVectorT.cxx:637
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TVectorT::Use
const TVectorT< Element > & Use(Int_t lwb, Int_t upb, const Element *data) const
Definition: TVectorT.h:93
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TVectorT::Add
void Add(const TVectorT< Element > &v)
Add vector v to this vector.
Definition: TVectorT.cxx:84
TVectorT::operator*=
TVectorT< Element > & operator*=(Element val)
Multiply every element of the vector with val.
Definition: TVectorT.cxx:895
TVectorT::Zero
TVectorT< Element > & Zero()
Set vector elements to zero.
Definition: TVectorT.cxx:453
TVectorT::Use
TVectorT< Element > & Use(Int_t n, Element *data)
Definition: TVectorT.h:194
TMatrixTSym.h
TVectorT::MakeValid
void MakeValid()
Definition: TVectorT.h:82
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
TVectorT::Norm1
Element Norm1() const
Compute the 1-norm of the vector SUM{ |v[i]| }.
Definition: TVectorT.cxx:567
TVectorT::fIsOwner
Bool_t fIsOwner
data container
Definition: TVectorT.h:38
TVectorT::TVectorT
TVectorT()
Definition: TVectorT.h:53
TVectorT::SelectNonZeros
TVectorT< Element > & SelectNonZeros(const TVectorT< Element > &select)
Keep only element as selected through array select non-zero.
Definition: TVectorT.cxx:544
TMatrixTSparse.h
pt
TPaveText * pt
Definition: entrylist_figure1.C:7
TVectorT::operator-=
TVectorT< Element > & operator-=(Element val)
Subtract val from every element of the vector.
Definition: TVectorT.cxx:879
TMatrixTSparseDiag_const
Definition: TMatrixTUtils.h:651
Mult
Element1 Mult(const TVectorT< Element1 > &v1, const TMatrixT< Element2 > &m, const TVectorT< Element3 > &v2)
Perform v1 * M * v2, a scalar result.
Definition: TVectorT.cxx:1542
TVectorT::Print
void Print(Option_t *option="") const
Print the vector as a list of elements.
Definition: TVectorT.cxx:1363
operator==
Bool_t operator==(const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Check to see if two vectors are identical.
Definition: TVectorT.cxx:1386
TVectorT::GetLwb
Int_t GetLwb() const
Definition: TVectorT.h:73
int
Error
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition: TError.cxx:187