BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
DifArray Class Reference

#include <DifArray.h>

Public Member Functions

 DifArray (int n, int npar=0)
 
 DifArray (const HepVector &v, int npar=0)
 
 DifArray (const DifArray &a)
 
 ~DifArray ()
 
DifNumberoperator[] (int i)
 
DifNumberoperator() (int i)
 
DifNumber fetch (int i) const
 
int nElem () const
 
DifArrayoperator= (const DifArray &)
 
HepMatrix jacobian () const
 
void zero (int npar=0)
 
void print () const
 
 DifArray (int n, int npar=0)
 
 DifArray (const HepVector &v, int npar=0)
 
 DifArray (const DifArray &a)
 
 ~DifArray ()
 
DifNumberoperator[] (int i)
 
DifNumberoperator() (int i)
 
DifNumber fetch (int i) const
 
int nElem () const
 
DifArrayoperator= (const DifArray &)
 
HepMatrix jacobian () const
 
void zero (int npar=0)
 
void print () const
 

Detailed Description

Constructor & Destructor Documentation

◆ DifArray() [1/6]

DifArray::DifArray ( int  n,
int  npar = 0 
)

Definition at line 29 of file DifArray.cxx.

29 :
30 _nElem(n),
31 _pointer(new DifNumber[n])
32{zero(npar);}
const Int_t n
const DifNumber zero

◆ DifArray() [2/6]

DifArray::DifArray ( const HepVector &  v,
int  npar = 0 
)

Definition at line 34 of file DifArray.cxx.

34 :
35 _nElem(a.num_row()),
36 _pointer(new DifNumber[nElem()])
37{copy(a,npar);}

◆ DifArray() [3/6]

DifArray::DifArray ( const DifArray a)

Definition at line 40 of file DifArray.cxx.

40 :
41 _nElem(a.nElem()),
42 _pointer(new DifNumber[nElem()])
43{copy(a);}

◆ ~DifArray() [1/2]

DifArray::~DifArray ( )

Definition at line 45 of file DifArray.cxx.

45{delete[] _pointer;}

◆ DifArray() [4/6]

DifArray::DifArray ( int  n,
int  npar = 0 
)

◆ DifArray() [5/6]

DifArray::DifArray ( const HepVector &  v,
int  npar = 0 
)

◆ DifArray() [6/6]

DifArray::DifArray ( const DifArray a)

◆ ~DifArray() [2/2]

DifArray::~DifArray ( )

Member Function Documentation

◆ fetch() [1/2]

DifNumber DifArray::fetch ( int  i) const

Definition at line 60 of file DifArray.cxx.

60 {
61 i=i-1;
62 assert(i>=0);
63 assert(i<nElem());
64 return _pointer[i];
65}

◆ fetch() [2/2]

DifNumber DifArray::fetch ( int  i) const

◆ jacobian() [1/2]

HepMatrix DifArray::jacobian ( ) const

Definition at line 72 of file DifArray.cxx.

72 {
73 int npar=_pointer[0].nPar();
74 HepMatrix temp(nElem(),npar,0);
75 for(int i=1; i<=nElem(); i++){
76 for(int j=1; j<=npar; j++) {
77 temp(i,j)=_pointer[i-1].derivative(j);
78 }
79 } //(int i=1; i<=nElem(); i++)
80 return temp;
81}

Referenced by BesPointErr::covRTPMatrix(), BesVectorErr::covRTPMatrix(), BesPointErr::covRZPMatrix(), BesVectorErr::covRZPMatrix(), TrkHelixUtils::helixFromMomErr(), and TrkHelixUtils::lineFromMomErr().

◆ jacobian() [2/2]

HepMatrix DifArray::jacobian ( ) const

◆ nElem() [1/2]

int DifArray::nElem ( ) const
inline

Definition at line 47 of file InstallArea/include/MdcRecoUtil/MdcRecoUtil/DifArray.h.

47{return _nElem;} // number of elements

Referenced by fetch(), jacobian(), operator()(), operator[](), print(), and zero().

◆ nElem() [2/2]

int DifArray::nElem ( ) const
inline

Definition at line 47 of file Reconstruction/MdcPatRec/MdcRecoUtil/MdcRecoUtil-00-01-08/MdcRecoUtil/DifArray.h.

47{return _nElem;} // number of elements

◆ operator()() [1/2]

DifNumber & DifArray::operator() ( int  i)

Definition at line 53 of file DifArray.cxx.

53 {
54 i=i-1;
55 assert(i>=0);
56 assert(i<nElem());
57 return _pointer[i];
58}

◆ operator()() [2/2]

DifNumber & DifArray::operator() ( int  i)

◆ operator=() [1/2]

DifArray & DifArray::operator= ( const DifArray rhs)

Definition at line 67 of file DifArray.cxx.

67 {
68 copy(rhs);
69 return *this;
70}

◆ operator=() [2/2]

DifArray & DifArray::operator= ( const DifArray )

◆ operator[]() [1/2]

DifNumber & DifArray::operator[] ( int  i)

Definition at line 47 of file DifArray.cxx.

47 {
48 assert(i>=0);
49 assert(i<nElem());
50 return _pointer[i];
51}

◆ operator[]() [2/2]

DifNumber & DifArray::operator[] ( int  i)

◆ print() [1/2]

void DifArray::print ( ) const

Definition at line 104 of file DifArray.cxx.

104 {
105 cout << "nElem=" << nElem() << endl;
106 for(int i=1; i<=nElem(); i++){
107 //SKIP cout << "element(" << i << ")=" << _pointer[i-1];
108 }
109
110}

◆ print() [2/2]

void DifArray::print ( ) const

◆ zero() [1/2]

void DifArray::zero ( int  npar = 0)

Definition at line 97 of file DifArray.cxx.

97 {
98 for(int i=0; i<nElem(); i++) {
99 _pointer[i]=0.0;
100 _pointer[i].setNPar(npar);
101 }
102}

◆ zero() [2/2]

void DifArray::zero ( int  npar = 0)

The documentation for this class was generated from the following files: