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

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

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

revision 1601 by phornby, Thu Jun 12 10:31:03 2008 UTC revision 1602 by phornby, Sat Jun 14 09:20:06 2008 UTC
# Line 297  namespace escript { Line 297  namespace escript {
297        return (*m_data)[m_offset+i];        return (*m_data)[m_offset+i];
298     }     }
299    
300     DataArrayView::ShapeType DataArrayView::return_shape;     DataArrayView::ShapeType
   
    const DataArrayView::ShapeType &  
301     DataArrayView::getResultSliceShape(const RegionType& region)     DataArrayView::getResultSliceShape(const RegionType& region)
302     {     {
303        int dimSize;        int dimSize;
304          ShapeType result;
305        RegionType::const_iterator i;        RegionType::const_iterator i;
       // ShapeType result;  
       return_shape.clear();  
306        for (i=region.begin();i!=region.end();i++) {        for (i=region.begin();i!=region.end();i++) {
307           dimSize=((i->second)-(i->first));           dimSize=((i->second)-(i->first));
308           if (dimSize!=0) {           if (dimSize!=0) {
309              return_shape.push_back(dimSize);              result.push_back(dimSize);
310           }           }
311        }        }
312        return return_shape;        return result;
313     }     }
314    
315     DataArrayView::RegionType     DataArrayView::RegionType
# Line 863  namespace escript { Line 860  namespace escript {
860    
861     }     }
862    
863     const DataArrayView::ShapeType &     DataArrayView::ShapeType
864     DataArrayView::determineResultShape(const DataArrayView& left,     DataArrayView::determineResultShape(const DataArrayView& left,
865                                         const DataArrayView& right)                                         const DataArrayView& right)
866     {     {
867        return_shape.clear();        ShapeType result;
868        for (int i=0; i<(left.getRank()-1); i++) {        for (int i=0; i<(left.getRank()-1); i++) {
869           return_shape.push_back(left.getShape()[i]);           result.push_back(left.getShape()[i]);
870        }        }
871        for (int i=1; i<right.getRank(); i++) {        for (int i=1; i<right.getRank(); i++) {
872           return_shape.push_back(right.getShape()[i]);           result.push_back(right.getShape()[i]);
873        }        }
874        return return_shape;        return result;
875     }     }
876    
877     bool operator==(const DataArrayView& left, const DataArrayView& right)     bool operator==(const DataArrayView& left, const DataArrayView& right)

Legend:
Removed from v.1601  
changed lines
  Added in v.1602

  ViewVC Help
Powered by ViewVC 1.1.26