Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TVectorT< Element > Class Template Reference

template<class Element>
class TVectorT< Element >

TVectorT.

Template class of Vectors in the linear algebra package.

See the Matrix Linear Algebra page for the documentation of the linear algebra package

Unless otherwise specified, vector indices always start with 0, spanning up to the specified limit-1.

For (n) vectors where n <= kSizeMax (5 currently) storage space is available on the stack, thus avoiding expensive allocation/ deallocation of heap space . However, this introduces of course kSizeMax overhead for each vector object . If this is an issue recompile with a new appropriate value (>=0) for kSizeMax

Another way to assign and store vector data is through Use see for instance stressLinear.cxx file .

Note that Constructors/assignments exists for all different matrix views

For usage examples see $ROOTSYS/test/stressLinear.cxx

Definition at line 27 of file TVectorT.h.

Public Member Functions

 TVectorT ()
 
 TVectorT (const TMatrixTColumn_const< Element > &mc)
 Constructor : create vector from matrix column.
 
 TVectorT (const TMatrixTDiag_const< Element > &md)
 Constructor : create vector from matrix diagonal.
 
 TVectorT (const TMatrixTRow_const< Element > &mr)
 Constructor : create vector from matrix row.
 
 TVectorT (const TVectorT< Element > &another)
 Copy constructor.
 
template<class Element2 >
 TVectorT (const TVectorT< Element2 > &another)
 
 TVectorT (Int_t lwb, Int_t upb)
 Constructor [lwb..upb]-vector.
 
 TVectorT (Int_t lwb, Int_t upb, const Element *elements)
 Constructor [lwb..upb]-vector with data copied from array elements.
 
 TVectorT (Int_t lwb, Int_t upb, Double_t iv1,...)
 Make a vector and assign initial values.
 
 TVectorT (Int_t n)
 Constructor n-vector.
 
 TVectorT (Int_t n, const Element *elements)
 Constructor n-vector with data copied from array elements.
 
 ~TVectorT () override
 
TVectorT< Element > & Abs ()
 Take an absolute value of a vector, i.e. apply Abs() to each element.
 
void Add (const TVectorT< Element > &v)
 Add vector v to this vector.
 
void Add (const TVectorT< Element > &v1, const TVectorT< Element > &v2)
 Set this vector to v1+v2.
 
void AddSomeConstant (Element val, const TVectorT< Element > &select)
 Add to vector elements as selected through array select the value val.
 
TVectorT< Element > & Apply (const TElementActionT< Element > &action)
 Apply action to each element of the vector.
 
TVectorT< Element > & Apply (const TElementPosActionT< Element > &action)
 Apply action to each element of the vector.
 
TClassClass ()
 
void Clear (Option_t *="") override
 
void Draw (Option_t *option="") override
 Draw this vector The histogram is named "TVectorT" by default and no title.
 
Int_t GetLwb () const
 
Element * GetMatrixArray ()
 
const Element * GetMatrixArray () const
 
Int_t GetNoElements () const
 
Int_t GetNrows () const
 
TVectorT< Element > GetSub (Int_t row_lwb, Int_t row_upb, Option_t *option="S") const
 
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 option:
 
Int_t GetUpb () const
 
void Invalidate ()
 
TVectorT< Element > & Invert ()
 v[i] = 1/v[i]
 
TClassIsA () const override
 
Bool_t IsOwner () const
 
Bool_t IsValid () const
 
void MakeValid ()
 
Bool_t MatchesNonZeroPattern (const TVectorT< Element > &select)
 Check if vector elements as selected through array select are non-zero.
 
Element Max () const
 return maximum vector element value
 
Element Min () const
 return minimum vector element value
 
Int_t NonZeros () const
 Compute the number of elements != 0.0.
 
Element Norm1 () const
 Compute the 1-norm of the vector SUM{ |v[i]| }.
 
Element Norm2Sqr () const
 Compute the square of the 2-norm SUM{ v[i]^2 }.
 
Element NormInf () const
 Compute the infinity-norm of the vector MAX{ |v[i]| }.
 
Bool_t operator!= (Element val) const
 Are all vector elements not equal to val?
 
