/[escript]/branches/clazy/escriptcore/src/DataLazy.cpp
ViewVC logotype

Diff of /branches/clazy/escriptcore/src/DataLazy.cpp

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

revision 2777 by jfenwick, Thu Nov 26 01:06:00 2009 UTC revision 2779 by caltinay, Thu Nov 26 03:51:15 2009 UTC
# Line 241  resultShape(DataAbstract_ptr left, ES_op Line 241  resultShape(DataAbstract_ptr left, ES_op
241          int rank=left->getRank();          int rank=left->getRank();
242          if (axis_offset<0 || axis_offset>rank)          if (axis_offset<0 || axis_offset>rank)
243          {          {
244                 throw DataException("Error - Data::transpose must have 0 <= axis_offset <= rank=" + rank);              stringstream e;
245              }              e << "Error - Data::transpose must have 0 <= axis_offset <= rank=" << rank;
246              for (int i=0; i<rank; i++)              throw DataException(e.str());
247            }
248            for (int i=0; i<rank; i++)
249          {          {
250             int index = (axis_offset+i)%rank;             int index = (axis_offset+i)%rank;
251                 sh.push_back(s[index]); // Append to new shape             sh.push_back(s[index]); // Append to new shape
252              }          }
253          return sh;          return sh;
254         }         }
255      break;      break;
# Line 326  SwapShape(DataAbstract_ptr left, const i Line 328  SwapShape(DataAbstract_ptr left, const i
328          throw DataException("Error - Data::swapaxes argument must have at least rank 2.");          throw DataException("Error - Data::swapaxes argument must have at least rank 2.");
329       }       }
330       if (axis0<0 || axis0>rank-1) {       if (axis0<0 || axis0>rank-1) {
331          throw DataException("Error - Data::swapaxes: axis0 must be between 0 and rank-1=" + rank-1);          stringstream e;
332            e << "Error - Data::swapaxes: axis0 must be between 0 and rank-1=" << (rank-1);
333            throw DataException(e.str());
334       }       }
335       if (axis1<0 || axis1>rank-1) {       if (axis1<0 || axis1>rank-1) {
336           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);
337            throw DataException(e.str());
338       }       }
339       if (axis0 == axis1) {       if (axis0 == axis1) {
340           throw DataException("Error - Data::swapaxes: axis indices must be different.");           throw DataException("Error - Data::swapaxes: axis indices must be different.");

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

  ViewVC Help
Powered by ViewVC 1.1.26