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

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

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

revision 2778 by jfenwick, Wed Nov 25 01:24:51 2009 UTC revision 2779 by caltinay, Thu Nov 26 03:51:15 2009 UTC
# Line 1855  Data::swapaxes(const int axis0, const in Line 1855  Data::swapaxes(const int axis0, const in
1855          throw DataException("Error - Data::swapaxes argument must have at least rank 2.");          throw DataException("Error - Data::swapaxes argument must have at least rank 2.");
1856       }       }
1857       if (axis0<0 || axis0>rank-1) {       if (axis0<0 || axis0>rank-1) {
1858          throw DataException("Error - Data::swapaxes: axis0 must be between 0 and rank-1=" + rank-1);          stringstream e;
1859            e << "Error - Data::swapaxes: axis0 must be between 0 and rank-1=" << (rank-1);
1860            throw DataException(e.str());
1861       }       }
1862       if (axis1<0 || axis1>rank-1) {       if (axis1<0 || axis1>rank-1) {
1863           throw DataException("Error - Data::swapaxes: axis1 must be between 0 and rank-1=" + rank-1);          e << "Error - Data::swapaxes: axis1 must be between 0 and rank-1=" << (rank-1);
1864            throw DataException(e.str());
1865       }       }
1866       if (axis0 == axis1) {       if (axis0 == axis1) {
1867           throw DataException("Error - Data::swapaxes: axis indices must be different.");           throw DataException("Error - Data::swapaxes: axis indices must be different.");
# Line 2018  Data::transpose(int axis_offset) const Line 2021  Data::transpose(int axis_offset) const
2021       // which goes thru all shape vector elements starting with axis_offset (at index=rank wrap around to 0)       // which goes thru all shape vector elements starting with axis_offset (at index=rank wrap around to 0)
2022       int rank=getDataPointRank();       int rank=getDataPointRank();
2023       if (axis_offset<0 || axis_offset>rank) {       if (axis_offset<0 || axis_offset>rank) {
2024          throw DataException("Error - Data::transpose must have 0 <= axis_offset <= rank=" + rank);          stringstream e;
2025            e << "Error - Data::transpose must have 0 <= axis_offset <= rank=" << rank;
2026            throw DataException(e.str());
2027       }       }
2028       for (int i=0; i<rank; i++) {       for (int i=0; i<rank; i++) {
2029    

Legend:
Removed from v.2778  
changed lines
  Added in v.2779

  ViewVC Help
Powered by ViewVC 1.1.26