Element & operator() (Int_t index)
 
const Element & operator() (Int_t index) const
 
TVectorT< Element > & operator*= (const TMatrixT< Element > &a)
 "Inplace" multiplication target = A*target.
 
TVectorT< Element > & operator*= (const TMatrixTSparse< Element > &a)
 "Inplace" multiplication target = A*target.
 
TVectorT< Element > & operator*= (const TMatrixTSym< Element > &a)
 "Inplace" multiplication target = A*target.
 
TVectorT< Element > & operator*= (Element val)
 Multiply every element of the vector with val.
 
TVectorT< Element > & operator+= (const TVectorT< Element > &source)
 Add vector source.
 
TVectorT< Element > & operator+= (Element val)
 Add val to every element of the vector.
 
TVectorT< Element > & operator-= (const TVectorT< Element > &source)
 Subtract vector source.
 
TVectorT< Element > & operator-= (Element val)
 Subtract val from every element of the vector.
 
Bool_t operator< (Element val) const
 Are all vector elements < val?
 
Bool_t operator<= (Element val) const
 Are all vector elements <= val?
 
TVectorT< Element > & operator= (const TMatrixTColumn_const< Element > &mc)
 Assign a matrix column to a vector.
 
TVectorT< Element > & operator= (const TMatrixTDiag_const< Element > &md)
 Assign the matrix diagonal to a vector.
 
TVectorT< Element > & operator= (const TMatrixTRow_const< Element > &mr)
 Assign a matrix row to a vector.
 
TVectorT< Element > & operator= (const TMatrixTSparseDiag_const< Element > &md)
 Assign a sparse matrix diagonal to a vector.
 
TVectorT< Element > & operator= (const TMatrixTSparseRow_const< Element > &md)
 Assign a sparse matrix row to a vector.
 
TVectorT< Element > & operator= (const TVectorT< Element > &source)
 Notice that this assignment does NOT change the ownership : if the storage space was adopted, source is copied to this space .
 
template<class Element2 >
TVectorT< Element > & operator= (const TVectorT< Element2 > &source)
 
TVectorT< Element > & operator= (Element val)
 Assign val to every element of the vector.
 
Bool_t operator== (Element val) const
 Are all vector elements equal to val?
 
Bool_t operator> (Element val) const
 Are all vector elements > val?
 
Bool_t operator>= (Element val) const
 Are all vector elements >= val?
 
Element & operator[] (Int_t index)
 
const Element & operator[] (Int_t index) const
 
void Print (Option_t *option="") const override
 Print the vector as a list of elements.
 
void Randomize (Element alpha, Element beta, Double_t &seed)
 randomize vector elements value
 
TVectorT< Element > & ResizeTo (const TVectorT< Element > &v)
 
TVectorT< Element > & ResizeTo (Int_t lwb, Int_t upb)
 Resize the vector to [lwb:upb] .
 
TVectorT< Element > & ResizeTo (Int_t n)
 
TVectorT< Element > & SelectNonZeros (const TVectorT< Element > &select)
 Keep only element as selected through array select non-zero.
 
void SetElements (const Element *elements)
 
TVectorT< Element > & SetSub (Int_t row_lwb, const TVectorT< Element > &source)
 Insert vector source starting at [row_lwb], thereby overwriting the part [row_lwb..row_lwb+nrows_source];.
 
TVectorT< Element > & Shift (Int_t row_shift)
 
Bool_t SomePositive (const TVectorT< Element > &select)
 Check if vector elements as selected through array select are all positive.
 
TVectorT< Element > & Sqr ()
 Square each element of the vector.
 
TVectorT< Element > & Sqrt ()
 Take square root of all elements.
 
void Streamer (TBuffer &) override
 Stream an object of class TVectorT.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
Element Sum () const
 Compute sum of elements.
 
const TVectorT< Element > & Use (const TVectorT< Element > &v) const
 
const TVectorT< Element > & Use (Int_t lwb, Int_t upb, const Element *data) const
 
TVectorT< Element > & Use (Int_t lwb, Int_t upb, Element *data)
 Use the array data to fill the vector lwb..upb].
 
