/[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 474 by jgs, Mon Jan 30 04:23:44 2006 UTC revision 584 by gross, Thu Mar 9 23:03:38 2006 UTC
# Line 13  Line 13 
13   ******************************************************************************   ******************************************************************************
14  */  */
15    
 #include "DataException.h"  
16  #include "DataExpanded.h"  #include "DataExpanded.h"
17    #include "DataException.h"
18  #include "DataConstant.h"  #include "DataConstant.h"
19  #include "DataTagged.h"  #include "DataTagged.h"
 #include "DataArrayView.h"  
20    
21  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
22    
 #include <iostream>  
   
23  using namespace std;  using namespace std;
24  using namespace boost::python;  using namespace boost::python;
25  using namespace boost;  using namespace boost;
# Line 467  DataExpanded::copyAll(const boost::pytho Line 464  DataExpanded::copyAll(const boost::pytho
464      }      }
465    }    }
466  }  }
467    void
468    DataExpanded::eigenvalues(DataAbstract* ev)
469    {
470      int sampleNo,dataPointNo;
471      int numSamples = getNumSamples();
472      int numDataPointsPerSample = getNumDPPSample();
473      DataExpanded* temp_ev=dynamic_cast<DataExpanded*>(ev);
474      if (temp_ev==0) {
475        throw DataException("Error - DataExpanded::eigenvalues: casting to DataExpanded failed (propably a programming error).");
476      }
477      DataArrayView& thisView=getPointDataView();
478      DataArrayView& evView=ev->getPointDataView();
479      #pragma omp parallel for private(sampleNo,dataPointNo) schedule(static)
480      for (sampleNo = 0; sampleNo < numSamples; sampleNo++) {
481        for (dataPointNo = 0; dataPointNo < numDataPointsPerSample; dataPointNo++) {
482             DataArrayView::eigenvalues(thisView,getPointOffset(sampleNo,dataPointNo),
483                                        evView,ev->getPointOffset(sampleNo,dataPointNo));
484        }
485      }
486    }
487    void
488    DataExpanded::eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol)
489    {
490      int numSamples = getNumSamples();
491      int numDataPointsPerSample = getNumDPPSample();
492      int sampleNo,dataPointNo;
493      DataExpanded* temp_ev=dynamic_cast<DataExpanded*>(ev);
494      if (temp_ev==0) {
495        throw DataException("Error - DataExpanded::eigenvalues_and_eigenvectors: casting to DataExpanded failed (propably a programming error).");
496      }
497      DataExpanded* temp_V=dynamic_cast<DataExpanded*>(V);
498      if (temp_V==0) {
499        throw DataException("Error - DataExpanded::eigenvalues_and_eigenvectors: casting to DataExpanded failed (propably a programming error).");
500      }
501      DataArrayView& thisView=getPointDataView();
502      DataArrayView& evView=ev->getPointDataView();
503      DataArrayView& VView=V->getPointDataView();
504      #pragma omp parallel for private(sampleNo,dataPointNo) schedule(static)
505      for (sampleNo = 0; sampleNo < numSamples; sampleNo++) {
506        for (dataPointNo = 0; dataPointNo < numDataPointsPerSample; dataPointNo++) {
507             DataArrayView::eigenvalues_and_eigenvectors(thisView,getPointOffset(sampleNo,dataPointNo),
508                                                         evView,ev->getPointOffset(sampleNo,dataPointNo),
509                                                         VView,V->getPointOffset(sampleNo,dataPointNo),
510                                                         tol);
511        }
512      }
513    }
514    
515  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.474  
changed lines
  Added in v.584

  ViewVC Help
Powered by ViewVC 1.1.26