/[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 113 by jgs, Mon Feb 28 07:06:33 2005 UTC revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC
# Line 1  Line 1 
1  // $Id$  // $Id$
2  /*=============================================================================  /*
   
3   ******************************************************************************   ******************************************************************************
4   *                                                                            *   *                                                                            *
5   *       COPYRIGHT ACcESS 2004 -  All Rights Reserved                         *   *       COPYRIGHT ACcESS 2004 -  All Rights Reserved                         *
# Line 12  Line 11 
11   * person has a software license agreement with ACcESS.                       *   * person has a software license agreement with ACcESS.                       *
12   *                                                                            *   *                                                                            *
13   ******************************************************************************   ******************************************************************************
14    */
15    
16  ******************************************************************************/  /** \file Data.h */
17    
18  #ifndef DATA_H  #ifndef DATA_H
19  #define DATA_H  #define DATA_H
20    
21  #include "escript/Data/DataAbstract.h"  #include "escript/Data/DataAbstract.h"
22  #include "escript/Data/DataTagged.h"  #include "escript/Data/DataTagged.h"
23    #include "escript/Data/DataAlgorithm.h"
24  #include "escript/Data/FunctionSpace.h"  #include "escript/Data/FunctionSpace.h"
25  #include "escript/Data/BinaryOp.h"  #include "escript/Data/BinaryOp.h"
26  #include "escript/Data/UnaryOp.h"  #include "escript/Data/UnaryOp.h"
# Line 40  extern "C" { Line 41  extern "C" {
41  #include <boost/python/tuple.hpp>  #include <boost/python/tuple.hpp>
42  #include <boost/python/numeric.hpp>  #include <boost/python/numeric.hpp>
43    
44    namespace escript {
45    
46    //
47    // Forward declaration for various implementations of Data.
48    class DataEmpty;
49    class DataConstant;
50    class DataTagged;
51    class DataExpanded;
52    
53  /**  /**
54     \brief     \brief
55     Data is essentially a factory class which creates the appropriate Data     Data creates the appropriate Data object for the given construction
56     object for the given construction arguments. It retains control over     arguments.
    the object created for the lifetime of the object.  
    The type of Data object referred to may change during the lifetime of  
    the Data object.  
57    
58     Description:     Description:
59     Data is essentially a factory class which creates the appropriate Data     Data is essentially a factory class which creates the appropriate Data
# Line 55  extern "C" { Line 62  extern "C" {
62     The type of Data object referred to may change during the lifetime of     The type of Data object referred to may change during the lifetime of
63     the Data object.     the Data object.
64  */  */
   
 namespace escript {  
   
 //  
 // Forward declaration for various implimentations of Data.  
 class DataEmpty;  
 class DataConstant;  
 class DataTagged;  
 class DataExpanded;  
   
65  class Data {  class Data {
66    
67    public:    public:
# Line 223  class Data { Line 220  class Data {
220    
221    /**    /**
222       \brief       \brief
223         Return the values of all data-points as a single python numarray object.
224      */
225      const boost::python::numeric::array
226      convertToNumArray();
227    
228      /**
229         \brief
230         Return the values of all data-points for the given sample as a single python numarray object.
231      */
232      const boost::python::numeric::array
233      convertToNumArrayFromSampleNo(int sampleNo);
234    
235      /**
236         \brief
237         Return the value of the specified data-point as a single python numarray object.
238      */
239      const boost::python::numeric::array
240      convertToNumArrayFromDPNo(int sampleNo,
241                                int dataPointNo);
242    
243      /**
244         \brief
245         Fills the expanded Data object from values of a python numarray object.
246      */
247      void
248      fillFromNumArray(const boost::python::numeric::array);
249    
250      /**
251         \brief
252         Return the tag number associated with the given data-point.
253    
254         The data-point number here corresponds to the data-point number in the
255         numarray returned by convertToNumArray.
256      */
257      int
258      getTagNumber(int dpno);
259    
260      /**
261         \brief
262       Return the C wrapper for the Data object.       Return the C wrapper for the Data object.
263    */    */
264    escriptDataC    escriptDataC
# Line 464  class Data { Line 500  class Data {
500       \brief       \brief
501       Return the data point shape as a tuple of integers.       Return the data point shape as a tuple of integers.
502    */    */
503    boost::python::tuple    const boost::python::tuple
504    getShapeTuple() const;    getShapeTuple() const;
505    
506    /**    /**
# Line 501  class Data { Line 537  class Data {
537       cannot be converted to a DataTagged object.       cannot be converted to a DataTagged object.
538       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer key.
539       \param value - Input - Value to associate with given key.       \param value - Input - Value to associate with given key.
      Note: removed for now - this version not needed, and breaks escript.cpp  
540    */    */
   /*  
541    void    void
542    setTaggedValue(int tagKey,    setTaggedValueFromCPP(int tagKey,
543                   const DataArrayView& value);                          const DataArrayView& value);
   */  
544    
545    /**    /**
546      \brief      \brief
# Line 525  class Data { Line 558  class Data {
558       \brief       \brief
559       Interpolates this onto the given functionspace and returns       Interpolates this onto the given functionspace and returns
560       the result as a Data object.       the result as a Data object.
561         *
562    */    */
563    Data    Data
564    interpolate(const FunctionSpace& functionspace) const;    interpolate(const FunctionSpace& functionspace) const;
# Line 533  class Data { Line 567  class Data {
567       \brief       \brief
568       Calculates the gradient of the data at the data points of functionspace.       Calculates the gradient of the data at the data points of functionspace.
569       If functionspace is not present the function space of Function(getDomain()) is used.       If functionspace is not present the function space of Function(getDomain()) is used.
570         *
571    */    */
572    Data    Data
573    gradOn(const FunctionSpace& functionspace) const;    gradOn(const FunctionSpace& functionspace) const;
# Line 543  class Data { Line 578  class Data {
578    /**    /**
579       \brief       \brief
580       Calculate the integral over the function space domain.       Calculate the integral over the function space domain.
581         *
582    */    */
583    boost::python::numeric::array    boost::python::numeric::array
584    integrate() const;    integrate() const;
# Line 550  class Data { Line 586  class Data {
586    /**    /**
587       \brief       \brief
588       Return a Data with a 1 for +ive values and a 0 for 0 or -ive values.       Return a Data with a 1 for +ive values and a 0 for 0 or -ive values.
589         *
590    */    */
591    Data    Data
592    wherePositive() const;    wherePositive() const;
# Line 557  class Data { Line 594  class Data {
594    /**    /**
595       \brief       \brief
596       Return a Data with a 1 for -ive values and a 0 for +ive or 0 values.       Return a Data with a 1 for -ive values and a 0 for +ive or 0 values.
597         *
598    */    */
599    Data    Data
600    whereNegative() const;    whereNegative() const;
# Line 564  class Data { Line 602  class Data {
602    /**    /**
603       \brief       \brief
604       Return a Data with a 1 for +ive or 0 values and a 0 for -ive values.       Return a Data with a 1 for +ive or 0 values and a 0 for -ive values.
605         *
606    */    */
607    Data    Data
608    whereNonNegative() const;    whereNonNegative() const;
# Line 571  class Data { Line 610  class Data {
610    /**    /**
611       \brief       \brief
612       Return a Data with a 1 for -ive or 0 values and a 0 for +ive values.       Return a Data with a 1 for -ive or 0 values and a 0 for +ive values.
613         *
614    */    */
615    Data    Data
616    whereNonPositive() const;    whereNonPositive() const;
# Line 578  class Data { Line 618  class Data {
618    /**    /**
619       \brief       \brief
620       Return a Data with a 1 for 0 values and a 0 for +ive or -ive values.       Return a Data with a 1 for 0 values and a 0 for +ive or -ive values.
621         *
622    */    */
623    Data    Data
624    whereZero() const;    whereZero() const;
# Line 585  class Data { Line 626  class Data {
626    /**    /**
627       \brief       \brief
628       Return a Data with a 0 for 0 values and a 1 for +ive or -ive values.       Return a Data with a 0 for 0 values and a 1 for +ive or -ive values.
629         *
630    */    */
631    Data    Data
632    whereNonZero() const;    whereNonZero() const;
633    
634    /**    /**
635       \brief       \brief
636         Return the maximum absolute value of this Data object.
637         *
638      */
639      double
640      Lsup() const;
641    
642      /**
643         \brief
644         Return the minimum absolute value of this Data object.
645         *
646      */
647      double
648      Linf() const;
649    
650      /**
651         \brief
652         Return the maximum value of this Data object.
653         *
654      */
655      double
656      sup() const;
657    
658      /**
659         \brief
660         Return the minimum value of this Data object.
661         *
662      */
663      double
664      inf() const;
665    
666      /**
667         \brief
668         Return the absolute value of each data point of this Data object.
669         *
670      */
671      Data
672      abs() const;
673    
674      /**
675         \brief
676         Return the maximum value of each data point of this Data object.
677         *
678      */
679      Data
680      maxval() const;
681    
682      /**
683         \brief
684         Return the minimum value of each data point of this Data object.
685         *
686      */
687      Data
688      minval() const;
689    
690      /**
691         \brief
692         Return the (sample number, data-point number) of the data point with
693         the minimum value in this Data object.
694      */
695      const boost::python::tuple
696      mindp() const;
697    
698      void
699      calc_mindp(int& SampleNo,
700                 int& DataPointNo) const;
701    
702      /**
703         \brief
704         Return the length of each data point of this Data object.
705         sqrt(sum(A[i,j,k,l]^2))
706         *
707      */
708      Data
709      length() const;
710    
711      /**
712         \brief
713         Return the sign of each data point of this Data object.
714         -1 for negative values, zero for zero values, 1 for positive values.
715         *
716      */
717      Data
718      sign() const;
719    
720      /**
721         \brief
722         Transpose each data point of this Data object around the given axis.
723         --* not implemented yet *--
724         *
725      */
726      Data
727      transpose(int axis) const;
728    
729      /**
730         \brief
731         Calculate the trace of each data point of this Data object.
732         sum(A[i,i,i,i])
733         *
734      */
735      Data
736      trace() const;
737    
738      /**
739         \brief
740       Return the sin of each data point of this Data object.       Return the sin of each data point of this Data object.
741         *
742    */    */
743    Data    Data
744    sin() const;    sin() const;
# Line 599  class Data { Line 746  class Data {
746    /**    /**
747       \brief       \brief
748       Return the cos of each data point of this Data object.       Return the cos of each data point of this Data object.
749         *
750    */    */
751    Data    Data
752    cos() const;    cos() const;
# Line 606  class Data { Line 754  class Data {
754    /**    /**
755       \brief       \brief
756       Return the tan of each data point of this Data object.       Return the tan of each data point of this Data object.
757         *
758    */    */
759    Data    Data
760    tan() const;    tan() const;
761    
762    /**    /**
763       \brief       \brief
764       Return the log to base 10 of each data point of this Data object.       Return the asin of each data point of this Data object.
765         *
766    */    */
767    Data    Data
768    log() const;    asin() const;
769    
770    /**    /**
771       \brief       \brief
772       Return the natural log of each data point of this Data object.       Return the acos of each data point of this Data object.
773         *
774    */    */
775    Data    Data
776    ln() const;    acos() const;
777    
778    /**    /**
779       \brief       \brief
780       Return the maximum absolute value of this Data object.       Return the atan of each data point of this Data object.
781         *
782    */    */
783    double    Data
784    Lsup() const;    atan() const;
785    
786    /**    /**
787       \brief       \brief
788       Return the maximum value of this Data object.       Return the sinh of each data point of this Data object.
789         *
790    */    */
791    double    Data
792    sup() const;    sinh() const;
793    
794    /**    /**
795       \brief       \brief
796       Return the minimum value of this Data object.       Return the cosh of each data point of this Data object.
797         *
798    */    */
799    double    Data
800    inf() const;    cosh() const;
801    
802    /**    /**
803       \brief       \brief
804       Return the absolute value of each data point of this Data object.       Return the tanh of each data point of this Data object.
805         *
806    */    */
807    Data    Data
808    abs() const;    tanh() const;
809    
810    /**    /**
811       \brief       \brief
812       Return the maximum value of each data point of this Data object.       Return the asinh of each data point of this Data object.
813         *
814    */    */
815    Data    Data
816    maxval() const;    asinh() const;
817    
818    /**    /**
819       \brief       \brief
820       Return the minimum value of each data point of this Data object.       Return the acosh of each data point of this Data object.
821         *
822    */    */
823    Data    Data
824    minval() const;    acosh() const;
825    
826    /**    /**
827       \brief       \brief
828       Return the length of each data point of this Data object.       Return the atanh of each data point of this Data object.
829       sqrt(sum(A[i,j,k,l]^2))       *
830    */    */
831    Data    Data
832    length() const;    atanh() const;
833    
834    /**    /**
835       \brief       \brief
836       Return the sign of each data point of this Data object.       Return the log to base 10 of each data point of this Data object.
837       -1 for negative values, zero for zero values, 1 for positive values.       *
838    */    */
839    Data    Data
840    sign() const;    log() const;
841    
842    /**    /**
843      \transpose       \brief
844      Transpose each data point of this Data object around the given axis.       Return the natural log of each data point of this Data object.
845      --* not implemented yet *--       *
846    */    */
847    Data    Data
848    transpose(int axis) const;    ln() const;
849    
850    /**    /**
851      \trace       \brief
852      Calculate the trace of each data point of this Data object.       Return the exponential function of each data point of this Data object.
853      sum(A[i,i,i,i])       *
854    */    */
855    Data    Data
856    trace() const;    exp() const;
857    
858    /**    /**
859      \exp       \brief
860      Return the exponential function of each data point of this Data object.       Return the square root of each data point of this Data object.
861         *
862    */    */
863    Data    Data
864    exp() const;    sqrt() const;
865    
866    /**    /**
867      \sqrt       \brief
868      Return the square root of each data point of this Data object.       Return the negation of each data point of this Data object.
869         *
870    */    */
871    Data    Data
872    sqrt() const;    neg() const;
873    
874      /**
875         \brief
876         Return the identity of each data point of this Data object.
877         Simply returns this object unmodified.
878         *
879      */
880      Data
881      pos() const;
882    
883    /**    /**
884       \brief       \brief
885       Return the given power of each data point of this Data object.       Return the given power of each data point of this Data object.
886    
887         \param right Input - the power to raise the object to.
888         *
889    */    */
890    Data    Data
891    powD(const Data& right) const;    powD(const Data& right) const;
892    
893      /**
894         \brief
895         Return the given power of each data point of this boost python object.
896        
897         \param right Input - the power to raise the object to.
898         *
899       */
900    Data    Data
901    powO(const boost::python::object& right) const;    powO(const boost::python::object& right) const;
902    
903    /**    /**
904      \brief       \brief
905      writes the object to a file in the DX file format       writes the object to a file in the DX file format
906    */    */
907    void    void
908    saveDX(std::string fileName) const;    saveDX(std::string fileName) const;
909    
910    /**    /**
911      \brief       \brief
912      writes the object to a file in the VTK file format       writes the object to a file in the VTK file format
913    */    */
914    void    void
915    saveVTK(std::string fileName) const;    saveVTK(std::string fileName) const;
916    
917    /**    /**
     \brief  
     Return the negation of each data point of this Data object.  
   */  
   Data  
   neg() const;  
   
   /**  
     \brief  
     Return the identity of each data point of this Data object.  
     Simply returns this object unmodified.  
   */  
   Data  
   pos() const;  
   
   /**  
918       \brief       \brief
919       Overloaded operator +=       Overloaded operator +=
920       \param right - Input - The right hand side.       \param right - Input - The right hand side.
921         *
922    */    */
923    Data& operator+=(const Data& right);    Data& operator+=(const Data& right);
924    Data& operator+=(const boost::python::object& right);    Data& operator+=(const boost::python::object& right);
# Line 763  class Data { Line 927  class Data {
927       \brief       \brief
928       Overloaded operator -=       Overloaded operator -=
929       \param right - Input - The right hand side.       \param right - Input - The right hand side.
930         *
931    */    */
932    Data& operator-=(const Data& right);    Data& operator-=(const Data& right);
933    Data& operator-=(const boost::python::object& right);    Data& operator-=(const boost::python::object& right);
# Line 771  class Data { Line 936  class Data {
936       \brief       \brief
937       Overloaded operator *=       Overloaded operator *=
938       \param right - Input - The right hand side.       \param right - Input - The right hand side.
939         *
940    */    */
941    Data& operator*=(const Data& right);    Data& operator*=(const Data& right);
942    Data& operator*=(const boost::python::object& right);    Data& operator*=(const boost::python::object& right);
# Line 779  class Data { Line 945  class Data {
945       \brief       \brief
946       Overloaded operator /=       Overloaded operator /=
947       \param right - Input - The right hand side.       \param right - Input - The right hand side.
948         *
949    */    */
950    Data& operator/=(const Data& right);    Data& operator/=(const Data& right);
951    Data& operator/=(const boost::python::object& right);    Data& operator/=(const boost::python::object& right);
# Line 812  class Data { Line 979  class Data {
979       \brief       \brief
980       Copies slice from value into this Data object.       Copies slice from value into this Data object.
981    
      \description  
982       Implements the [] set operator in python.       Implements the [] set operator in python.
983       Calls setSlice.       Calls setSlice.
984    
# Line 845  class Data { Line 1011  class Data {
1011       Return a Data object containing the specified slice of       Return a Data object containing the specified slice of
1012       this Data object.       this Data object.
1013       \param region - Input - Region to copy.       \param region - Input - Region to copy.
1014         *
1015    */    */
1016    Data    Data
1017    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataArrayView::RegionType& region) const;
# Line 855  class Data { Line 1022  class Data {
1022       Data object.       Data object.
1023       \param value - Input - Data to copy from.       \param value - Input - Data to copy from.
1024       \param region - Input - Region to copy.       \param region - Input - Region to copy.
1025         *
1026    */    */
1027    void    void
1028    setSlice(const Data& value,    setSlice(const Data& value,
1029             const DataArrayView::RegionType& region);             const DataArrayView::RegionType& region);
1030    
1031      /**
1032         \brief
1033         Archive the current Data object to the given file.
1034         \param fileName - Input - file to archive to.
1035      */
1036      void
1037      archiveData(const std::string fileName);
1038    
1039      /**
1040         \brief
1041         Extract the Data object archived in the given file, overwriting
1042         the current Data object.
1043         Note - the current object must be of type DataEmpty.
1044         \param fileName - Input - file to extract from.
1045         \param fspace - Input - a suitable FunctionSpace descibing the data.
1046      */
1047      void
1048      extractData(const std::string fileName,
1049                  const FunctionSpace& fspace);
1050    
1051   protected:   protected:
1052    
1053   private:   private:
# Line 882  class Data { Line 1070  class Data {
1070       Perform the specified reduction algorithm on every element of every data point in       Perform the specified reduction algorithm on every element of every data point in
1071       this Data object according to the given function and return the single value result.       this Data object according to the given function and return the single value result.
1072    */    */
1073    template <class UnaryFunction>    template <class BinaryFunction>
1074    inline    inline
1075    double    double
1076    algorithm(UnaryFunction operation) const;    algorithm(BinaryFunction operation,
1077                double initial_value) const;
1078    
1079    /**    /**
1080       \brief       \brief
# Line 894  class Data { Line 1083  class Data {
1083       one value - the result of the reduction operation on the corresponding data-point in       one value - the result of the reduction operation on the corresponding data-point in
1084       this Data object       this Data object
1085    */    */
1086    template <class UnaryFunction>    template <class BinaryFunction>
1087    inline    inline
1088    Data    Data
1089    dp_algorithm(UnaryFunction operation) const;    dp_algorithm(BinaryFunction operation,
1090                   double initial_value) const;
1091    
1092    /**    /**
1093       \brief       \brief
# Line 964  class Data { Line 1154  class Data {
1154    // pointer to the actual data object    // pointer to the actual data object
1155    boost::shared_ptr<DataAbstract> m_data;    boost::shared_ptr<DataAbstract> m_data;
1156    
1157      //
1158      // pointer to the internal profiling data
1159      struct profDataEntry *profData;
1160    
1161  };  };
1162    
1163  template <class IValueType>  template <class IValueType>
# Line 1259  Data::unaryOp(UnaryFunction operation) Line 1453  Data::unaryOp(UnaryFunction operation)
1453    object (*this) is a rank n Data object, and returned object is a scalar.    object (*this) is a rank n Data object, and returned object is a scalar.
1454    Calls escript::algorithm.    Calls escript::algorithm.
1455  */  */
1456  template <class UnaryFunction>  template <class BinaryFunction>
1457  inline  inline
1458  double  double
1459  Data::algorithm(UnaryFunction operation) const  Data::algorithm(BinaryFunction operation, double initial_value) const
1460  {  {
1461    if (isExpanded()) {    if (isExpanded()) {
1462      DataExpanded* leftC=dynamic_cast<DataExpanded*>(m_data.get());      DataExpanded* leftC=dynamic_cast<DataExpanded*>(m_data.get());
1463      EsysAssert((leftC!=0), "Programming error - casting to DataExpanded.");      EsysAssert((leftC!=0), "Programming error - casting to DataExpanded.");
1464      return escript::algorithm(*leftC,operation);      return escript::algorithm(*leftC,operation,initial_value);
1465    } else if (isTagged()) {    } else if (isTagged()) {
1466      DataTagged* leftC=dynamic_cast<DataTagged*>(m_data.get());      DataTagged* leftC=dynamic_cast<DataTagged*>(m_data.get());
1467      EsysAssert((leftC!=0), "Programming error - casting to DataTagged.");      EsysAssert((leftC!=0), "Programming error - casting to DataTagged.");
1468      return escript::algorithm(*leftC,operation);      return escript::algorithm(*leftC,operation,initial_value);
1469    } else if (isConstant()) {    } else if (isConstant()) {
1470      DataConstant* leftC=dynamic_cast<DataConstant*>(m_data.get());      DataConstant* leftC=dynamic_cast<DataConstant*>(m_data.get());
1471      EsysAssert((leftC!=0), "Programming error - casting to DataConstant.");      EsysAssert((leftC!=0), "Programming error - casting to DataConstant.");
1472      return escript::algorithm(*leftC,operation);      return escript::algorithm(*leftC,operation,initial_value);
1473    }    }
1474    return 0;    return 0;
1475  }  }
# Line 1288  Data::algorithm(UnaryFunction operation) Line 1482  Data::algorithm(UnaryFunction operation)
1482    rank 0 Data object.    rank 0 Data object.
1483    Calls escript::dp_algorithm.    Calls escript::dp_algorithm.
1484  */  */
1485  template <class UnaryFunction>  template <class BinaryFunction>
1486  inline  inline
1487  Data  Data
1488  Data::dp_algorithm(UnaryFunction operation) const  Data::dp_algorithm(BinaryFunction operation, double initial_value) const
1489  {  {
1490    Data result(0,DataArrayView::ShapeType(),getFunctionSpace(),isExpanded());    Data result(0,DataArrayView::ShapeType(),getFunctionSpace(),isExpanded());
1491    if (isExpanded()) {    if (isExpanded()) {
# Line 1299  Data::dp_algorithm(UnaryFunction operati Line 1493  Data::dp_algorithm(UnaryFunction operati
1493      DataExpanded* resultE=dynamic_cast<DataExpanded*>(result.m_data.get());      DataExpanded* resultE=dynamic_cast<DataExpanded*>(result.m_data.get());
1494      EsysAssert((dataE!=0), "Programming error - casting data to DataExpanded.");      EsysAssert((dataE!=0), "Programming error - casting data to DataExpanded.");
1495      EsysAssert((resultE!=0), "Programming error - casting result to DataExpanded.");      EsysAssert((resultE!=0), "Programming error - casting result to DataExpanded.");
1496      escript::dp_algorithm(*dataE,*resultE,operation);      escript::dp_algorithm(*dataE,*resultE,operation,initial_value);
1497    } else if (isTagged()) {    } else if (isTagged()) {
1498      DataTagged* dataT=dynamic_cast<DataTagged*>(m_data.get());      DataTagged* dataT=dynamic_cast<DataTagged*>(m_data.get());
1499      DataTagged* resultT=dynamic_cast<DataTagged*>(result.m_data.get());      DataTagged* resultT=dynamic_cast<DataTagged*>(result.m_data.get());
1500      EsysAssert((dataT!=0), "Programming error - casting data to DataTagged.");      EsysAssert((dataT!=0), "Programming error - casting data to DataTagged.");
1501      EsysAssert((resultT!=0), "Programming error - casting result to DataTagged.");      EsysAssert((resultT!=0), "Programming error - casting result to DataTagged.");
1502      escript::dp_algorithm(*dataT,*resultT,operation);      escript::dp_algorithm(*dataT,*resultT,operation,initial_value);
1503    } else if (isConstant()) {    } else if (isConstant()) {
1504      DataConstant* dataC=dynamic_cast<DataConstant*>(m_data.get());      DataConstant* dataC=dynamic_cast<DataConstant*>(m_data.get());
1505      DataConstant* resultC=dynamic_cast<DataConstant*>(result.m_data.get());      DataConstant* resultC=dynamic_cast<DataConstant*>(result.m_data.get());
1506      EsysAssert((dataC!=0), "Programming error - casting data to DataConstant.");      EsysAssert((dataC!=0), "Programming error - casting data to DataConstant.");
1507      EsysAssert((resultC!=0), "Programming error - casting result to DataConstant.");      EsysAssert((resultC!=0), "Programming error - casting result to DataConstant.");
1508      escript::dp_algorithm(*dataC,*resultC,operation);      escript::dp_algorithm(*dataC,*resultC,operation,initial_value);
1509    }    }
1510    return result;    return result;
1511  }  }

Legend:
Removed from v.113  
changed lines
  Added in v.150

  ViewVC Help
Powered by ViewVC 1.1.26