const TVectorT< Element > & Use (Int_t n, const Element *data) const
 
TVectorT< Element > & Use (Int_t n, Element *data)
 
TVectorT< Element > & Use (TVectorT< Element > &v)
 
TVectorT< Element > & Zero ()
 Set vector elements to zero.
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor.
 
 TObject (const TObject &object)
 TObject copy ctor.
 
virtual ~TObject ()
 TObject destructor.
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract.
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action.
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility.
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method.
 
virtual void Copy (TObject &object) const
 Copy this to obj.
 
virtual void Delete (Option_t *option="")
 Delete this object.
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object.
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
 
virtual void Dump () const
 Dump contents of object on stdout.
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py).
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
 
virtual const char * GetIconName () const
 Returns mime type name of object.
 
virtual const char * GetName () const
 Returns name of object.
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 Returns title of object.
 
virtual UInt_t GetUniqueID () const
 Return the unique object id.
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
 
virtual ULong_t Hash () const
 Return hash value for this object.
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
 
void InvertBit (UInt_t f)
 
Bool_t IsDestructed () const
 IsDestructed.
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 The ls function lists the contents of a class on stdout.
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification (the base implementation is no-op).
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
 
void operator delete (void *ptr)
 Operator delete.
 
void operator delete[] (void *ptr)
 Operator delete [].
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator.
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself.
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list.
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out".
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
 
static Bool_t GetObjectStat ()
 Get status of object stat flag.
 
static void SetDtorOnly (void *obj)
 Set destructor only flag.
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
 

Protected Types

enum  { kSizeMax = 5 }
 
enum  { kWorkMax = 100 }
 
enum  EVectorStatusBits { kStatus = (1ULL << ( 14 )) }
 
- Protected Types inherited from TObject
enum  { kOnlyPrepStep = (1ULL << ( 3 )) }
 

Protected Member Functions

void Allocate (Int_t nrows, Int_t row_lwb=0, Int_t init=0)
 Allocate new vector.
 
void Delete_m (Int_t size, Element *&)
 Delete data pointer m, if it was assigned on the heap.
 
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 .
 
Element * New_m (Int_t size)
 default kTRUE, when Use array kFALSE
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
 
void MakeZombie ()
 

Protected Attributes

Element fDataStack [kSizeMax]
 
Element * fElements {nullptr}
 
Bool_t fIsOwner {kTRUE}
 data container
 
Int_t fNrows {0}
 
Int_t fRowLwb {0}
 

Additional Inherited Members

- Public Types inherited from TObject
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) ,
  kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 ))
}
 

#include <TVectorT.h>

Inheritance diagram for TVectorT< Element >:
[legend]

Member Enumeration Documentation

◆ anonymous enum

template<class Element >
anonymous enum
protected
Enumerator
kSizeMax 

Definition at line 34 of file TVectorT.h.

◆ anonymous enum

template<class Element >
anonymous enum
protected
Enumerator
kWorkMax 

Definition at line 35 of file TVectorT.h.

◆ EVectorStatusBits

template<class Element >
enum TVectorT::EVectorStatusBits
protected
Enumerator
kStatus 

Definition at line 47 of file TVectorT.h.

Constructor & Destructor Documentation

◆ TVectorT() [1/11]

template<class Element >
TVectorT< Element >::TVectorT ( )
inline

Definition at line 53 of file TVectorT.h.

◆ TVectorT() [2/11]

template<class Element >
TVectorT< Element >::TVectorT ( Int_t  n)
explicit

Constructor n-vector.

Definition at line 177 of file TVectorT.cxx.

◆ TVectorT() [3/11]

template<class Element >
TVectorT< Element >::TVectorT ( Int_t  lwb,
Int_t  upb 
)

Constructor [lwb..upb]-vector.

Definition at line 186 of file TVectorT.cxx.

◆ TVectorT() [4/11]

template<class Element >
TVectorT< Element >::TVectorT ( Int_t  n,
const Element *  elements 
)

Constructor n-vector with data copied from array elements.

Definition at line 195 of file TVectorT.cxx.

◆ TVectorT() [5/11]

