Added more constructor inits.

This commit is contained in:
Harry Moffat 2010-05-07 14:44:46 +00:00
parent 74b1c3c0a1
commit 33a21f76ac
2 changed files with 12 additions and 5 deletions

View file

@ -56,8 +56,11 @@ namespace Cantera {
/**
* Default constructor. Create an empty array.
*/
Array2D() : m_nrows(0), m_ncols(0) {
m_data.clear();
Array2D() :
m_data(0),
m_nrows(0),
m_ncols(0)
{
}
//! Constructor.
@ -70,7 +73,7 @@ namespace Cantera {
* @param v Default fill value. The default is 0.0
*/
Array2D(const int m, const int n, const doublereal v = 0.0)
: m_nrows(m), m_ncols(n) {
: m_data(0), m_nrows(m), m_ncols(n) {
m_data.resize(n*m);
std::fill(m_data.begin(), m_data.end(), v);
}
@ -79,7 +82,11 @@ namespace Cantera {
/*!
* @param y Array2D to make the copy from
*/
Array2D(const Array2D& y) {
Array2D(const Array2D& y) :
m_data(0),
m_nrows(0),
m_ncols(0)
{
m_nrows = y.m_nrows;
m_ncols = y.m_ncols;
m_data.resize(m_nrows*m_ncols);

View file

@ -1458,7 +1458,7 @@ namespace mdp {
*
* mdp_copy_dbl_1:
*
* Copies one Double vector into another double vector
* Copies one contiguous double vector into another double vector
*
* Input
* -------------