TVector


class description - source file - inheritance tree

class TVector : public TObject


    protected:
void Allocate(Int_t nrows, Int_t row_lwb = 0) void Invalidate() public:
TVector TVector() TVector TVector(Int_t n) TVector TVector(Int_t lwb, Int_t upb) TVector TVector(Int_t n, const Real_t* elements) TVector TVector(Int_t lwb, Int_t upb, const Real_t* elements) TVector TVector(const TVector& another) TVector TVector(const TMatrixRow& mr) TVector TVector(const TMatrixColumn& mc) TVector TVector(const TMatrixDiag& md) virtual void ~TVector() TVector& Abs() TVector& Apply(const TElementAction& action) TVector& Apply(const TElementPosAction& action) static TClass* Class() virtual void Draw(Option_t* option) Real_t* GetElements() const Real_t* GetElements() const Int_t GetLwb() const Int_t GetNoElements() const Int_t GetNrows() const Int_t GetUpb() const virtual TClass* IsA() const Bool_t IsValid() const Double_t Norm1() const Double_t Norm2Sqr() const Double_t NormInf() const Bool_t operator!=(Real_t val) const const Real_t& operator()(Int_t index) const Real_t& operator()(Int_t index) TVector& operator*=(Double_t val) TVector& operator*=(const TMatrix& a) TVector& operator+=(Double_t val) TVector& operator-=(Double_t val) Bool_t operator<(Real_t val) const Bool_t operator<=(Real_t val) const TVector& operator=(const TVector& source) TVector& operator=(Real_t val) TVector& operator=(const TMatrixRow& mr) TVector& operator=(const TMatrixColumn& mc) TVector& operator=(const TMatrixDiag& md) Bool_t operator==(Real_t val) const Bool_t operator>(Real_t val) const Bool_t operator>=(Real_t val) const const Real_t& operator[](Int_t index) const Real_t& operator[](Int_t index) virtual void Print(Option_t* option) const void ResizeTo(Int_t n) void ResizeTo(Int_t lwb, Int_t upb) void ResizeTo(const TVector& v) void SetElements(const Real_t* elements) virtual void ShowMembers(TMemberInspector& insp, char* parent) TVector& Sqr() TVector& Sqrt() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) TVector& Zero()

Data Members


    protected:
Int_t fNmem ! number of rows in allocated memory (>=fNrows) Int_t fNrows number of rows Int_t fRowLwb lower bound of the row index Real_t* fElements [fNrows] elements themselves

Class Description

                                                                      
 Linear Algebra Package                                               
                                                                      
 The present package implements all the basic algorithms dealing      
 with vectors, matrices, matrix columns, rows, diagonals, etc.        
                                                                      
 Matrix elements are arranged in memory in a COLUMN-wise              
 fashion (in FORTRAN's spirit). In fact, it makes it very easy to     
 feed the matrices to FORTRAN procedures, which implement more        
 elaborate algorithms.                                                
                                                                      
 Unless otherwise specified, matrix and vector indices always start   
 with 0, spanning up to the specified limit-1.                        
                                                                      
 The present package provides all facilities to completely AVOID      
 returning matrices. Use "TMatrix A(TMatrix::kTransposed,B);" and     
 other fancy constructors as much as possible. If one really needs    
 to return a matrix, return a TLazyMatrix object instead. The         
 conversion is completely transparent to the end user, e.g.           
 "TMatrix m = THaarMatrix(5);" and _is_ efficient.                    
                                                                      
 For usage examples see $ROOTSYS/test/vmatrix.cxx and vvector.cxx     
 and also:                                                            
 http://root.cern.ch/root/html/TMatrix.html#TMatrix:description       
                                                                      
 The implementation is based on original code by                      
 Oleg E. Kiselyov (oleg@pobox.com).                                   
                                                                      


void Allocate(Int_t nrows, Int_t row_lwb)
 Allocate new vector. Arguments are number of rows and row
 lowerbound (0 default).

TVector(Int_t lwb, Int_t upb, Double_t va_(iv1), ...)
 Make a vector and assign initial values. Argument list should contain
 Double_t values to assign to vector elements. The list must be
 terminated by the string "END". Example:
 TVector foo(1,3,0.0,1.0,1.5,"END");

TVector(const TMatrixRow &mr) : TObject(mr)

TVector(const TMatrixColumn &mc) : TObject(mc)

TVector(const TMatrixDiag &md) : TObject(md)

~TVector()
 TVector destructor.

void Draw(Option_t *option)
 Draw this vector using an intermediate histogram
 The histogram is named "TVector" by default and no title

void ResizeTo(Int_t lwb, Int_t upb)
 Resize the vector for a specified number of elements, trying to keep
 intact as many elements of the old vector as possible. If the vector is
 expanded, the new elements will be zeroes.

Double_t Norm1() const
 Compute the 1-norm of the vector SUM{ |v[i]| }.

Double_t Norm2Sqr() const
 Compute the square of the 2-norm SUM{ v[i]^2 }.

Double_t NormInf() const
 Compute the infinity-norm of the vector MAX{ |v[i]| }.

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

TVector Sqr()
 Square each element of the vector.

TVector Sqrt()
 Take square root of all elements.

TVector Apply(const TElementAction &action)
 Apply action to each element of the vector.

TVector Apply(const TElementPosAction &action)
 Apply action to each element of the vector. To action the location
 of the current element is passed.

void Print(Option_t *) const
 Print the vector as a list of elements.

void Streamer(TBuffer &R__b)
 Stream an object of class TVector.



Inline Functions


                 void Invalidate()
              TVector TVector(Int_t lwb, Int_t upb, const Real_t* elements)
              TVector TVector(const TVector& another)
              TVector TVector(const TMatrixRow& mr)
              TVector TVector(const TMatrixColumn& mc)
              TVector TVector(const TMatrixDiag& md)
                 void ResizeTo(Int_t lwb, Int_t upb)
                 void ResizeTo(const TVector& v)
               Bool_t IsValid() const
        const Real_t& operator()(Int_t index) const
              Real_t& operator()(Int_t index)
        const Real_t& operator[](Int_t index) const
              Real_t& operator[](Int_t index)
                Int_t GetLwb() const
                Int_t GetUpb() const
                Int_t GetNrows() const
                Int_t GetNoElements() const
              Real_t* GetElements()
        const Real_t* GetElements() const
                 void SetElements(const Real_t* elements)
             TVector& operator=(const TVector& source)
             TVector& operator=(Real_t val)
             TVector& operator=(const TMatrixRow& mr)
             TVector& operator=(const TMatrixColumn& mc)
             TVector& operator=(const TMatrixDiag& md)
             TVector& operator-=(Double_t val)
             TVector& operator+=(Double_t val)
             TVector& operator*=(Double_t val)
             TVector& operator*=(const TMatrix& a)
               Bool_t operator==(Real_t val) const
               Bool_t operator!=(Real_t val) const
               Bool_t operator<(Real_t val) const
               Bool_t operator<=(Real_t val) const
               Bool_t operator>(Real_t val) const
               Bool_t operator>=(Real_t val) const
             TVector& Zero()
              TClass* Class()
              TClass* IsA() const
                 void ShowMembers(TMemberInspector& insp, char* parent)
                 void StreamerNVirtual(TBuffer& b)


Author: Fons Rademakers 05/11/97
Last update: root/matrix:$Name: $:$Id: TVector.cxx,v 1.26 2003/02/05 23:36:59 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.