/[escript]/branches/arrexp_2137_win/escript/src/DataTagged.cpp
ViewVC logotype

Diff of /branches/arrexp_2137_win/escript/src/DataTagged.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 519 by jgs, Tue Feb 14 05:30:50 2006 UTC revision 594 by gross, Tue Mar 14 23:36:08 2006 UTC
# Line 208  DataTagged::setSlice(const DataAbstract* Line 208  DataTagged::setSlice(const DataAbstract*
208    // copy slice from other default value to this default value    // copy slice from other default value to this default value
209    getDefaultValue().copySliceFrom(otherTemp->getDefaultValue(), regionLoopRange);    getDefaultValue().copySliceFrom(otherTemp->getDefaultValue(), regionLoopRange);
210    
211    // loop through the tag values copying slices from other to this    // loop through tag values in other, adding any which aren't in this, using default value
212    DataMapType::const_iterator pos;    DataMapType::const_iterator pos;
213      for (pos=otherTemp->m_offsetLookup.begin();pos!=otherTemp->m_offsetLookup.end();pos++) {
214        if (!isCurrentTag(pos->first)) {
215          addTaggedValue(pos->first,getDefaultValue());
216        }
217      }
218    
219      // loop through the tag values copying slices from other to this
220    for (pos=m_offsetLookup.begin();pos!=m_offsetLookup.end();pos++) {    for (pos=m_offsetLookup.begin();pos!=m_offsetLookup.end();pos++) {
221      getDataPointByTag(pos->first).copySliceFrom(otherTemp->getDataPointByTag(pos->first), regionLoopRange);      getDataPointByTag(pos->first).copySliceFrom(otherTemp->getDataPointByTag(pos->first), regionLoopRange);
222    }    }
# Line 414  DataTagged::extractData(ifstream& archiv Line 421  DataTagged::extractData(ifstream& archiv
421  {  {
422    return(m_data.extractData(archiveFile, noValues));    return(m_data.extractData(archiveFile, noValues));
423  }  }
424    void
425    DataTagged::eigenvalues(DataAbstract* ev)
426    {
427      DataTagged* temp_ev=dynamic_cast<DataTagged*>(ev);
428      if (temp_ev==0) {
429        throw DataException("Error - DataTagged::eigenvalues casting to DataTagged failed (propably a programming error).");
430      }
431      const DataTagged::DataMapType& thisLookup=getTagLookup();
432      DataTagged::DataMapType::const_iterator i;
433      DataTagged::DataMapType::const_iterator thisLookupEnd=thisLookup.end();
434      for (i=thisLookup.begin();i!=thisLookupEnd;i++) {
435          temp_ev->addTaggedValue(i->first,temp_ev->getDefaultValue());
436          DataArrayView thisView=getDataPointByTag(i->first);
437          DataArrayView evView=temp_ev->getDataPointByTag(i->first);
438          DataArrayView::eigenvalues(thisView,0,evView,0);
439      }
440      DataArrayView::eigenvalues(getDefaultValue(),0,temp_ev->getDefaultValue(),0);
441    }
442    void
443    DataTagged::eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol)
444    {
445      DataTagged* temp_ev=dynamic_cast<DataTagged*>(ev);
446      if (temp_ev==0) {
447        throw DataException("Error - DataTagged::eigenvalues_and_eigenvectors casting to DataTagged failed (propably a programming error).");
448      }
449      DataTagged* temp_V=dynamic_cast<DataTagged*>(V);
450      if (temp_V==0) {
451        throw DataException("Error - DataTagged::eigenvalues_and_eigenvectors casting to DataTagged failed (propably a programming error).");
452      }
453      const DataTagged::DataMapType& thisLookup=getTagLookup();
454      DataTagged::DataMapType::const_iterator i;
455      DataTagged::DataMapType::const_iterator thisLookupEnd=thisLookup.end();
456      for (i=thisLookup.begin();i!=thisLookupEnd;i++) {
457          temp_ev->addTaggedValue(i->first,temp_ev->getDefaultValue());
458          temp_V->addTaggedValue(i->first,temp_V->getDefaultValue());
459          DataArrayView thisView=getDataPointByTag(i->first);
460          DataArrayView evView=temp_ev->getDataPointByTag(i->first);
461          DataArrayView VView=temp_V->getDataPointByTag(i->first);
462          DataArrayView::eigenvalues_and_eigenvectors(thisView,0,evView,0,VView,0,tol);
463      }
464      DataArrayView::eigenvalues_and_eigenvectors(getDefaultValue(),0,
465                                                  temp_ev->getDefaultValue(),0,
466                                                  temp_V->getDefaultValue(),0,
467                                                  tol);
468    
469    
470    }
471    
472    
473  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.519  
changed lines
  Added in v.594

  ViewVC Help
Powered by ViewVC 1.1.26