/[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 922 by gross, Fri Jan 5 04:23:05 2007 UTC revision 950 by gross, Tue Feb 6 07:01:11 2007 UTC
# Line 293  DataExpanded::getLength() const Line 293  DataExpanded::getLength() const
293  }  }
294    
295  void  void
296  DataExpanded::setRefValue(int ref,  DataExpanded::setValueByReferenceNumber(int ref,
297                            const DataArray& value)                            const DataArray& value)
298  {  {
299    //    //
# Line 313  DataExpanded::setRefValue(int ref, Line 313  DataExpanded::setRefValue(int ref,
313      }      }
314    }    }
315    if (sampleNo == -1) {    if (sampleNo == -1) {
316      throw DataException("DataExpanded::setRefValue error: invalid ref number supplied.");      throw DataException("DataExpanded::setValueByReferenceNumber error: invalid ref number supplied.");
317    }    }
318    
319    for (int n=0; n<numDPPSample; n++) {    for (int n=0; n<numDPPSample; n++) {
# Line 327  DataExpanded::setRefValue(int ref, Line 327  DataExpanded::setRefValue(int ref,
327  }  }
328    
329  void  void
330  DataExpanded::getRefValue(int ref,  DataExpanded::getValueByReferenceNumber(int ref,
331                            DataArray& value)                            DataArray& value)
332  {  {
333    //    //
# Line 347  DataExpanded::getRefValue(int ref, Line 347  DataExpanded::getRefValue(int ref,
347      }      }
348    }    }
349    if (sampleNo == -1) {    if (sampleNo == -1) {
350      throw DataException("DataExpanded::getRefValue error: invalid ref number supplied.");      throw DataException("DataExpanded::getValueByReferenceNumber error: invalid ref number supplied.");
351    }    }
352    
353    //    //
# Line 383  DataExpanded::copyToDataPoint(const int Line 383  DataExpanded::copyToDataPoint(const int
383    ShapeType dataPointShape = getPointDataView().getShape();    ShapeType dataPointShape = getPointDataView().getShape();
384    if (numSamples*numDataPointsPerSample > 0) {    if (numSamples*numDataPointsPerSample > 0) {
385       //TODO: global error handling       //TODO: global error handling
386       if (sampleNo >= numSamples or sampleNo < 0 ) {       if ((sampleNo >= numSamples) || (sampleNo < 0 )) {
387            throw DataException("Error - DataExpanded::copyDataPoint invalid sampleNo.");            throw DataException("Error - DataExpanded::copyDataPoint invalid sampleNo.");
388       }       }
389       if (dataPointNo >= numDataPointsPerSample or dataPointNo < 0) {       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {
390             throw DataException("Error - DataExpanded::copyDataPoint invalid dataPointNoInSample.");             throw DataException("Error - DataExpanded::copyDataPoint invalid dataPointNoInSample.");
391       }       }
392       DataArrayView dataPointView = getDataPoint(sampleNo, dataPointNo);       DataArrayView dataPointView = getDataPoint(sampleNo, dataPointNo);
# Line 437  DataExpanded::copyToDataPoint(const int Line 437  DataExpanded::copyToDataPoint(const int
437         throw DataException("Rank of numarray does not match Data object rank");         throw DataException("Rank of numarray does not match Data object rank");
438    if (numSamples*numDataPointsPerSample > 0) {    if (numSamples*numDataPointsPerSample > 0) {
439       //TODO: global error handling       //TODO: global error handling
440       if (sampleNo >= numSamples or sampleNo < 0 ) {       if ((sampleNo >= numSamples) || (sampleNo < 0 )) {
441            throw DataException("Error - DataExpanded::copyDataPoint invalid sampleNo.");            throw DataException("Error - DataExpanded::copyDataPoint invalid sampleNo.");
442       }       }
443       if (dataPointNo >= numDataPointsPerSample or dataPointNo < 0) {       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {
444             throw DataException("Error - DataExpanded::copyDataPoint invalid dataPointNoInSample.");             throw DataException("Error - DataExpanded::copyDataPoint invalid dataPointNoInSample.");
445       }       }
446       DataArrayView dataPointView = getDataPoint(sampleNo, dataPointNo);       DataArrayView dataPointView = getDataPoint(sampleNo, dataPointNo);
# Line 681  DataExpanded::eigenvalues_and_eigenvecto Line 681  DataExpanded::eigenvalues_and_eigenvecto
681    }    }
682  }  }
683    
684    void
685    DataExpanded::dump(const std::string fileName) const
686    {
687        throw DataException("Error - DataExpanded:: dump: not implemented.");
688    }
689    
690    
691  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.922  
changed lines
  Added in v.950

  ViewVC Help
Powered by ViewVC 1.1.26