Commit 0bee62cc authored by Lynn Garren's avatar Lynn Garren
Browse files

rename internal size variable as size_ to avoid symbol conflicts

parent 4b61fe9a
2011-06-30 W. E. Brown <wb@fnal.gov>
* rename internal size variable as size_ to avoid symbol conflicts
==============================
11.11.10 Release CLHEP-2.1.0.1
==============================
......
......@@ -433,7 +433,7 @@ private:
std::vector<double,Alloc<double,25> > m;
#endif
int nrow, ncol;
int size;
int size_;
};
// Operations other than member functions for Matrix
......
......@@ -41,7 +41,7 @@
namespace CLHEP {
inline HepMatrix::HepMatrix()
: m(0), nrow(0), ncol(0), size(0) {}
: m(0), nrow(0), ncol(0), size_(0) {}
inline HepMatrix::HepMatrix_row HepMatrix::operator[] (int r)
#ifdef HEP_GNU_OPTIMIZED_RETURN
......@@ -100,7 +100,7 @@ inline void swap(HepMatrix &m1,HepMatrix &m2) {
/*** commented
HepGenMatrix::swap(m1.nrow,m2.nrow);
HepGenMatrix::swap(m1.ncol,m2.ncol);
HepGenMatrix::swap(m1.size,m2.size);
HepGenMatrix::swap(m1.size_,m2.size_);
*/
}
......
......@@ -303,7 +303,7 @@ private:
std::vector<double,Alloc<double,25> > m;
#endif
int nrow;
int size; // total number of elements
int size_; // total number of elements
static double posDefFraction5x5;
static double adjustment5x5;
......
......@@ -41,12 +41,12 @@
namespace CLHEP {
inline HepSymMatrix::HepSymMatrix()
: m(0), nrow(0), size(0)
: m(0), nrow(0), size_(0)
{}
inline int HepSymMatrix::num_row() const { return nrow;}
inline int HepSymMatrix::num_col() const { return nrow;}
inline int HepSymMatrix::num_size() const { return size;}
inline int HepSymMatrix::num_size() const { return size_;}
inline double & HepSymMatrix::fast(int row,int col)
{
......
......@@ -560,15 +560,15 @@ HepDiagMatrix & HepDiagMatrix::operator*=(double t)
HepMatrix & HepMatrix::operator=(const HepDiagMatrix &m1)
{
if(m1.nrow*m1.nrow != size)
if(m1.nrow*m1.nrow != size_)
{
size = m1.nrow * m1.nrow;
m.resize(size);
size_ = m1.nrow * m1.nrow;
m.resize(size_);
}
nrow = m1.nrow;
ncol = m1.nrow;
int n = nrow;
m.assign(size,0);
m.assign(size_,0);
mIter mrr = m.begin();
HepMatrix::mcIter mr = m1.m.begin();
for(int r=1;r<=n;r++) {
......
......@@ -94,15 +94,15 @@ namespace CLHEP {
HepMatrix::HepMatrix(int p,int q)
: m(p*q), nrow(p), ncol(q)
{
size = nrow * ncol;
size_ = nrow * ncol;
}
HepMatrix::HepMatrix(int p,int q,int init)
: m(p*q), nrow(p), ncol(q)
{
size = nrow * ncol;
size_ = nrow * ncol;
if (size > 0) {
if (size_ > 0) {
switch(init)
{
case 0:
......@@ -112,7 +112,7 @@ HepMatrix::HepMatrix(int p,int q,int init)
{
if ( ncol == nrow ) {
mIter a = m.begin();
for( int step=0; step < size; step+=(ncol+1) ) *(a+step) = 1.0;
for( int step=0; step < size_; step+=(ncol+1) ) *(a+step) = 1.0;
} else {
error("Invalid dimension in HepMatrix(int,int,1).");
}
......@@ -127,7 +127,7 @@ HepMatrix::HepMatrix(int p,int q,int init)
HepMatrix::HepMatrix(int p,int q, HepRandom &r)
: m(p*q), nrow(p), ncol(q)
{
size = nrow * ncol;
size_ = nrow * ncol;
mIter a = m.begin();
mIter b = m.end();
......@@ -140,7 +140,7 @@ HepMatrix::~HepMatrix() {
}
HepMatrix::HepMatrix(const HepMatrix &m1)
: m(m1.size), nrow(m1.nrow), ncol(m1.ncol), size(m1.size)
: m(m1.size_), nrow(m1.nrow), ncol(m1.ncol), size_(m1.size_)
{
m = m1.m;
......@@ -152,7 +152,7 @@ int HepMatrix::num_row() const { return nrow;}
int HepMatrix::num_col() const { return ncol;}
int HepMatrix::num_size() const { return size;}
int HepMatrix::num_size() const { return size_;}
// operator()
......@@ -178,7 +178,7 @@ const double & HepMatrix::operator()(int row, int col) const
HepMatrix::HepMatrix(const HepSymMatrix &m1)
: m(m1.nrow*m1.nrow), nrow(m1.nrow), ncol(m1.nrow)
{
size = nrow * ncol;
size_ = nrow * ncol;
mcIter sjk = m1.m.begin();
// j >= k
......@@ -197,7 +197,7 @@ HepMatrix::HepMatrix(const HepSymMatrix &m1)
HepMatrix::HepMatrix(const HepDiagMatrix &m1)
: m(m1.nrow*m1.nrow), nrow(m1.nrow), ncol(m1.nrow)
{
size = nrow * ncol;
size_ = nrow * ncol;
int n = num_row();
mIter mrr;
......@@ -212,7 +212,7 @@ HepMatrix::HepMatrix(const HepVector &m1)
: m(m1.nrow), nrow(m1.nrow), ncol(1)
{
size = nrow;
size_ = nrow;
m = m1.m;
}
......@@ -447,10 +447,10 @@ HepMatrix & HepMatrix::operator*=(double t)
HepMatrix & HepMatrix::operator=(const HepMatrix &m1)
{
if(m1.nrow*m1.ncol != size) //??fixme?? m1.size != size
if(m1.nrow*m1.ncol != size_) //??fixme?? m1.size != size
{
size = m1.nrow * m1.ncol;
m.resize(size); //??fixme?? if (size < m1.size) m.resize(m1.size);
size_ = m1.nrow * m1.ncol;
m.resize(size_); //??fixme?? if (size < m1.size) m.resize(m1.size);
}
nrow = m1.nrow;
ncol = m1.ncol;
......
......@@ -46,10 +46,10 @@
namespace CLHEP {
HepMatrix & HepMatrix::operator=(const HepRotation &m2) {
if(9!=size) {
if(9!=size_) {
//delete &m;
size = 9;
m.resize(size);
size_ = 9;
m.resize(size_);
}
nrow = ncol = 3;
mIter mm;
......
......@@ -90,16 +90,16 @@ namespace CLHEP {
HepSymMatrix::HepSymMatrix(int p)
: m(p*(p+1)/2), nrow(p)
{
size = nrow * (nrow+1) / 2;
m.assign(size,0);
size_ = nrow * (nrow+1) / 2;
m.assign(size_,0);
}
HepSymMatrix::HepSymMatrix(int p, int init)
: m(p*(p+1)/2), nrow(p)
{
size = nrow * (nrow+1) / 2;
size_ = nrow * (nrow+1) / 2;
m.assign(size,0);
m.assign(size_,0);
switch(init)
{
case 0:
......@@ -122,9 +122,9 @@ HepSymMatrix::HepSymMatrix(int p, int init)
HepSymMatrix::HepSymMatrix(int p, HepRandom &r)
: m(p*(p+1)/2), nrow(p)
{
size = nrow * (nrow+1) / 2;
size_ = nrow * (nrow+1) / 2;
HepMatrix::mIter a = m.begin();
HepMatrix::mIter b = m.begin() + size;
HepMatrix::mIter b = m.begin() + size_;
for(;a<b;a++) *a = r();
}
......@@ -135,7 +135,7 @@ HepSymMatrix::~HepSymMatrix() {
}
HepSymMatrix::HepSymMatrix(const HepSymMatrix &m1)
: m(m1.size), nrow(m1.nrow), size(m1.size)
: m(m1.size_), nrow(m1.nrow), size_(m1.size_)
{
m = m1.m;
}
......@@ -143,10 +143,10 @@ HepSymMatrix::HepSymMatrix(const HepSymMatrix &m1)
HepSymMatrix::HepSymMatrix(const HepDiagMatrix &m1)
: m(m1.nrow*(m1.nrow+1)/2), nrow(m1.nrow)
{
size = nrow * (nrow+1) / 2;
size_ = nrow * (nrow+1) / 2;
int n = num_row();
m.assign(size,0);
m.assign(size_,0);
HepMatrix::mIter mrr = m.begin();
HepMatrix::mcIter mr = m1.m.begin();
......@@ -652,10 +652,10 @@ HepMatrix & HepMatrix::operator=(const HepSymMatrix &m1)
{
// define size, rows, and columns of *this
nrow = ncol = m1.nrow;
if(nrow*ncol != size)
if(nrow*ncol != size_)
{
size = nrow*ncol;
m.resize(size);
size_ = nrow*ncol;
m.resize(size_);
}
// begin copy
mcIter sjk = m1.m.begin();
......@@ -678,8 +678,8 @@ HepSymMatrix & HepSymMatrix::operator=(const HepSymMatrix &m1)
if(m1.nrow != nrow)
{
nrow = m1.nrow;
size = m1.size;
m.resize(size);
size_ = m1.size_;
m.resize(size_);
}
m = m1.m;
return (*this);
......@@ -690,11 +690,11 @@ HepSymMatrix & HepSymMatrix::operator=(const HepDiagMatrix &m1)
if(m1.nrow != nrow)
{
nrow = m1.nrow;
size = nrow * (nrow+1) / 2;
m.resize(size);
size_ = nrow * (nrow+1) / 2;
m.resize(size_);
}
m.assign(size,0);
m.assign(size_,0);
HepMatrix::mIter mrr = m.begin();
HepMatrix::mcIter mr = m1.m.begin();
for(int r=1; r<=nrow; r++) {
......@@ -751,8 +751,8 @@ void HepSymMatrix::assign (const HepMatrix &m1)
if(m1.nrow != nrow)
{
nrow = m1.nrow;
size = nrow * (nrow+1) / 2;
m.resize(size);
size_ = nrow * (nrow+1) / 2;
m.resize(size_);
}
HepMatrix::mcIter a = m1.m.begin();
HepMatrix::mIter b = m.begin();
......
......@@ -488,10 +488,10 @@ HepVector & HepVector::operator*=(double t)
HepMatrix & HepMatrix::operator=(const HepVector &m1)
{
if(m1.nrow != size)
if(m1.nrow != size_)
{
size = m1.nrow;
m.resize(size);
size_ = m1.nrow;
m.resize(size_);
}
nrow = m1.nrow;
ncol = 1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment