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

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

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

revision 113 by jgs, Mon Feb 28 07:06:33 2005 UTC revision 117 by jgs, Fri Apr 1 05:48:57 2005 UTC
# Line 80  DataArrayView::isEmpty() const Line 80  DataArrayView::isEmpty() const
80  void  void
81  DataArrayView::copy(const boost::python::numeric::array& value)  DataArrayView::copy(const boost::python::numeric::array& value)
82  {  {
83      DataArrayView::ShapeType tempShape;          ShapeType tempShape;    
84      for (int i=0; i<value.getrank(); i++) {      for (int i=0; i<value.getrank(); i++) {
85        tempShape.push_back(extract<int>(value.getshape()[i]));        tempShape.push_back(extract<int>(value.getshape()[i]));
86      }      }
# Line 178  DataArrayView::getRank() const Line 178  DataArrayView::getRank() const
178      return m_shape.size();      return m_shape.size();
179  }  }
180    
181  const DataArrayView::ShapeType&  const
182    DataArrayView::ShapeType&
183  DataArrayView::getShape() const  DataArrayView::getShape() const
184  {  {
185      return m_shape;      return m_shape;
# Line 293  DataArrayView::getResultSliceShape(const Line 294  DataArrayView::getResultSliceShape(const
294  {  {
295      int dimSize;      int dimSize;
296      RegionType::const_iterator i;      RegionType::const_iterator i;
297      DataArrayView::ShapeType result;      ShapeType result;
298      for (i=region.begin();i!=region.end();i++) {      for (i=region.begin();i!=region.end();i++) {
299        dimSize=((i->second)-(i->first));        dimSize=((i->second)-(i->first));
300        if (dimSize!=0) {        if (dimSize!=0) {
# Line 308  DataArrayView::getSliceRegion(const boos Line 309  DataArrayView::getSliceRegion(const boos
309  {  {
310    int slice_rank, i;    int slice_rank, i;
311    int this_rank=getRank();    int this_rank=getRank();
312    DataArrayView::RegionType out(this_rank);    RegionType out(this_rank);
313    /* allow for case where key is singular eg: [1], this implies we    /* allow for case where key is singular eg: [1], this implies we
314       want to generate a rank-1 dimension object, as opposed to eg: [1,2]       want to generate a rank-1 dimension object, as opposed to eg: [1,2]
315       which implies we want to take a rank dimensional object with one       which implies we want to take a rank dimensional object with one
# Line 850  DataArrayView::ShapeType Line 851  DataArrayView::ShapeType
851  DataArrayView::determineResultShape(const DataArrayView& left,  DataArrayView::determineResultShape(const DataArrayView& left,
852                                      const DataArrayView& right)                                      const DataArrayView& right)
853  {  {
854      DataArrayView::ShapeType temp;      ShapeType temp;
855      for (int i=0; i<(left.getRank()-1); i++) {      for (int i=0; i<(left.getRank()-1); i++) {
856        temp.push_back(left.getShape()[i]);        temp.push_back(left.getShape()[i]);
857      }      }

Legend:
Removed from v.113  
changed lines
  Added in v.117

  ViewVC Help
Powered by ViewVC 1.1.26