/[escript]/trunk/escript/src/Data.h
ViewVC logotype

Diff of /trunk/escript/src/Data.h

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

revision 97 by jgs, Tue Dec 14 05:39:33 2004 UTC revision 108 by jgs, Thu Jan 27 06:21:59 2005 UTC
# Line 23  Line 23 
23  #include "escript/Data/FunctionSpace.h"  #include "escript/Data/FunctionSpace.h"
24  #include "escript/Data/BinaryOp.h"  #include "escript/Data/BinaryOp.h"
25  #include "escript/Data/UnaryOp.h"  #include "escript/Data/UnaryOp.h"
26    #include "escript/Data/DataException.h"
27    
28  extern "C" {  extern "C" {
29  #include "escript/Data/DataC.h"  #include "escript/Data/DataC.h"
# Line 643  class Data { Line 644  class Data {
644    /**    /**
645      \transpose      \transpose
646      Transpose each data point of this Data object around the given axis.      Transpose each data point of this Data object around the given axis.
647        --* not implemented yet *--
648    */    */
649    Data    Data
650    transpose(int axis) const;    transpose(int axis) const;
# Line 681  class Data { Line 683  class Data {
683    
684    /**    /**
685      \brief      \brief
686        writes the object to a file in the DX file format
687      */
688      void
689      saveDX(std::string fileName) const;
690    
691      /**
692        \brief
693      Return the negation of each data point of this Data object.      Return the negation of each data point of this Data object.
694    */    */
695    Data    Data
# Line 830  class Data { Line 839  class Data {
839    double    double
840    algorithm(UnaryFunction operation) const;    algorithm(UnaryFunction operation) const;
841    
842      template <class UnaryFunction>
843      inline
844      Data
845      dp_algorithm(UnaryFunction operation) const;
846    
847    /**    /**
848       \brief       \brief
849       Perform the given binary operation on all of the data's elements.       Perform the given binary operation on all of the data's elements.
# Line 1222  Data::algorithm(UnaryFunction operation) Line 1236  Data::algorithm(UnaryFunction operation)
1236  template <class UnaryFunction>  template <class UnaryFunction>
1237  inline  inline
1238  Data  Data
1239  dp_algorithm(const Data& data,  Data::dp_algorithm(UnaryFunction operation) const
              UnaryFunction operation)  
1240  {  {
1241    Data result(0,DataArrayView::ShapeType(),data.getFunctionSpace(),data.isExpanded());    Data result(0,DataArrayView::ShapeType(),getFunctionSpace(),isExpanded());
1242    if (data.isExpanded()) {    if (isExpanded()) {
1243      DataExpanded* dataE=dynamic_cast<DataExpanded*>(data.m_data.get());      DataExpanded* dataE=dynamic_cast<DataExpanded*>(m_data.get());
1244      DataExpanded* resultE=dynamic_cast<DataExpanded*>(result.m_data.get());      DataExpanded* resultE=dynamic_cast<DataExpanded*>(result.m_data.get());
1245      EsysAssert((dataE!=0), "Programming error - casting data to DataExpanded.");      EsysAssert((dataE!=0), "Programming error - casting data to DataExpanded.");
1246      EsysAssert((resultE!=0), "Programming error - casting result to DataExpanded.");      EsysAssert((resultE!=0), "Programming error - casting result to DataExpanded.");
1247      escript::dp_algorithm(*dataE,*resultE,operation);      escript::dp_algorithm(*dataE,*resultE,operation);
1248    } else if (data.isTagged()) {    } else if (isTagged()) {
1249      DataTagged* dataT=dynamic_cast<DataTagged*>(data.m_data.get());      DataTagged* dataT=dynamic_cast<DataTagged*>(m_data.get());
1250      DataTagged* resultT=dynamic_cast<DataTagged*>(result.m_data.get());      DataTagged* resultT=dynamic_cast<DataTagged*>(result.m_data.get());
1251      EsysAssert((dataT!=0), "Programming error - casting data to DataTagged.");      EsysAssert((dataT!=0), "Programming error - casting data to DataTagged.");
1252      EsysAssert((resultT!=0), "Programming error - casting result to DataTagged.");      EsysAssert((resultT!=0), "Programming error - casting result to DataTagged.");
1253      escript::dp_algorithm(*dataT,*resultT,operation);      escript::dp_algorithm(*dataT,*resultT,operation);
1254    } else if (data.isConstant()) {    } else if (isConstant()) {
1255      DataConstant* dataC=dynamic_cast<DataConstant*>(data.m_data.get());      DataConstant* dataC=dynamic_cast<DataConstant*>(m_data.get());
1256      DataConstant* resultC=dynamic_cast<DataConstant*>(result.m_data.get());      DataConstant* resultC=dynamic_cast<DataConstant*>(result.m_data.get());
1257      EsysAssert((dataC!=0), "Programming error - casting data to DataConstant.");      EsysAssert((dataC!=0), "Programming error - casting data to DataConstant.");
1258      EsysAssert((resultC!=0), "Programming error - casting result to DataConstant.");      EsysAssert((resultC!=0), "Programming error - casting result to DataConstant.");

Legend:
Removed from v.97  
changed lines
  Added in v.108

  ViewVC Help
Powered by ViewVC 1.1.26