template<class Element >
TVectorT< Element >::TVectorT ( Int_t  lwb,
Int_t  upb,
const Element *  elements 
)

Constructor [lwb..upb]-vector with data copied from array elements.

Definition at line 205 of file TVectorT.cxx.

◆ TVectorT() [6/11]

template<class Element >
TVectorT< Element >::TVectorT ( const TVectorT< Element > &  another)

Copy constructor.

Definition at line 215 of file TVectorT.cxx.

◆ TVectorT() [7/11]

template<class Element >
TVectorT< Element >::TVectorT ( const TMatrixTRow_const< Element > &  mr)

Constructor : create vector from matrix row.

Definition at line 226 of file TVectorT.cxx.

◆ TVectorT() [8/11]

template<class Element >
TVectorT< Element >::TVectorT ( const TMatrixTColumn_const< Element > &  mc)

Constructor : create vector from matrix column.

Definition at line 238 of file TVectorT.cxx.

◆ TVectorT() [9/11]

template<class Element >
TVectorT< Element >::TVectorT ( const TMatrixTDiag_const< Element > &  md)

Constructor : create vector from matrix diagonal.

Definition at line 250 of file TVectorT.cxx.

◆ TVectorT() [10/11]

template<class Element >
template<class Element2 >
TVectorT< Element >::TVectorT ( const TVectorT< Element2 > &  another)
inline

Definition at line 62 of file TVectorT.h.

◆ TVectorT() [11/11]

template<class Element >
TVectorT< Element >::TVectorT ( Int_t  lwb,
Int_t  upb,
Double_t  iv1,
  ... 
)

Make a vector and assign initial values.

Argument list should contain Element values to assign to vector elements. The list must be terminated by the string "END". Example: TVectorT foo(1,3,0.0,1.0,1.5,"END");

Definition at line 265 of file TVectorT.cxx.

◆ ~TVectorT()

template<class Element >
TVectorT< Element >::~TVectorT ( )
inlineoverride

Definition at line 71 of file TVectorT.h.

Member Function Documentation

◆ Abs()

template<class Element >
TVectorT< Element > & TVectorT< Element >::Abs

Take an absolute value of a vector, i.e. apply Abs() to each element.

Definition at line 464 of file TVectorT.cxx.

◆ Add() [1/2]

template<class Element >
void TVectorT< Element >::Add ( const TVectorT< Element > &  v)

Add vector v to this vector.

Definition at line 84 of file TVectorT.cxx.

◆ Add() [2/2]

template<class Element >
void TVectorT< Element >::Add ( const TVectorT< Element > &  v1,
const TVectorT< Element > &  v2 
)

Set this vector to v1+v2.

Definition at line 102 of file TVectorT.cxx.

◆ AddSomeConstant()

template<class Element >
void TVectorT< Element >::AddSomeConstant ( Element  val,
const TVectorT< Element > &  select 
)

Add to vector elements as selected through array select the value val.

Definition at line 1284 of file TVectorT.cxx.

◆ Allocate()

template<class Element >
void TVectorT< Element >::Allocate ( Int_t  nrows,
Int_t  row_lwb = 0,
Int_t  init = 0 
)
protected

Allocate new vector.

Arguments are number of rows and row lowerbound (0 default).

Definition at line 151 of file TVectorT.cxx.

◆ Apply() [1/2]

template<class Element >
TVectorT< Element > & TVectorT< Element >::Apply ( const TElementActionT< Element > &  action)

Apply action to each element of the vector.

Definition at line 1322 of file TVectorT.cxx.

◆ Apply() [2/2]

template<class Element >
TVectorT< Element > & TVectorT< Element >::Apply ( const TElementPosActionT< Element > &  action)

Apply action to each element of the vector.

In action the location of the current element is known.

Definition at line 1335 of file TVectorT.cxx.

◆ Class() [1/2]

template<class Element >
static TClass * TVectorT< Element >::Class ( )
static
Returns
TClass describing this class

◆ Class() [2/2]

TClass * TVectorT< double >::Class ( )

◆ Class_Name()

template<class Element >
static const char * TVectorT< Element >::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

