Commit 772f0495 authored by Lynn Garren's avatar Lynn Garren
Browse files

remove unnecessary extra copy

parent ae4c0642
// -*- C++ -*-
// $Id: DiagMatrix.cc,v 1.4.2.2 2004/09/08 22:50:24 garren Exp $
// $Id: DiagMatrix.cc,v 1.4.2.3 2004/09/10 21:26:09 garren Exp $
// ---------------------------------------------------------------------------
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
......@@ -100,20 +100,12 @@ const double HepDiagMatrix::zero = 0;
// Constructors. (Default constructors are inlined and in .icc file)
HepDiagMatrix::HepDiagMatrix(int p)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double>(p)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p)), nrow(p)
#endif
: m(p), nrow(p)
{
}
HepDiagMatrix::HepDiagMatrix(int p, int init)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double>(p)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p)), nrow(p)
#endif
: m(p), nrow(p)
{
switch(init)
{
......@@ -134,11 +126,7 @@ HepDiagMatrix::HepDiagMatrix(int p, int init)
}
HepDiagMatrix::HepDiagMatrix(int p, HepRandom &r)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p)), nrow(p)
#endif
: m(p), nrow(p)
{
HepMatrix::mIter a = m.begin();
HepMatrix::mIter b = m.begin() + num_size();
......@@ -151,11 +139,7 @@ HepDiagMatrix::~HepDiagMatrix() {
}
HepDiagMatrix::HepDiagMatrix(const HepDiagMatrix &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.nrow)), nrow(m1.nrow)
#else
: m(std::vector<double,Alloc<double,25> >(m1.nrow)), nrow(m1.nrow)
#endif
: m(m1.nrow), nrow(m1.nrow)
{
m = m1.m;
}
......
// -*- C++ -*-
// $Id: Matrix.cc,v 1.4.2.2 2004/09/08 22:50:24 garren Exp $
// $Id: Matrix.cc,v 1.4.2.3 2004/09/10 21:26:09 garren Exp $
// ---------------------------------------------------------------------------
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
......@@ -93,21 +93,13 @@ namespace CLHEP {
// Constructors. (Default constructors are inlined and in .icc file)
HepMatrix::HepMatrix(int p,int q)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p*q)), nrow(p), ncol(q)
#else
: m(std::vector<double,Alloc<double,25> >(p*q)), nrow(p), ncol(q)
#endif
: m(p*q), nrow(p), ncol(q)
{
size = nrow * ncol;
}
HepMatrix::HepMatrix(int p,int q,int init)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p*q)), nrow(p), ncol(q)
#else
: m(std::vector<double,Alloc<double,25> >(p*q)), nrow(p), ncol(q)
#endif
: m(p*q), nrow(p), ncol(q)
{
size = nrow * ncol;
......@@ -135,11 +127,7 @@ HepMatrix::HepMatrix(int p,int q,int init)
}
HepMatrix::HepMatrix(int p,int q, HepRandom &r)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p*q)), nrow(p), ncol(q)
#else
: m(std::vector<double,Alloc<double,25> >(p*q)), nrow(p), ncol(q)
#endif
: m(p*q), nrow(p), ncol(q)
{
size = nrow * ncol;
......@@ -154,22 +142,14 @@ HepMatrix::~HepMatrix() {
}
HepMatrix::HepMatrix(const HepMatrix &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.size)), nrow(m1.nrow), ncol(m1.ncol), size(m1.size)
#else
: m(std::vector<double,Alloc<double,25> >(m1.size)), nrow(m1.nrow), ncol(m1.ncol), size(m1.size)
#endif
: m(m1.size), nrow(m1.nrow), ncol(m1.ncol), size(m1.size)
{
m = m1.m;
}
HepMatrix::HepMatrix(const HepSymMatrix &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.nrow*m1.nrow)), nrow(m1.nrow), ncol(m1.nrow)
#else
: m(std::vector<double,Alloc<double,25> >(m1.nrow*m1.nrow)), nrow(m1.nrow), ncol(m1.nrow)
#endif
: m(m1.nrow*m1.nrow), nrow(m1.nrow), ncol(m1.nrow)
{
size = nrow * ncol;
......@@ -193,11 +173,7 @@ HepMatrix::HepMatrix(const HepSymMatrix &m1)
}
HepMatrix::HepMatrix(const HepDiagMatrix &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.nrow*m1.nrow)), nrow(m1.nrow), ncol(m1.nrow)
#else
: m(std::vector<double,Alloc<double,25> >(m1.nrow*m1.nrow)), nrow(m1.nrow), ncol(m1.nrow)
#endif
: m(m1.nrow*m1.nrow), nrow(m1.nrow), ncol(m1.nrow)
{
size = nrow * ncol;
......@@ -211,11 +187,7 @@ HepMatrix::HepMatrix(const HepDiagMatrix &m1)
}
HepMatrix::HepMatrix(const HepVector &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.nrow)), nrow(m1.nrow), ncol(1)
#else
: m(std::vector<double,Alloc<double,25> >(m1.nrow)), nrow(m1.nrow), ncol(1)
#endif
: m(m1.nrow), nrow(m1.nrow), ncol(1)
{
size = nrow;
......
// -*- C++ -*-
// $Id: SymMatrix.cc,v 1.3.2.2 2004/09/08 22:50:24 garren Exp $
// $Id: SymMatrix.cc,v 1.3.2.3 2004/09/10 21:26:09 garren Exp $
// ---------------------------------------------------------------------------
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
......@@ -89,22 +89,14 @@ namespace CLHEP {
// Constructors. (Default constructors are inlined and in .icc file)
HepSymMatrix::HepSymMatrix(int p)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p*(p+1)/2)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p*(p+1)/2)), nrow(p)
#endif
: m(p*(p+1)/2), nrow(p)
{
size = nrow * (nrow+1) / 2;
m.assign(size,0);
}
HepSymMatrix::HepSymMatrix(int p, int init)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p*(p+1)/2)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p*(p+1)/2)), nrow(p)
#endif
: m(p*(p+1)/2), nrow(p)
{
size = nrow * (nrow+1) / 2;
......@@ -129,11 +121,7 @@ HepSymMatrix::HepSymMatrix(int p, int init)
}
HepSymMatrix::HepSymMatrix(int p, HepRandom &r)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p*(p+1)/2)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p*(p+1)/2)), nrow(p)
#endif
: m(p*(p+1)/2), nrow(p)
{
size = nrow * (nrow+1) / 2;
HepMatrix::mIter a = m.begin();
......@@ -148,21 +136,13 @@ HepSymMatrix::~HepSymMatrix() {
}
HepSymMatrix::HepSymMatrix(const HepSymMatrix &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.size)), nrow(m1.nrow), size(m1.size)
#else
: m(std::vector<double,Alloc<double,25> >(m1.size)), nrow(m1.nrow), size(m1.size)
#endif
: m(m1.size), nrow(m1.nrow), size(m1.size)
{
m = m1.m;
}
HepSymMatrix::HepSymMatrix(const HepDiagMatrix &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.nrow*(m1.nrow+1)/2)), nrow(m1.nrow)
#else
: m(std::vector<double,Alloc<double,25> >(m1.nrow*(m1.nrow+1)/2)), nrow(m1.nrow)
#endif
: m(m1.nrow*(m1.nrow+1)/2), nrow(m1.nrow)
{
size = nrow * (nrow+1) / 2;
......
// -*- C++ -*-
// $Id: Vector.cc,v 1.3.2.2 2004/09/08 22:50:24 garren Exp $
// $Id: Vector.cc,v 1.3.2.3 2004/09/10 21:26:09 garren Exp $
// ---------------------------------------------------------------------------
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
......@@ -86,20 +86,12 @@ namespace CLHEP {
// Constructors. (Default constructors are inlined and in .icc file)
HepVector::HepVector(int p)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p)), nrow(p)
#endif
: m(p), nrow(p)
{
}
HepVector::HepVector(int p, int init)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p)), nrow(p)
#endif
: m(p), nrow(p)
{
switch (init)
{
......@@ -120,11 +112,7 @@ HepVector::HepVector(int p, int init)
}
HepVector::HepVector(int p, HepRandom &r)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(p)), nrow(p)
#else
: m(std::vector<double,Alloc<double,25> >(p)), nrow(p)
#endif
: m(p), nrow(p)
{
HepGenMatrix::mIter a = m.begin();
HepGenMatrix::mIter b = m.begin() + nrow;
......@@ -139,11 +127,7 @@ HepVector::~HepVector() {
}
HepVector::HepVector(const HepVector &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.nrow)), nrow(m1.nrow)
#else
: m(std::vector<double,Alloc<double,25> >(m1.nrow)), nrow(m1.nrow)
#endif
: m(m1.nrow), nrow(m1.nrow)
{
m = m1.m;
}
......@@ -154,11 +138,7 @@ HepVector::HepVector(const HepVector &m1)
HepVector::HepVector(const HepMatrix &m1)
#if defined __GNUC__ && (__GNUC__ < 3)
: m(std::vector<double >(m1.nrow)), nrow(m1.nrow)
#else
: m(std::vector<double,Alloc<double,25> >(m1.nrow)), nrow(m1.nrow)
#endif
: m(m1.nrow), nrow(m1.nrow)
{
if (m1.num_col() != 1)
error("Vector::Vector(Matrix) : Matrix is not Nx1");
......
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