/[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 775 by ksteube, Mon Jul 10 04:00:08 2006 UTC revision 800 by gross, Tue Aug 8 11:23:18 2006 UTC
# Line 503  DataExpanded::nonsymmetric(DataAbstract* Line 503  DataExpanded::nonsymmetric(DataAbstract*
503    }    }
504  }  }
505  void  void
506  DataExpanded::matrixtrace(DataAbstract* ev, int axis_offset)  DataExpanded::trace(DataAbstract* ev, int axis_offset)
507  {  {
508    int sampleNo,dataPointNo;    int sampleNo,dataPointNo;
509    int numSamples = getNumSamples();    int numSamples = getNumSamples();
510    int numDataPointsPerSample = getNumDPPSample();    int numDataPointsPerSample = getNumDPPSample();
511    DataExpanded* temp_ev=dynamic_cast<DataExpanded*>(ev);    DataExpanded* temp_ev=dynamic_cast<DataExpanded*>(ev);
512    if (temp_ev==0) {    if (temp_ev==0) {
513      throw DataException("Error - DataExpanded::matrixtrace: casting to DataExpanded failed (propably a programming error).");      throw DataException("Error - DataExpanded::trace: casting to DataExpanded failed (propably a programming error).");
514    }    }
515    DataArrayView& thisView=getPointDataView();    DataArrayView& thisView=getPointDataView();
516    DataArrayView& evView=ev->getPointDataView();    DataArrayView& evView=ev->getPointDataView();
517    #pragma omp parallel for private(sampleNo,dataPointNo) schedule(static)    #pragma omp parallel for private(sampleNo,dataPointNo) schedule(static)
518    for (sampleNo = 0; sampleNo < numSamples; sampleNo++) {    for (sampleNo = 0; sampleNo < numSamples; sampleNo++) {
519      for (dataPointNo = 0; dataPointNo < numDataPointsPerSample; dataPointNo++) {      for (dataPointNo = 0; dataPointNo < numDataPointsPerSample; dataPointNo++) {
520           DataArrayView::matrixtrace(thisView,getPointOffset(sampleNo,dataPointNo),           DataArrayView::trace(thisView,getPointOffset(sampleNo,dataPointNo),
521                                      evView,ev->getPointOffset(sampleNo,dataPointNo),axis_offset);                                      evView,ev->getPointOffset(sampleNo,dataPointNo),axis_offset);
522      }      }
523    }    }
524  }  }
525    
526  void  void
527  DataExpanded::transpose(DataAbstract* ev, int axis_offset)  DataExpanded::transpose(DataAbstract* ev, int axis_offset)
528  {  {
# Line 541  DataExpanded::transpose(DataAbstract* ev Line 542  DataExpanded::transpose(DataAbstract* ev
542                                      evView,ev->getPointOffset(sampleNo,dataPointNo),axis_offset);                                      evView,ev->getPointOffset(sampleNo,dataPointNo),axis_offset);
543      }      }
544    }    }
545    }
546    
547    void
548    DataExpanded::swap(DataAbstract* ev, int axis_offset)
549    {
550      int sampleNo,dataPointNo;
551      int numSamples = getNumSamples();
552      int numDataPointsPerSample = getNumDPPSample();
553      DataExpanded* temp_ev=dynamic_cast<DataExpanded*>(ev);
554      if (temp_ev==0) {
555        throw DataException("Error - DataExpanded::swap: casting to DataExpanded failed (propably a programming error).");
556      }
557      DataArrayView& thisView=getPointDataView();
558      DataArrayView& evView=ev->getPointDataView();
559      #pragma omp parallel for private(sampleNo,dataPointNo) schedule(static)
560      for (sampleNo = 0; sampleNo < numSamples; sampleNo++) {
561        for (dataPointNo = 0; dataPointNo < numDataPointsPerSample; dataPointNo++) {
562             DataArrayView::swap(thisView,getPointOffset(sampleNo,dataPointNo),
563                                        evView,ev->getPointOffset(sampleNo,dataPointNo),axis_offset);
564        }
565      }
566  }  }
567  void  void
568  DataExpanded::eigenvalues(DataAbstract* ev)  DataExpanded::eigenvalues(DataAbstract* ev)

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

  ViewVC Help
Powered by ViewVC 1.1.26