template<class Element >
static constexpr Version_t TVectorT< Element >::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 185 of file TVectorT.h.

◆ Clear()

template<class Element >
void TVectorT< Element >::Clear ( Option_t = "")
inlineoverridevirtual

Reimplemented from TObject.

Definition at line 174 of file TVectorT.h.

◆ DeclFileName()

template<class Element >
static const char * TVectorT< Element >::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 185 of file TVectorT.h.

◆ Delete_m()

template<class Element >
void TVectorT< Element >::Delete_m ( Int_t  size,
Element *&  m 
)
protected

Delete data pointer m, if it was assigned on the heap.

Definition at line 53 of file TVectorT.cxx.

◆ Draw()

template<class Element >
void TVectorT< Element >::Draw ( Option_t option = "")
overridevirtual

Draw this vector The histogram is named "TVectorT" by default and no title.

Reimplemented from TObject.

Definition at line 1353 of file TVectorT.cxx.

◆ GetLwb()

template<class Element >
Int_t TVectorT< Element >::GetLwb ( ) const
inline

Definition at line 73 of file TVectorT.h.

◆ GetMatrixArray() [1/2]

template<class Element >
Element * TVectorT< Element >::GetMatrixArray ( )
inline

Definition at line 78 of file TVectorT.h.

◆ GetMatrixArray() [2/2]

template<class Element >
const Element * TVectorT< Element >::GetMatrixArray ( ) const
inline

Definition at line 79 of file TVectorT.h.

◆ GetNoElements()

template<class Element >
Int_t TVectorT< Element >::GetNoElements ( ) const
inline

Definition at line 76 of file TVectorT.h.

◆ GetNrows()

template<class Element >
Int_t TVectorT< Element >::GetNrows ( ) const
inline

Definition at line 75 of file TVectorT.h.

◆ GetSub() [1/2]

template<class Element >
TVectorT< Element > TVectorT< Element >::GetSub ( Int_t  row_lwb,
Int_t  row_upb,
Option_t option = "S" 
) const
inline

Definition at line 211 of file TVectorT.h.

◆ GetSub() [2/2]

template<class Element >
TVectorT< Element > & 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 option:

option == "S" : return [0..row_upb-row_lwb+1] (default) else : return [row_lwb..row_upb]

Definition at line 373 of file TVectorT.cxx.

◆ GetUpb()

template<class Element >
Int_t TVectorT< Element >::GetUpb ( ) const
inline

Definition at line 74 of file TVectorT.h.

◆ Invalidate()

template<class Element >
void TVectorT< Element >::Invalidate ( )
inline

Definition at line 81 of file TVectorT.h.

◆ Invert()

template<class Element >
TVectorT< Element > & TVectorT< Element >::Invert

v[i] = 1/v[i]

Definition at line 522 of file TVectorT.cxx.

◆ IsA()

template<class Element >
TClass * TVectorT< Element >::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 185 of file TVectorT.h.

◆ IsOwner()

template<class Element >
Bool_t TVectorT< Element >::IsOwner ( ) const
inline

Definition at line 84 of file TVectorT.h.

◆ IsValid()

template<class Element >
Bool_t TVectorT< Element >::IsValid ( ) const
inline

Definition at line 83 of file TVectorT.h.

◆ MakeValid()

template<class Element >
void TVectorT< Element >::MakeValid ( )
inline

Definition at line 82 of file TVectorT.h.

◆ MatchesNonZeroPattern()

template<class Element >
Bool_t TVectorT< Element >::MatchesNonZeroPattern ( const TVectorT< Element > &  select)

Check if vector elements as selected through array select are non-zero.

Definition at line 1238 of file TVectorT.cxx.

◆ Max()

template<class Element >
Element TVectorT< Element >::Max

return maximum vector element value

Definition at line 666 of file TVectorT.cxx.

◆ Memcpy_m()

template<class Element >
Int_t TVectorT< Element >::Memcpy_m ( Element *  newp,
const Element *  oldp,
Int_t  copySize,
Int_t  newSize,
Int_t  oldSize 
)
protected

Copy copySize doubles from *oldp to *newp .

