/[escript]/trunk/escript/src/DataTagged.cpp
ViewVC logotype

Diff of /trunk/escript/src/DataTagged.cpp

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

revision 541 by jgs, Mon Feb 20 06:50:39 2006 UTC revision 615 by elspeth, Wed Mar 22 02:12:00 2006 UTC
# Line 1  Line 1 
1  // $Id$  // $Id$
2    
3  /*  /*
4   ******************************************************************************   ************************************************************
5   *                                                                            *   *          Copyright 2006 by ACcESS MNRF                   *
6   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *   *                                                          *
7   *                                                                            *   *              http://www.access.edu.au                    *
8   * This software is the property of ACcESS. No part of this code              *   *       Primary Business: Queensland, Australia            *
9   * may be copied in any form or by any means without the expressed written    *   *  Licensed under the Open Software License version 3.0    *
10   * consent of ACcESS.  Copying, use or modification of this software          *   *     http://www.opensource.org/licenses/osl-3.0.php       *
11   * by any unauthorised person is illegal unless that person has a software    *   *                                                          *
12   * license agreement with ACcESS.                                             *   ************************************************************
  *                                                                            *  
  ******************************************************************************  
13  */  */
14    
15  #include "DataTagged.h"  #include "DataTagged.h"
# Line 421  DataTagged::extractData(ifstream& archiv Line 419  DataTagged::extractData(ifstream& archiv
419  {  {
420    return(m_data.extractData(archiveFile, noValues));    return(m_data.extractData(archiveFile, noValues));
421  }  }
422    void
423    DataTagged::eigenvalues(DataAbstract* ev)
424    {
425      DataTagged* temp_ev=dynamic_cast<DataTagged*>(ev);
426      if (temp_ev==0) {
427        throw DataException("Error - DataTagged::eigenvalues casting to DataTagged failed (propably a programming error).");
428      }
429      const DataTagged::DataMapType& thisLookup=getTagLookup();
430      DataTagged::DataMapType::const_iterator i;
431      DataTagged::DataMapType::const_iterator thisLookupEnd=thisLookup.end();
432      for (i=thisLookup.begin();i!=thisLookupEnd;i++) {
433          temp_ev->addTaggedValue(i->first,temp_ev->getDefaultValue());
434          DataArrayView thisView=getDataPointByTag(i->first);
435          DataArrayView evView=temp_ev->getDataPointByTag(i->first);
436          DataArrayView::eigenvalues(thisView,0,evView,0);
437      }
438      DataArrayView::eigenvalues(getDefaultValue(),0,temp_ev->getDefaultValue(),0);
439    }
440    void
441    DataTagged::eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol)
442    {
443      DataTagged* temp_ev=dynamic_cast<DataTagged*>(ev);
444      if (temp_ev==0) {
445        throw DataException("Error - DataTagged::eigenvalues_and_eigenvectors casting to DataTagged failed (propably a programming error).");
446      }
447      DataTagged* temp_V=dynamic_cast<DataTagged*>(V);
448      if (temp_V==0) {
449        throw DataException("Error - DataTagged::eigenvalues_and_eigenvectors casting to DataTagged failed (propably a programming error).");
450      }
451      const DataTagged::DataMapType& thisLookup=getTagLookup();
452      DataTagged::DataMapType::const_iterator i;
453      DataTagged::DataMapType::const_iterator thisLookupEnd=thisLookup.end();
454      for (i=thisLookup.begin();i!=thisLookupEnd;i++) {
455          temp_ev->addTaggedValue(i->first,temp_ev->getDefaultValue());
456          temp_V->addTaggedValue(i->first,temp_V->getDefaultValue());
457          DataArrayView thisView=getDataPointByTag(i->first);
458          DataArrayView evView=temp_ev->getDataPointByTag(i->first);
459          DataArrayView VView=temp_V->getDataPointByTag(i->first);
460          DataArrayView::eigenvalues_and_eigenvectors(thisView,0,evView,0,VView,0,tol);
461      }
462      DataArrayView::eigenvalues_and_eigenvectors(getDefaultValue(),0,
463                                                  temp_ev->getDefaultValue(),0,
464                                                  temp_V->getDefaultValue(),0,
465                                                  tol);
466    
467    
468    }
469    
470    
471  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.541  
changed lines
  Added in v.615

  ViewVC Help
Powered by ViewVC 1.1.26