/[escript]/trunk/escript/src/DataVector.cpp
ViewVC logotype

Diff of /trunk/escript/src/DataVector.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 150 by jgs, Fri Jul 8 04:08:13 2005 UTC revision 151 by jgs, Thu Sep 22 01:55:00 2005 UTC
# Line 62  DataVector::DataVector(const DataVector: Line 62  DataVector::DataVector(const DataVector:
62  DataVector::~DataVector()  DataVector::~DataVector()
63  {  {
64    // dispose of data array    // dispose of data array
65    arrayManager.delete_array(m_array_data);    if (m_array_data!=0) {
66        arrayManager.delete_array(m_array_data);
67      }
68    
69    // clear data members    // clear data members
70    m_size = -1;    m_size = -1;
# Line 78  DataVector::resize(const DataVector::siz Line 80  DataVector::resize(const DataVector::siz
80  {  {
81    assert(m_size >= 0);    assert(m_size >= 0);
82    
83      if ( newBlockSize == 0) {
84        throw DataException("DataVector: invalid blockSize specified");
85      }
86    
87    if ( (newSize % newBlockSize) != 0) {    if ( (newSize % newBlockSize) != 0) {
88      throw DataException("DataVector: invalid blockSize specified");      throw DataException("DataVector: invalid blockSize specified");
89    }    }
90    
91    arrayManager.delete_array(m_array_data);    if (m_array_data!=0) {
92        arrayManager.delete_array(m_array_data);
93      }
94    
95    m_size = newSize;    m_size = newSize;
96    m_dim = newBlockSize;    m_dim = newBlockSize;
# Line 101  DataVector::operator=(const DataVector& Line 109  DataVector::operator=(const DataVector&
109  {  {
110    assert(m_size >= 0);    assert(m_size >= 0);
111    
112    arrayManager.delete_array(m_array_data);    if (m_array_data!=0) {
113        arrayManager.delete_array(m_array_data);
114      }
115    
116    m_size = other.m_size;    m_size = other.m_size;
117    m_dim = other.m_dim;    m_dim = other.m_dim;

Legend:
Removed from v.150  
changed lines
  Added in v.151

  ViewVC Help
Powered by ViewVC 1.1.26