/[escript]/branches/arrayview_from_1695_trunk/escript/src/Data.cpp
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/escript/src/Data.cpp

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

revision 1720 by jfenwick, Thu Aug 21 04:52:14 2008 UTC revision 1721 by jfenwick, Fri Aug 22 00:39:32 2008 UTC
# Line 1797  Data::setTaggedValue(int tagKey, Line 1797  Data::setTaggedValue(int tagKey,
1797    }    }
1798    
1799    // get the space for the data vector    // get the space for the data vector
1800   int len = DataTypes::noValues(tempShape);  //   int len = DataTypes::noValues(tempShape);
1801    DataVector temp_data(len, 0.0, len);  //   DataVector temp_data(len, 0.0, len);
1802    DataArrayView temp_dataView(temp_data, tempShape);  //   DataArrayView temp_dataView(temp_data, tempShape);
1803    temp_dataView.copy(asNumArray);  //   temp_dataView.copy(asNumArray);
1804    
1805  //    DataVector temp_data;    DataVector temp_data2;
1806  //    temp_data.copyFromNumArray(asNumArray);    temp_data2.copyFromNumArray(asNumArray);
1807    
1808    //    //
1809    // Call DataAbstract::setTaggedValue    // Call DataAbstract::setTaggedValue
1810    m_data->setTaggedValue(tagKey,temp_dataView);    //m_data->setTaggedValue(tagKey,temp_dataView);
1811    
1812  //    m_data->setTaggedValue(tagKey,tempShape, temp_data);      m_data->setTaggedValue(tagKey,tempShape, temp_data2);
1813  }  }
1814    
1815  void  // void
1816  Data::setTaggedValueFromCPP(int tagKey,  // Data::setTaggedValueFromCPP(int tagKey,
1817                              const DataArrayView& value)  //                             const DataArrayView& value)
1818  {  // {
1819    if (isProtected()) {  //   if (isProtected()) {
1820          throw DataException("Error - attempt to update protected Data object.");  //         throw DataException("Error - attempt to update protected Data object.");
1821    }  //   }
1822    //  //   //
1823    // Ensure underlying data object is of type DataTagged  //   // Ensure underlying data object is of type DataTagged
1824    if (isConstant()) tag();  //   if (isConstant()) tag();
1825    //
1826    //  //   //
1827    // Call DataAbstract::setTaggedValue  //   // Call DataAbstract::setTaggedValue
1828    m_data->setTaggedValue(tagKey,value);  //   m_data->setTaggedValue(tagKey,value);
1829  }  // }
1830    
1831  void  void
1832  Data::setTaggedValueFromCPP(int tagKey,  Data::setTaggedValueFromCPP(int tagKey,
1833                  const DataTypes::ShapeType& pointshape,                  const DataTypes::ShapeType& pointshape,
1834                              const DataTypes::ValueType& value)                              const DataTypes::ValueType& value,
1835                    int dataOffset)
1836  {  {
1837    if (isProtected()) {    if (isProtected()) {
1838          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
# Line 1842  Data::setTaggedValueFromCPP(int tagKey, Line 1843  Data::setTaggedValueFromCPP(int tagKey,
1843    
1844    //    //
1845    // Call DataAbstract::setTaggedValue    // Call DataAbstract::setTaggedValue
1846    m_data->setTaggedValue(tagKey,pointshape, value);    m_data->setTaggedValue(tagKey,pointshape, value, dataOffset);
1847  }  }
1848    
1849  int  int

Legend:
Removed from v.1720  
changed lines
  Added in v.1721

  ViewVC Help
Powered by ViewVC 1.1.26