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

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

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

revision 800 by gross, Tue Aug 8 11:23:18 2006 UTC revision 804 by gross, Thu Aug 10 01:12:16 2006 UTC
# Line 545  DataExpanded::transpose(DataAbstract* ev Line 545  DataExpanded::transpose(DataAbstract* ev
545  }  }
546    
547  void  void
548  DataExpanded::swap(DataAbstract* ev, int axis_offset)  DataExpanded::swapaxes(DataAbstract* ev, int axis0, int axis1)
549  {  {
550    int sampleNo,dataPointNo;    int sampleNo,dataPointNo;
551    int numSamples = getNumSamples();    int numSamples = getNumSamples();
552    int numDataPointsPerSample = getNumDPPSample();    int numDataPointsPerSample = getNumDPPSample();
553    DataExpanded* temp_ev=dynamic_cast<DataExpanded*>(ev);    DataExpanded* temp_ev=dynamic_cast<DataExpanded*>(ev);
554    if (temp_ev==0) {    if (temp_ev==0) {
555      throw DataException("Error - DataExpanded::swap: casting to DataExpanded failed (propably a programming error).");      throw DataException("Error - DataExpanded::swapaxes: casting to DataExpanded failed (propably a programming error).");
556    }    }
557    DataArrayView& thisView=getPointDataView();    DataArrayView& thisView=getPointDataView();
558    DataArrayView& evView=ev->getPointDataView();    DataArrayView& evView=ev->getPointDataView();
559    #pragma omp parallel for private(sampleNo,dataPointNo) schedule(static)    #pragma omp parallel for private(sampleNo,dataPointNo) schedule(static)
560    for (sampleNo = 0; sampleNo < numSamples; sampleNo++) {    for (sampleNo = 0; sampleNo < numSamples; sampleNo++) {
561      for (dataPointNo = 0; dataPointNo < numDataPointsPerSample; dataPointNo++) {      for (dataPointNo = 0; dataPointNo < numDataPointsPerSample; dataPointNo++) {
562           DataArrayView::swap(thisView,getPointOffset(sampleNo,dataPointNo),           DataArrayView::swapaxes(thisView,getPointOffset(sampleNo,dataPointNo),
563                                      evView,ev->getPointOffset(sampleNo,dataPointNo),axis_offset);                                      evView,ev->getPointOffset(sampleNo,dataPointNo),axis0,axis1);
564      }      }
565    }    }
566  }  }

Legend:
Removed from v.800  
changed lines
  Added in v.804

  ViewVC Help
Powered by ViewVC 1.1.26