CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
CLHEP::HepGenMatrix Class Referenceabstract

#include <GenMatrix.h>

+ Inheritance diagram for CLHEP::HepGenMatrix:

Classes

class  Alloc
 
class  HepGenMatrix_row
 
class  HepGenMatrix_row_const
 

Public Types

enum  { size_max = 25 }
 
typedef std::vector< double, Alloc< double, 25 > >::iterator mIter
 
typedef std::vector< double, Alloc< double, 25 > >::const_iterator mcIter
 

Public Member Functions

virtual ~HepGenMatrix ()
 
virtual int num_row () const =0
 
virtual int num_col () const =0
 
virtual const doubleoperator() (int row, int col) const =0
 
virtual doubleoperator() (int row, int col)=0
 
virtual void invert (int &)=0
 
HepGenMatrix_row operator[] (int)
 
const HepGenMatrix_row_const operator[] (int) const
 
virtual bool operator== (const HepGenMatrix &) const
 

Static Public Member Functions

static void swap (int &, int &)
 
static void swap (std::vector< double, Alloc< double, 25 > > &, std::vector< double, Alloc< double, 25 > > &)
 
static void error (const char *s)
 

Protected Member Functions

virtual int num_size () const =0
 
void delete_m (int size, double *)
 
doublenew_m (int size)
 

Friends

class HepGenMatrix_row
 
class HepGenMatrix_row_const
 

Detailed Description

Author

Definition at line 32 of file GenMatrix.h.

Member Typedef Documentation

◆ mcIter

typedef std::vector<double,Alloc<double,25>>::const_iterator CLHEP::HepGenMatrix::mcIter

Definition at line 74 of file GenMatrix.h.

◆ mIter

typedef std::vector<double,Alloc<double,25>>::iterator CLHEP::HepGenMatrix::mIter

Definition at line 73 of file GenMatrix.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
size_max 

Definition at line 130 of file GenMatrix.h.

130{size_max = 25};

Constructor & Destructor Documentation

◆ ~HepGenMatrix()

virtual CLHEP::HepGenMatrix::~HepGenMatrix ( )
inlinevirtual

Definition at line 35 of file GenMatrix.h.

35{}

Member Function Documentation

◆ delete_m()

void CLHEP::HepGenMatrix::delete_m ( int  size,
double hm 
)
protected

Definition at line 88 of file GenMatrix.cc.

89{
90 if (hm)
91 {
92 if(size > size_max)
93 delete [] hm;
94 }
95}

◆ error()

◆ invert()

virtual void CLHEP::HepGenMatrix::invert ( int &  )
pure virtual

◆ new_m()

double * CLHEP::HepGenMatrix::new_m ( int  size)
protected

Definition at line 97 of file GenMatrix.cc.

98{
99 /*-ap: data_array is replaced by the std::vector<double>,
100 * so we simply return 0 here
101 *
102 * if (size == 0) return 0;
103 * else {
104 * if ( size <= size_max ) {
105 * memset(data_array, 0, size * sizeof(double));
106 * return data_array;
107 * } else {
108 * double * nnn = new double[size];
109 * memset(nnn, 0, size * sizeof(double));
110 * return nnn;
111 * }
112 * }
113 *-ap end
114 */
115 return 0;
116}

◆ num_col()

virtual int CLHEP::HepGenMatrix::num_col ( ) const
pure virtual

◆ num_row()

virtual int CLHEP::HepGenMatrix::num_row ( ) const
pure virtual

◆ num_size()

virtual int CLHEP::HepGenMatrix::num_size ( ) const
protectedpure virtual

◆ operator()() [1/2]

virtual const double & CLHEP::HepGenMatrix::operator() ( int  row,
int  col 
) const
pure virtual

◆ operator()() [2/2]

virtual double & CLHEP::HepGenMatrix::operator() ( int  row,
int  col 
)
pure virtual

◆ operator==()

bool CLHEP::HepGenMatrix::operator== ( const HepGenMatrix o) const
virtual

Definition at line 77 of file GenMatrix.cc.

77 {
78 if(o.num_row()!=num_row() || o.num_col()!=num_col()) return false;
79 for (int k1=1; k1<=num_row(); k1++)
80 for (int k2=1; k2<=num_col(); k2++)
81 if(o(k1,k2) != (*this)(k1,k2)) return false;
82 return true;
83}
virtual int num_row() const =0
virtual int num_col() const =0

◆ operator[]() [1/2]

HepGenMatrix_row CLHEP::HepGenMatrix::operator[] ( int  )
inline

◆ operator[]() [2/2]

const HepGenMatrix_row_const CLHEP::HepGenMatrix::operator[] ( int  ) const
inline

◆ swap() [1/2]

static void CLHEP::HepGenMatrix::swap ( int &  ,
int &   
)
inlinestatic

◆ swap() [2/2]

static void CLHEP::HepGenMatrix::swap ( std::vector< double, Alloc< double, 25 > > &  ,
std::vector< double, Alloc< double, 25 > > &   
)
inlinestatic

Friends And Related Function Documentation

◆ HepGenMatrix_row

friend class HepGenMatrix_row
friend

Definition at line 142 of file GenMatrix.h.

◆ HepGenMatrix_row_const

friend class HepGenMatrix_row_const
friend

Definition at line 143 of file GenMatrix.h.


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