24 #include "CLHEP/Matrix/defs.h" 28 class HepGenMatrix_row;
29 class HepGenMatrix_row_const;
42 #ifdef DISABLE_ALLOC // disable this non-compliant allocator 44 template <
class T,
size_t size>
class Alloc 56 pointer
address(reference r)
const {
return &r; }
57 const_pointer
address(const_reference r)
const {
return &r; }
61 pointer
allocate(size_type
n,
const void* hint=0 ) {
if( n <= size )
return pool;
else return new T[
n]; }
62 void deallocate(pointer p, size_type
n) {
if (p == pool )
return;
delete [] p; }
63 void construct(pointer p,
const T& val ) {
new(p) T(val); }
65 size_type
max_size()
const throw() { size_type c = (
size_type)(-1) /
sizeof(T);
return (0 < c ? c : 1); }
74 typedef std::vector<double >::iterator
mIter;
75 typedef std::vector<double >::const_iterator
mcIter;
77 typedef std::vector<double,Alloc<double,25> >::iterator
mIter;
78 typedef std::vector<double,Alloc<double,25> >::const_iterator
mcIter;
81 virtual int num_row()
const = 0;
82 virtual int num_col()
const = 0;
84 virtual const double &
operator()(
int row,
int col)
const =0;
85 virtual double &
operator()(
int row,
int col) =0;
89 virtual void invert(
int&) = 0;
116 inline static void swap(
int&,
int&);
118 inline static void swap(std::vector<double >&, std::vector<double >&);
126 static void error(
const char *s);
131 double*
new_m(
int size);
160 #ifdef ENABLE_BACKWARDS_COMPATIBILITY 162 using namespace CLHEP;
165 #ifndef HEP_DEBUG_INLINE 166 #include "CLHEP/Matrix/GenMatrix.icc"
ptrdiff_t difference_type
friend class HepGenMatrix_row
double norm(const HepGenMatrix &m)
virtual int num_row() const =0
HepGenMatrix_row operator[](int)
std::vector< double, Alloc< double, 25 > >::const_iterator mcIter
void construct(pointer p, const T &val)
pointer allocate(size_type n, const void *hint=0)
double norm1(const HepGenMatrix &m)
void deallocate(pointer p, size_type n)
Alloc(const Alloc< T, size > &)
virtual int num_col() const =0
virtual const double & operator()(int row, int col) const =0
virtual bool operator==(const HepGenMatrix &) const
static void swap(int &, int &)
friend class HepGenMatrix_row_const
std::vector< double, Alloc< double, 25 > >::iterator mIter
void delete_m(int size, double *)
static void error(const char *s)
size_type max_size() const
double norm_infinity(const HepGenMatrix &m)
virtual int num_size() const =0
const T & const_reference
pointer address(reference r) const
virtual void invert(int &)=0
const_pointer address(const_reference r) const