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(const TVector& another) virtual void ~TVector() TVector& Abs() TVector& Apply(TElementAction& action) TVector& Apply(TElementPosAction& action) static TClass* Class() virtual void Draw(Option_t* option) 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 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 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) 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()
 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]| }.

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

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

TVector(Int_t n)

TVector(Int_t lwb, Int_t upb)

Bool_t IsValid() const

TVector(const TVector &another)

void ResizeTo(Int_t n)

void ResizeTo(const TVector &v)



Inline Functions


               void Invalidate()
            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
           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()
           TVector& Abs()
           TVector& Sqr()
           TVector& Sqrt()
           TVector& Apply(TElementAction& action)
           TVector& Apply(TElementPosAction& action)
            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.6 2000/12/13 15:13:52 brun 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.