However take care of the situation where both pointers are assigned to the same stack space

Definition at line 124 of file TVectorT.cxx.

◆ Min()

template<class Element >
Element TVectorT< Element >::Min

return minimum vector element value

Definition at line 654 of file TVectorT.cxx.

◆ New_m()

template<class Element >
Element * TVectorT< Element >::New_m ( Int_t  size)
protected

default kTRUE, when Use array kFALSE

Return data pointer .

if requested size <= kSizeMax, assign pointer to the stack space

Definition at line 67 of file TVectorT.cxx.

◆ NonZeros()

template<class Element >
Int_t TVectorT< Element >::NonZeros

Compute the number of elements != 0.0.

Definition at line 620 of file TVectorT.cxx.

◆ Norm1()

template<class Element >
Element TVectorT< Element >::Norm1

Compute the 1-norm of the vector SUM{ |v[i]| }.

Definition at line 567 of file TVectorT.cxx.

◆ Norm2Sqr()

template<class Element >
Element TVectorT< Element >::Norm2Sqr

Compute the square of the 2-norm SUM{ v[i]^2 }.

Definition at line 584 of file TVectorT.cxx.

◆ NormInf()

template<class Element >
Element TVectorT< Element >::NormInf

Compute the infinity-norm of the vector MAX{ |v[i]| }.

Definition at line 603 of file TVectorT.cxx.

◆ operator!=()

template<class Element >
Bool_t TVectorT< Element >::operator!= ( Element  val) const

Are all vector elements not equal to val?

Definition at line 1153 of file TVectorT.cxx.

◆ operator()() [1/2]

template<class Element >
Element & TVectorT< Element >::operator() ( Int_t  index)
inline

Definition at line 231 of file TVectorT.h.

◆ operator()() [2/2]

template<class Element >
const Element & TVectorT< Element >::operator() ( Int_t  index) const
inline

Definition at line 218 of file TVectorT.h.

◆ operator*=() [1/4]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator*= ( const TMatrixT< Element > &  a)

"Inplace" multiplication target = A*target.

A needn't be a square one If target has to be resized, it should own the storage: fIsOwner = kTRUE

Definition at line 952 of file TVectorT.cxx.

◆ operator*=() [2/4]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator*= ( const TMatrixTSparse< Element > &  a)

"Inplace" multiplication target = A*target.

A needn't be a square one If target has to be resized, it should own the storage: fIsOwner = kTRUE

Definition at line 1019 of file TVectorT.cxx.

◆ operator*=() [3/4]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator*= ( const TMatrixTSym< Element > &  a)

"Inplace" multiplication target = A*target.

A is symmetric . vector size will not change

Definition at line 1082 of file TVectorT.cxx.

◆ operator*=() [4/4]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator*= ( Element  val)

Multiply every element of the vector with val.

Definition at line 895 of file TVectorT.cxx.

◆ operator+=() [1/2]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator+= ( const TVectorT< Element > &  source)

Add vector source.

Definition at line 911 of file TVectorT.cxx.

◆ operator+=() [2/2]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator+= ( Element  val)

Add val to every element of the vector.

Definition at line 863 of file TVectorT.cxx.

◆ operator-=() [1/2]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator-= ( const TVectorT< Element > &  source)

Subtract vector source.

Definition at line 931 of file TVectorT.cxx.

◆ operator-=() [2/2]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator-= ( Element  val)

Subtract val from every element of the vector.

Definition at line 879 of file TVectorT.cxx.

◆ operator<()

template<class Element >
Bool_t TVectorT< Element >::operator< ( Element  val) const

Are all vector elements < val?

Definition at line 1170 of file TVectorT.cxx.

◆ operator<=()

template<class Element >
Bool_t TVectorT< Element >::operator<= ( Element  val) const

Are all vector elements <= val?

Definition at line 1187 of file TVectorT.cxx.

◆ operator=() [1/8]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator= ( const TMatrixTColumn_const< Element > &  mc)

Assign a matrix column to a vector.

Definition at line 729 of file TVectorT.cxx.

◆ operator=() [2/8]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator= ( const TMatrixTDiag_const< Element > &  md)

