/[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 3675 by jfenwick, Thu Nov 17 00:53:38 2011 UTC revision 3678 by jfenwick, Thu Nov 17 06:32:05 2011 UTC
# Line 372  DataExpanded::copyToDataPoint(const int Line 372  DataExpanded::copyToDataPoint(const int
372    if (numSamples*numDataPointsPerSample > 0) {    if (numSamples*numDataPointsPerSample > 0) {
373       //TODO: global error handling       //TODO: global error handling
374       if ((sampleNo >= numSamples) || (sampleNo < 0 )) {       if ((sampleNo >= numSamples) || (sampleNo < 0 )) {
375                    throw DataException("Error - DataExpanded::copyDataPoint invalid sampleNo.");
 ostringstream oss;  
 oss << "sampleNo=" << sampleNo << " numSamples=" << numSamples << endl;    
 cerr << oss.str();        
         
             
           throw DataException("Error - DataExpanded::copyToDataPoint[scalar] invalid sampleNo.");  
376       }       }
377       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {
378             throw DataException("Error - DataExpanded::copyToDataPoint[scalar] invalid dataPointNoInSample.");             throw DataException("Error - DataExpanded::copyDataPoint invalid dataPointNoInSample.");
379       }       }
380       ValueType::size_type offset = getPointOffset(sampleNo, dataPointNo);       ValueType::size_type offset = getPointOffset(sampleNo, dataPointNo);
381       ValueType& vec=getVectorRW();       ValueType& vec=getVectorRW();
# Line 433  DataExpanded::copyToDataPoint(const int Line 427  DataExpanded::copyToDataPoint(const int
427    if (numSamples*numDataPointsPerSample > 0) {    if (numSamples*numDataPointsPerSample > 0) {
428       //TODO: global error handling       //TODO: global error handling
429       if ((sampleNo >= numSamples) || (sampleNo < 0 )) {       if ((sampleNo >= numSamples) || (sampleNo < 0 )) {
430              throw DataException("Error - DataExpanded::copyDataPoint invalid sampleNo.");
 // ostringstream oss;  
 // oss << "sampleNo=" << sampleNo << " numSamples=" << numSamples << endl;    
 // throw DataException(oss.str());  
   
          throw DataException("Error - DataExpanded::copyToDataPoint[wrapped] invalid sampleNo.");  
431       }       }
432       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {
433             throw DataException("Error - DataExpanded::copyToDataPoint[wrapped] invalid dataPointNoInSample.");             throw DataException("Error - DataExpanded::copyDataPoint invalid dataPointNoInSample.");
434       }       }
435       ValueType::size_type offset = getPointOffset(sampleNo, dataPointNo);       ValueType::size_type offset = getPointOffset(sampleNo, dataPointNo);
436       ValueType& vec=getVectorRW();       ValueType& vec=getVectorRW();

Legend:
Removed from v.3675  
changed lines
  Added in v.3678

  ViewVC Help
Powered by ViewVC 1.1.26