/[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 3552 by jfenwick, Mon Aug 22 00:05:17 2011 UTC revision 3675 by jfenwick, Thu Nov 17 00:53:38 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.");        
376    ostringstream oss;
377    oss << "sampleNo=" << sampleNo << " numSamples=" << numSamples << endl;  
378    cerr << oss.str();      
379          
380              
381              throw DataException("Error - DataExpanded::copyToDataPoint[scalar] invalid sampleNo.");
382       }       }
383       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {
384             throw DataException("Error - DataExpanded::copyDataPoint invalid dataPointNoInSample.");             throw DataException("Error - DataExpanded::copyToDataPoint[scalar] invalid dataPointNoInSample.");
385       }       }
386       ValueType::size_type offset = getPointOffset(sampleNo, dataPointNo);       ValueType::size_type offset = getPointOffset(sampleNo, dataPointNo);
387       ValueType& vec=getVectorRW();       ValueType& vec=getVectorRW();
# Line 427  DataExpanded::copyToDataPoint(const int Line 433  DataExpanded::copyToDataPoint(const int
433    if (numSamples*numDataPointsPerSample > 0) {    if (numSamples*numDataPointsPerSample > 0) {
434       //TODO: global error handling       //TODO: global error handling
435       if ((sampleNo >= numSamples) || (sampleNo < 0 )) {       if ((sampleNo >= numSamples) || (sampleNo < 0 )) {
436            throw DataException("Error - DataExpanded::copyDataPoint invalid sampleNo.");  
437    // ostringstream oss;
438    // oss << "sampleNo=" << sampleNo << " numSamples=" << numSamples << endl;  
439    // throw DataException(oss.str());
440    
441             throw DataException("Error - DataExpanded::copyToDataPoint[wrapped] invalid sampleNo.");
442       }       }
443       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {       if ((dataPointNo >= numDataPointsPerSample) || (dataPointNo < 0)) {
444             throw DataException("Error - DataExpanded::copyDataPoint invalid dataPointNoInSample.");             throw DataException("Error - DataExpanded::copyToDataPoint[wrapped] invalid dataPointNoInSample.");
445       }       }
446       ValueType::size_type offset = getPointOffset(sampleNo, dataPointNo);       ValueType::size_type offset = getPointOffset(sampleNo, dataPointNo);
447       ValueType& vec=getVectorRW();       ValueType& vec=getVectorRW();

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

  ViewVC Help
Powered by ViewVC 1.1.26