Assign the matrix diagonal to a vector.

Definition at line 760 of file TVectorT.cxx.

◆ operator=() [3/8]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator= ( const TMatrixTRow_const< Element > &  mr)

Assign a matrix row to a vector.

Definition at line 698 of file TVectorT.cxx.

◆ operator=() [4/8]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator= ( const TMatrixTSparseDiag_const< Element > &  md)

Assign a sparse matrix diagonal to a vector.

Definition at line 823 of file TVectorT.cxx.

◆ operator=() [5/8]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator= ( const TMatrixTSparseRow_const< Element > &  mr)

Assign a sparse matrix row to a vector.

The matrix row is implicitly transposed to allow the assignment in the strict sense.

Definition at line 792 of file TVectorT.cxx.

◆ operator=() [6/8]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator= ( const TVectorT< Element > &  source)

Notice that this assignment does NOT change the ownership : if the storage space was adopted, source is copied to this space .

Definition at line 680 of file TVectorT.cxx.

◆ operator=() [7/8]

template<class Element >
template<class Element2 >
TVectorT< Element > & TVectorT< Element >::operator= ( const TVectorT< Element2 > &  source)
inline

Definition at line 130 of file TVectorT.h.

◆ operator=() [8/8]

template<class Element >
TVectorT< Element > & TVectorT< Element >::operator= ( Element  val)

Assign val to every element of the vector.

Definition at line 847 of file TVectorT.cxx.

◆ operator==()

template<class Element >
Bool_t TVectorT< Element >::operator== ( Element  val) const

Are all vector elements equal to val?

Definition at line 1136 of file TVectorT.cxx.

◆ operator>()

template<class Element >
Bool_t TVectorT< Element >::operator> ( Element  val) const

Are all vector elements > val?

Definition at line 1204 of file TVectorT.cxx.

◆ operator>=()

template<class Element >
Bool_t TVectorT< Element >::operator>= ( Element  val) const

Are all vector elements >= val?

Definition at line 1221 of file TVectorT.cxx.

◆ operator[]() [1/2]

template<class Element >
Element & TVectorT< Element >::operator[] ( Int_t  index)
inline

Definition at line 122 of file TVectorT.h.

◆ operator[]() [2/2]

template<class Element >
const Element & TVectorT< Element >::operator[] ( Int_t  index) const
inline

Definition at line 121 of file TVectorT.h.

◆ Print()

template<class Element >
void TVectorT< Element >::Print ( Option_t option = "") const
overridevirtual

Print the vector as a list of elements.

Reimplemented from TObject.

Definition at line 1363 of file TVectorT.cxx.

◆ Randomize()

template<class Element >
void TVectorT< Element >::Randomize ( Element  alpha,
Element  beta,
Double_t seed 
)

randomize vector elements value

Definition at line 1305 of file TVectorT.cxx.

◆ ResizeTo() [1/3]

template<class Element >
TVectorT< Element > & TVectorT< Element >::ResizeTo ( const TVectorT< Element > &  v)
inline

Definition at line 90 of file TVectorT.h.

◆ ResizeTo() [2/3]

template<class Element >
TVectorT< Element > & TVectorT< Element >::ResizeTo ( Int_t  lwb,
Int_t  upb 
)

Resize the vector to [lwb:upb] .

New dynamic elements are created, the overlapping part of the old ones are copied to the new structures, then the old elements are deleted.

Definition at line 294 of file TVectorT.cxx.

◆ ResizeTo() [3/3]

template<class Element >
TVectorT< Element > & TVectorT< Element >::ResizeTo ( Int_t  n)
inline

Definition at line 89 of file TVectorT.h.

◆ SelectNonZeros()

template<class Element >
TVectorT< Element > & TVectorT< Element >::SelectNonZeros ( const TVectorT< Element > &  select)

Keep only element as selected through array select non-zero.

Definition at line 544 of file TVectorT.cxx.

◆ SetElements()

template<class Element >
void TVectorT< Element >::SetElements ( const Element *  elements)
inline

Definition at line 85 of file TVectorT.h.

◆ SetSub()

