diff --git a/include/cantera/thermo/NasaPoly1.h b/include/cantera/thermo/NasaPoly1.h index 760e03575..f8e28dfb0 100644 --- a/include/cantera/thermo/NasaPoly1.h +++ b/include/cantera/thermo/NasaPoly1.h @@ -64,8 +64,7 @@ public: NasaPoly1(size_t n, doublereal tlow, doublereal thigh, doublereal pref, const doublereal* coeffs) : SpeciesThermoInterpType(n, tlow, thigh, pref), - m_coeff(vector_fp(7)) { - std::copy(coeffs, coeffs + 7, m_coeff.begin()); + m_coeff(coeffs, coeffs + 7) { } //! copy constructor @@ -74,11 +73,8 @@ public: */ NasaPoly1(const NasaPoly1& b) : SpeciesThermoInterpType(b), - m_coeff(vector_fp(7)) + m_coeff(b.m_coeff) { - std::copy(b.m_coeff.begin(), - b.m_coeff.begin() + 7, - m_coeff.begin()); } //! assignment operator @@ -88,9 +84,7 @@ public: NasaPoly1& operator=(const NasaPoly1& b) { if (&b != this) { SpeciesThermoInterpType::operator=(b); - std::copy(b.m_coeff.begin(), - b.m_coeff.begin() + 7, - m_coeff.begin()); + m_coeff = b.m_coeff; } return *this; } diff --git a/src/thermo/Nasa9Poly1.cpp b/src/thermo/Nasa9Poly1.cpp index 93ce7abba..3d7c593ac 100644 --- a/src/thermo/Nasa9Poly1.cpp +++ b/src/thermo/Nasa9Poly1.cpp @@ -16,7 +16,7 @@ namespace Cantera { Nasa9Poly1::Nasa9Poly1() - : m_coeff(vector_fp(9)) + : m_coeff(9, 0.0) { m_Pref = 1.0e5; } @@ -25,27 +25,21 @@ Nasa9Poly1::Nasa9Poly1(size_t n, doublereal tlow, doublereal thigh, doublereal pref, const doublereal* coeffs) : SpeciesThermoInterpType(n, tlow, thigh, pref), - m_coeff(vector_fp(9)) + m_coeff(coeffs, coeffs + 9) { - std::copy(coeffs, coeffs + 9, m_coeff.begin()); } Nasa9Poly1::Nasa9Poly1(const Nasa9Poly1& b) : SpeciesThermoInterpType(b), - m_coeff(vector_fp(9)) + m_coeff(b.m_coeff) { - std::copy(b.m_coeff.begin(), - b.m_coeff.begin() + 9, - m_coeff.begin()); } Nasa9Poly1& Nasa9Poly1::operator=(const Nasa9Poly1& b) { if (&b != this) { SpeciesThermoInterpType::operator=(b); - std::copy(b.m_coeff.begin(), - b.m_coeff.begin() + 9, - m_coeff.begin()); + m_coeff = b.m_coeff; } return *this; } diff --git a/src/thermo/NasaPoly2.h b/src/thermo/NasaPoly2.h index e9bbe093e..c6d517e76 100644 --- a/src/thermo/NasaPoly2.h +++ b/src/thermo/NasaPoly2.h @@ -66,11 +66,10 @@ public: NasaPoly2(size_t n, doublereal tlow, doublereal thigh, doublereal pref, const doublereal* coeffs) : SpeciesThermoInterpType(n, tlow, thigh, pref), + m_midT(coeffs[0]), mnp_low(n, tlow, coeffs[0], pref, coeffs +1), mnp_high(n, tlow, thigh, pref, coeffs + 8), - m_coeff(15, 0.0) { - std::copy(coeffs, coeffs + 15, m_coeff.begin()); - m_midT = coeffs[0]; + m_coeff(coeffs, coeffs + 15) { } //! Copy Constructor diff --git a/src/thermo/ShomatePoly.h b/src/thermo/ShomatePoly.h index 414e3c309..52949c8ce 100644 --- a/src/thermo/ShomatePoly.h +++ b/src/thermo/ShomatePoly.h @@ -81,10 +81,9 @@ public: */ ShomatePoly(size_t n, doublereal tlow, doublereal thigh, doublereal pref, const doublereal* coeffs) : - SpeciesThermoInterpType(n, tlow, thigh, pref) + SpeciesThermoInterpType(n, tlow, thigh, pref), + m_coeff(coeffs, coeffs + 7) { - m_coeff.resize(7); - std::copy(coeffs, coeffs + 7, m_coeff.begin()); } //! copy constructor @@ -93,11 +92,8 @@ public: */ ShomatePoly(const ShomatePoly& b) : SpeciesThermoInterpType(b), - m_coeff(vector_fp(7)) + m_coeff(b.m_coeff) { - std::copy(b.m_coeff.begin(), - b.m_coeff.begin() + 7, - m_coeff.begin()); } //! Assignment operator @@ -107,10 +103,7 @@ public: ShomatePoly& operator=(const ShomatePoly& b) { if (&b != this) { SpeciesThermoInterpType::operator=(b); - m_coeff.resize(7); - std::copy(b.m_coeff.begin(), - b.m_coeff.begin() + 7, - m_coeff.begin()); + m_coeff = b.m_coeff; } return *this; } @@ -323,13 +316,11 @@ public: ShomatePoly2(size_t n, doublereal tlow, doublereal thigh, doublereal pref, const doublereal* coeffs) : SpeciesThermoInterpType(n, tlow, thigh, pref), - m_midT(0.0), + m_midT(coeffs[0]), msp_low(0), - msp_high(0) + msp_high(0), + m_coeff(coeffs, coeffs + 15) { - m_coeff.resize(15); - std::copy(coeffs, coeffs + 15, m_coeff.begin()); - m_midT = coeffs[0]; msp_low = new ShomatePoly(n, tlow, m_midT, pref, coeffs+1); msp_high = new ShomatePoly(n, m_midT, thigh, pref, coeffs+8); } @@ -343,11 +334,8 @@ public: m_midT(b.m_midT), msp_low(0), msp_high(0), - m_coeff(vector_fp(15)) + m_coeff(b.m_coeff) { - std::copy(b.m_coeff.begin(), - b.m_coeff.begin() + 15, - m_coeff.begin()); msp_low = new ShomatePoly(m_index, m_lowT, m_midT, m_Pref, &m_coeff[1]); msp_high = new ShomatePoly(m_index, m_midT, m_highT, @@ -362,9 +350,7 @@ public: if (&b != this) { SpeciesThermoInterpType::operator=(b); m_midT = b.m_midT; - std::copy(b.m_coeff.begin(), - b.m_coeff.begin() + 15, - m_coeff.begin()); + m_coeff = b.m_coeff; delete msp_low; delete msp_high; msp_low = new ShomatePoly(m_index, m_lowT, m_midT,