template<class Element >
TVectorT< Element > & TVectorT< Element >::SetSub ( Int_t  row_lwb,
const TVectorT< Element > &  source 
)

Insert vector source starting at [row_lwb], thereby overwriting the part [row_lwb..row_lwb+nrows_source];.

Definition at line 422 of file TVectorT.cxx.

◆ Shift()

template<class Element >
TVectorT< Element > & TVectorT< Element >::Shift ( Int_t  row_shift)
inline

Definition at line 87 of file TVectorT.h.

◆ SomePositive()

template<class Element >
Bool_t TVectorT< Element >::SomePositive ( const TVectorT< Element > &  select)

Check if vector elements as selected through array select are all positive.

Definition at line 1261 of file TVectorT.cxx.

◆ Sqr()

template<class Element >
TVectorT< Element > & TVectorT< Element >::Sqr

Square each element of the vector.

Definition at line 482 of file TVectorT.cxx.

◆ Sqrt()

template<class Element >
TVectorT< Element > & TVectorT< Element >::Sqrt

Take square root of all elements.

Definition at line 500 of file TVectorT.cxx.

◆ Streamer()

template<class Element >
void TVectorT< Element >::Streamer ( TBuffer R__b)
overridevirtual

Stream an object of class TVectorT.

Reimplemented from TObject.

Definition at line 2336 of file TVectorT.cxx.

◆ StreamerNVirtual()

template<class Element >
void TVectorT< Element >::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 185 of file TVectorT.h.

◆ Sum()

template<class Element >
Element TVectorT< Element >::Sum

Compute sum of elements.

Definition at line 637 of file TVectorT.cxx.

◆ Use() [1/6]

template<class Element >
const TVectorT< Element > & TVectorT< Element >::Use ( const TVectorT< Element > &  v) const
inline

Definition at line 206 of file TVectorT.h.

◆ Use() [2/6]

template<class Element >
const TVectorT< Element > & TVectorT< Element >::Use ( Int_t  lwb,
Int_t  upb,
const Element *  data 
) const
inline

Definition at line 93 of file TVectorT.h.

◆ Use() [3/6]

template<class Element >
TVectorT< Element > & TVectorT< Element >::Use ( Int_t  lwb,
Int_t  upb,
Element *  data 
)

Use the array data to fill the vector lwb..upb].

Definition at line 349 of file TVectorT.cxx.

◆ Use() [4/6]

template<class Element >
const TVectorT< Element > & TVectorT< Element >::Use ( Int_t  n,
const Element *  data 
) const
inline

Definition at line 200 of file TVectorT.h.

◆ Use() [5/6]

template<class Element >
TVectorT< Element > & TVectorT< Element >::Use ( Int_t  n,
Element *  data 
)
inline

Definition at line 199 of file TVectorT.h.

◆ Use() [6/6]

template<class Element >
TVectorT< Element > & TVectorT< Element >::Use ( TVectorT< Element > &  v)
inline

Definition at line 201 of file TVectorT.h.

◆ Zero()

template<class Element >
TVectorT< Element > & TVectorT< Element >::Zero

Set vector elements to zero.

Definition at line 453 of file TVectorT.cxx.

Member Data Documentation

◆ fDataStack

template<class Element >
Element TVectorT< Element >::fDataStack[kSizeMax]
protected

Definition at line 37 of file TVectorT.h.

◆ fElements

template<class Element >
Element* TVectorT< Element >::fElements {nullptr}
protected

Definition at line 32 of file TVectorT.h.

◆ fIsOwner

template<class Element >
Bool_t TVectorT< Element >::fIsOwner {kTRUE}
protected

data container

Definition at line 38 of file TVectorT.h.

◆ fNrows

template<class Element >
Int_t TVectorT< Element >::fNrows {0}
protected

Definition at line 30 of file TVectorT.h.

◆ fRowLwb

template<class Element >
Int_t TVectorT< Element >::fRowLwb {0}
protected

Definition at line 31 of file TVectorT.h.

  • math/matrix/inc/TMatrixTBase.h
  • math/matrix/inc/TVectorT.h
  • math/matrix/src/TVectorT.cxx