/[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 480 by jgs, Wed Feb 1 05:15:12 2006 UTC revision 789 by dhawcroft, Wed Jul 26 05:41:11 2006 UTC
# Line 1  Line 1 
1  // $Id$  // $Id$
2  /*  /*
3   ******************************************************************************   ************************************************************
4   *                                                                            *   *          Copyright 2006 by ACcESS MNRF                   *
5   *       COPYRIGHT ACcESS 2004 -  All Rights Reserved                         *   *                                                          *
6   *                                                                            *   *              http://www.access.edu.au                    *
7   * This software is the property of ACcESS.  No part of this code             *   *       Primary Business: Queensland, Australia            *
8   * may be copied in any form or by any means without the expressed written    *   *  Licensed under the Open Software License version 3.0    *
9   * consent of ACcESS.  Copying, use or modification of this software          *   *     http://www.opensource.org/licenses/osl-3.0.php       *
10   * by any unauthorised person is illegal unless that                          *   *                                                          *
11   * person has a software license agreement with ACcESS.                       *   ************************************************************
  *                                                                            *  
  ******************************************************************************  
12  */  */
13    
14  /** \file Data.h */  /** \file Data.h */
15    
16  #ifndef DATA_H  #ifndef DATA_H
17  #define DATA_H  #define DATA_H
18    #include "system_dep.h"
19    
20  #include "DataAbstract.h"  #include "DataAbstract.h"
21  #include "DataAlgorithm.h"  #include "DataAlgorithm.h"
# Line 27  Line 26 
26    
27  extern "C" {  extern "C" {
28  #include "DataC.h"  #include "DataC.h"
29    #include "paso/Paso.h"
30  }  }
31    
32  #include <string>  #include <string>
# Line 75  class Data { Line 75  class Data {
75       Default constructor.       Default constructor.
76       Creates a DataEmpty object.       Creates a DataEmpty object.
77    */    */
78      ESCRIPT_DLL_API
79    Data();    Data();
80    
81    /**    /**
# Line 82  class Data { Line 83  class Data {
83       Copy constructor.       Copy constructor.
84       WARNING: Only performs a shallow copy.       WARNING: Only performs a shallow copy.
85    */    */
86      ESCRIPT_DLL_API
87    Data(const Data& inData);    Data(const Data& inData);
88    
89    /**    /**
# Line 90  class Data { Line 92  class Data {
92       function space of inData the inData are tried to be interpolated to what,       function space of inData the inData are tried to be interpolated to what,
93       otherwise a shallow copy of inData is returned.       otherwise a shallow copy of inData is returned.
94    */    */
95      ESCRIPT_DLL_API
96    Data(const Data& inData,    Data(const Data& inData,
97         const FunctionSpace& what);         const FunctionSpace& what);
98    
# Line 103  class Data { Line 106  class Data {
106                         the value. Otherwise a more efficient storage                         the value. Otherwise a more efficient storage
107                         mechanism will be used.                         mechanism will be used.
108    */    */
109      ESCRIPT_DLL_API
110    Data(const DataArrayView& value,    Data(const DataArrayView& value,
111         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
112         bool expanded=false);         bool expanded=false);
# Line 118  class Data { Line 122  class Data {
122                         the given value. Otherwise a more efficient storage                         the given value. Otherwise a more efficient storage
123                         mechanism will be used.                         mechanism will be used.
124    */    */
125      ESCRIPT_DLL_API
126    Data(double value,    Data(double value,
127         const DataArrayView::ShapeType& dataPointShape=DataArrayView::ShapeType(),         const DataArrayView::ShapeType& dataPointShape=DataArrayView::ShapeType(),
128         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
# Line 130  class Data { Line 135  class Data {
135       \param inData - Input - Input Data object.       \param inData - Input - Input Data object.
136       \param region - Input - Region to copy.       \param region - Input - Region to copy.
137    */    */
138      ESCRIPT_DLL_API
139    Data(const Data& inData,    Data(const Data& inData,
140         const DataArrayView::RegionType& region);         const DataArrayView::RegionType& region);
141    
# Line 145  class Data { Line 151  class Data {
151       \param what - Input - A description of what this data represents.       \param what - Input - A description of what this data represents.
152       \param expanded - Input - Flag, if true fill the entire container with       \param expanded - Input - Flag, if true fill the entire container with
153                         the appropriate values.                         the appropriate values.
154        ==>*
155    */    */
156      ESCRIPT_DLL_API
157    Data(const DataTagged::TagListType& tagKeys,    Data(const DataTagged::TagListType& tagKeys,
158         const DataTagged::ValueListType& values,         const DataTagged::ValueListType& values,
159         const DataArrayView& defaultValue,         const DataArrayView& defaultValue,
# Line 162  class Data { Line 170  class Data {
170                         the value. Otherwise a more efficient storage                         the value. Otherwise a more efficient storage
171                         mechanism will be used.                         mechanism will be used.
172    */    */
173      ESCRIPT_DLL_API
174    Data(const boost::python::numeric::array& value,    Data(const boost::python::numeric::array& value,
175         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
176         bool expanded=false);         bool expanded=false);
# Line 177  class Data { Line 186  class Data {
186                         the value. Otherwise a more efficient storage                         the value. Otherwise a more efficient storage
187                         mechanism will be used.                         mechanism will be used.
188    */    */
189      ESCRIPT_DLL_API
190    Data(const boost::python::object& value,    Data(const boost::python::object& value,
191         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
192         bool expanded=false);         bool expanded=false);
# Line 190  class Data { Line 200  class Data {
200       \param value - Input - Input data.       \param value - Input - Input data.
201       \param other - Input - contains all other parameters.       \param other - Input - contains all other parameters.
202    */    */
203      ESCRIPT_DLL_API
204    Data(const boost::python::object& value,    Data(const boost::python::object& value,
205         const Data& other);         const Data& other);
206    
# Line 197  class Data { Line 208  class Data {
208       \brief       \brief
209       Constructor which creates a DataConstant of "shape" with constant value.       Constructor which creates a DataConstant of "shape" with constant value.
210    */    */
211      ESCRIPT_DLL_API
212    Data(double value,    Data(double value,
213         const boost::python::tuple& shape=boost::python::make_tuple(),         const boost::python::tuple& shape=boost::python::make_tuple(),
214         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
# Line 205  class Data { Line 217  class Data {
217       \brief       \brief
218       Destructor       Destructor
219    */    */
220      ESCRIPT_DLL_API
221    ~Data();    ~Data();
222    
223    /**    /**
224       \brief       \brief
225       Perform a deep copy.       Perform a deep copy.
226    */    */
227      ESCRIPT_DLL_API
228    void    void
229    copy(const Data& other);    copy(const Data& other);
230    
# Line 220  class Data { Line 234  class Data {
234    
235    /**    /**
236       \brief       \brief
237         switches on update protection
238    
239      */
240      ESCRIPT_DLL_API
241      void
242      setProtection();
243    
244      /**
245         \brief
246         Returns trueif the data object is protected against update
247    
248      */
249      ESCRIPT_DLL_API
250      bool
251      isProtected() const;
252      /**
253         \brief
254       Return the values of all data-points as a single python numarray object.       Return the values of all data-points as a single python numarray object.
255    */    */
256      ESCRIPT_DLL_API
257    const boost::python::numeric::array    const boost::python::numeric::array
258    convertToNumArray();    convertToNumArray();
259    
# Line 229  class Data { Line 261  class Data {
261       \brief       \brief
262       Return the values of all data-points for the given sample as a single python numarray object.       Return the values of all data-points for the given sample as a single python numarray object.
263    */    */
264      ESCRIPT_DLL_API
265    const boost::python::numeric::array    const boost::python::numeric::array
266    convertToNumArrayFromSampleNo(int sampleNo);    convertToNumArrayFromSampleNo(int sampleNo);
267    
# Line 236  class Data { Line 269  class Data {
269       \brief       \brief
270       Return the value of the specified data-point as a single python numarray object.       Return the value of the specified data-point as a single python numarray object.
271    */    */
272    #ifndef PASO_MPI  
273      ESCRIPT_DLL_API
274    const boost::python::numeric::array    const boost::python::numeric::array
275    convertToNumArrayFromDPNo(int sampleNo,    convertToNumArrayFromDPNo(int sampleNo,
276                              int dataPointNo);                              int dataPointNo);
277    #else
278      ESCRIPT_DLL_API
279      const boost::python::numeric::array
280      convertToNumArrayFromDPNo(int procNo,
281                    int sampleNo,
282                    int dataPointNo);
283    #endif
284    
285    
286    /**    /**
287       \brief       \brief
288       Fills the expanded Data object from values of a python numarray object.       Fills the expanded Data object from values of a python numarray object.
289    */    */
290      ESCRIPT_DLL_API
291    void    void
292    fillFromNumArray(const boost::python::numeric::array);    fillFromNumArray(const boost::python::numeric::array);
293    
# Line 254  class Data { Line 298  class Data {
298       The data-point number here corresponds to the data-point number in the       The data-point number here corresponds to the data-point number in the
299       numarray returned by convertToNumArray.       numarray returned by convertToNumArray.
300    */    */
301      ESCRIPT_DLL_API
302    int    int
303    getTagNumber(int dpno);    getTagNumber(int dpno);
304    
# Line 261  class Data { Line 306  class Data {
306       \brief       \brief
307       Return the C wrapper for the Data object.       Return the C wrapper for the Data object.
308    */    */
309      ESCRIPT_DLL_API
310    escriptDataC    escriptDataC
311    getDataC();    getDataC();
312    
# Line 268  class Data { Line 314  class Data {
314       \brief       \brief
315       Return the C wrapper for the Data object - const version.       Return the C wrapper for the Data object - const version.
316    */    */
317      ESCRIPT_DLL_API
318    escriptDataC    escriptDataC
319    getDataC() const;    getDataC() const;
320    
# Line 275  class Data { Line 322  class Data {
322       \brief       \brief
323       Write the data as a string.       Write the data as a string.
324    */    */
325      ESCRIPT_DLL_API
326    inline    inline
327    std::string    std::string
328    toString() const    toString() const
# Line 288  class Data { Line 336  class Data {
336       the shape information for each data point although it also may be used       the shape information for each data point although it also may be used
337       to manipulate the point data.       to manipulate the point data.
338    */    */
339      ESCRIPT_DLL_API
340    inline    inline
341    const DataArrayView&    const DataArrayView&
342    getPointDataView() const    getPointDataView() const
# Line 299  class Data { Line 348  class Data {
348       \brief       \brief
349       Whatever the current Data type make this into a DataExpanded.       Whatever the current Data type make this into a DataExpanded.
350    */    */
351      ESCRIPT_DLL_API
352    void    void
353    expand();    expand();
354    
# Line 307  class Data { Line 357  class Data {
357       If possible convert this Data to DataTagged. This will only allow       If possible convert this Data to DataTagged. This will only allow
358       Constant data to be converted to tagged. An attempt to convert       Constant data to be converted to tagged. An attempt to convert
359       Expanded data to tagged will throw an exception.       Expanded data to tagged will throw an exception.
360        ==>*
361    */    */
362      ESCRIPT_DLL_API
363    void    void
364    tag();    tag();
365    
# Line 315  class Data { Line 367  class Data {
367       \brief       \brief
368       Return true if this Data is expanded.       Return true if this Data is expanded.
369    */    */
370      ESCRIPT_DLL_API
371    bool    bool
372    isExpanded() const;    isExpanded() const;
373    
# Line 322  class Data { Line 375  class Data {
375       \brief       \brief
376       Return true if this Data is tagged.       Return true if this Data is tagged.
377    */    */
378      ESCRIPT_DLL_API
379    bool    bool
380    isTagged() const;    isTagged() const;
381    
# Line 329  class Data { Line 383  class Data {
383       \brief       \brief
384       Return true if this Data is constant.       Return true if this Data is constant.
385    */    */
386      ESCRIPT_DLL_API
387    bool    bool
388    isConstant() const;    isConstant() const;
389    
# Line 336  class Data { Line 391  class Data {
391       \brief       \brief
392       Return true if this Data is empty.       Return true if this Data is empty.
393    */    */
394      ESCRIPT_DLL_API
395    bool    bool
396    isEmpty() const;    isEmpty() const;
397    
# Line 343  class Data { Line 399  class Data {
399       \brief       \brief
400       Return the function space.       Return the function space.
401    */    */
402      ESCRIPT_DLL_API
403    inline    inline
404    const FunctionSpace&    const FunctionSpace&
405    getFunctionSpace() const    getFunctionSpace() const
# Line 354  class Data { Line 411  class Data {
411       \brief       \brief
412       Return a copy of the function space.       Return a copy of the function space.
413    */    */
414      ESCRIPT_DLL_API
415    const FunctionSpace    const FunctionSpace
416    getCopyOfFunctionSpace() const;    getCopyOfFunctionSpace() const;
417    
# Line 361  class Data { Line 419  class Data {
419       \brief       \brief
420       Return the domain.       Return the domain.
421    */    */
422      ESCRIPT_DLL_API
423    inline    inline
424    const AbstractDomain&    const AbstractDomain&
425    getDomain() const    getDomain() const
# Line 372  class Data { Line 431  class Data {
431       \brief       \brief
432       Return a copy of the domain.       Return a copy of the domain.
433    */    */
434      ESCRIPT_DLL_API
435    const AbstractDomain    const AbstractDomain
436    getCopyOfDomain() const;    getCopyOfDomain() const;
437    
# Line 379  class Data { Line 439  class Data {
439       \brief       \brief
440       Return the rank of the point data.       Return the rank of the point data.
441    */    */
442      ESCRIPT_DLL_API
443    inline    inline
444    int    int
445    getDataPointRank() const    getDataPointRank() const
# Line 390  class Data { Line 451  class Data {
451       \brief       \brief
452       Return the number of samples.       Return the number of samples.
453    */    */
454      ESCRIPT_DLL_API
455    inline    inline
456    int    int
457    getNumSamples() const    getNumSamples() const
# Line 401  class Data { Line 463  class Data {
463       \brief       \brief
464       Return the number of data points per sample.       Return the number of data points per sample.
465    */    */
466      ESCRIPT_DLL_API
467    inline    inline
468    int    int
469    getNumDataPointsPerSample() const    getNumDataPointsPerSample() const
# Line 414  class Data { Line 477  class Data {
477       preferred interface but is provided for use by C code.       preferred interface but is provided for use by C code.
478       \param sampleNo - Input - the given sample no.       \param sampleNo - Input - the given sample no.
479    */    */
480      ESCRIPT_DLL_API
481    inline    inline
482    DataAbstract::ValueType::value_type*    DataAbstract::ValueType::value_type*
483    getSampleData(DataAbstract::ValueType::size_type sampleNo)    getSampleData(DataAbstract::ValueType::size_type sampleNo)
# Line 427  class Data { Line 491  class Data {
491       access data that isn't tagged an exception will be thrown.       access data that isn't tagged an exception will be thrown.
492       \param tag - Input - the tag key.       \param tag - Input - the tag key.
493    */    */
494      ESCRIPT_DLL_API
495    inline    inline
496    DataAbstract::ValueType::value_type*    DataAbstract::ValueType::value_type*
497    getSampleDataByTag(int tag)    getSampleDataByTag(int tag)
# Line 450  class Data { Line 515  class Data {
515       \param value - Input - value to assign to data-points associated with       \param value - Input - value to assign to data-points associated with
516                              the given reference number.                              the given reference number.
517    */    */
518      ESCRIPT_DLL_API
519    void    void
520    setRefValue(int ref,    setRefValue(int ref,
521                const boost::python::numeric::array& value);                const boost::python::numeric::array& value);
# Line 469  class Data { Line 535  class Data {
535       \param value - Output - object to receive values from data-points       \param value - Output - object to receive values from data-points
536                               associated with the given reference number.                               associated with the given reference number.
537    */    */
538      ESCRIPT_DLL_API
539    void    void
540    getRefValue(int ref,    getRefValue(int ref,
541                boost::python::numeric::array& value);                boost::python::numeric::array& value);
# Line 481  class Data { Line 548  class Data {
548       \param sampleNo - Input -       \param sampleNo - Input -
549       \param dataPointNo - Input -       \param dataPointNo - Input -
550    */    */
551      ESCRIPT_DLL_API
552    inline    inline
553    DataArrayView    DataArrayView
554    getDataPoint(int sampleNo,    getDataPoint(int sampleNo,
# Line 493  class Data { Line 561  class Data {
561       \brief       \brief
562       Return a reference to the data point shape.       Return a reference to the data point shape.
563    */    */
564      ESCRIPT_DLL_API
565    const DataArrayView::ShapeType&    const DataArrayView::ShapeType&
566    getDataPointShape() const;    getDataPointShape() const;
567    
# Line 500  class Data { Line 569  class Data {
569       \brief       \brief
570       Return the data point shape as a tuple of integers.       Return the data point shape as a tuple of integers.
571    */    */
572      ESCRIPT_DLL_API
573    const boost::python::tuple    const boost::python::tuple
574    getShapeTuple() const;    getShapeTuple() const;
575    
# Line 508  class Data { Line 578  class Data {
578       Return the size of the data point. It is the product of the       Return the size of the data point. It is the product of the
579       data point shape dimensions.       data point shape dimensions.
580    */    */
581      ESCRIPT_DLL_API
582    int    int
583    getDataPointSize() const;    getDataPointSize() const;
584    
# Line 515  class Data { Line 586  class Data {
586       \brief       \brief
587       Return the number of doubles stored for this Data.       Return the number of doubles stored for this Data.
588    */    */
589      ESCRIPT_DLL_API
590    DataArrayView::ValueType::size_type    DataArrayView::ValueType::size_type
591    getLength() const;    getLength() const;
592    
# Line 525  class Data { Line 597  class Data {
597       cannot be converted to a DataTagged object.       cannot be converted to a DataTagged object.
598       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer key.
599       \param value - Input - Value to associate with given key.       \param value - Input - Value to associate with given key.
600        ==>*
601    */    */
602      ESCRIPT_DLL_API
603    void    void
604    setTaggedValue(int tagKey,    setTaggedValue(int tagKey,
605                   const boost::python::object& value);                   const boost::python::object& value);
# Line 537  class Data { Line 611  class Data {
611       cannot be converted to a DataTagged object.       cannot be converted to a DataTagged object.
612       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer key.
613       \param value - Input - Value to associate with given key.       \param value - Input - Value to associate with given key.
614        ==>*
615    */    */
616      ESCRIPT_DLL_API
617    void    void
618    setTaggedValueFromCPP(int tagKey,    setTaggedValueFromCPP(int tagKey,
619                          const DataArrayView& value);                          const DataArrayView& value);
# Line 546  class Data { Line 622  class Data {
622      \brief      \brief
623      Copy other Data object into this Data object where mask is positive.      Copy other Data object into this Data object where mask is positive.
624    */    */
625      ESCRIPT_DLL_API
626    void    void
627    copyWithMask(const Data& other,    copyWithMask(const Data& other,
628                 const Data& mask);                 const Data& mask);
# Line 560  class Data { Line 637  class Data {
637       the result as a Data object.       the result as a Data object.
638       *       *
639    */    */
640      ESCRIPT_DLL_API
641    Data    Data
642    interpolate(const FunctionSpace& functionspace) const;    interpolate(const FunctionSpace& functionspace) const;
643    
# Line 569  class Data { Line 647  class Data {
647       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.
648       *       *
649    */    */
650      ESCRIPT_DLL_API
651    Data    Data
652    gradOn(const FunctionSpace& functionspace) const;    gradOn(const FunctionSpace& functionspace) const;
653    
654      ESCRIPT_DLL_API
655    Data    Data
656    grad() const;    grad() const;
657    
# Line 580  class Data { Line 660  class Data {
660       Calculate the integral over the function space domain.       Calculate the integral over the function space domain.
661       *       *
662    */    */
663      ESCRIPT_DLL_API
664    boost::python::numeric::array    boost::python::numeric::array
665    integrate() const;    integrate() const;
666    
# Line 588  class Data { Line 669  class Data {
669       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.
670       *       *
671    */    */
672      ESCRIPT_DLL_API
673    Data    Data
674    wherePositive() const;    wherePositive() const;
675    
# Line 596  class Data { Line 678  class Data {
678       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.
679       *       *
680    */    */
681      ESCRIPT_DLL_API
682    Data    Data
683    whereNegative() const;    whereNegative() const;
684    
# Line 604  class Data { Line 687  class Data {
687       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.
688       *       *
689    */    */
690      ESCRIPT_DLL_API
691    Data    Data
692    whereNonNegative() const;    whereNonNegative() const;
693    
# Line 612  class Data { Line 696  class Data {
696       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.
697       *       *
698    */    */
699      ESCRIPT_DLL_API
700    Data    Data
701    whereNonPositive() const;    whereNonPositive() const;
702    
# Line 620  class Data { Line 705  class Data {
705       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.
706       *       *
707    */    */
708      ESCRIPT_DLL_API
709    Data    Data
710    whereZero() const;    whereZero(double tol=0.0) const;
711    
712    /**    /**
713       \brief       \brief
714       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.
715       *       *
716    */    */
717      ESCRIPT_DLL_API
718    Data    Data
719    whereNonZero() const;    whereNonZero(double tol=0.0) const;
720    
721    /**    /**
722       \brief       \brief
723       Return the maximum absolute value of this Data object.       Return the maximum absolute value of this Data object.
724       *       *
725    */    */
726      ESCRIPT_DLL_API
727    double    double
728    Lsup() const;    Lsup() const;
729    
# Line 644  class Data { Line 732  class Data {
732       Return the minimum absolute value of this Data object.       Return the minimum absolute value of this Data object.
733       *       *
734    */    */
735      ESCRIPT_DLL_API
736    double    double
737    Linf() const;    Linf() const;
738    
# Line 652  class Data { Line 741  class Data {
741       Return the maximum value of this Data object.       Return the maximum value of this Data object.
742       *       *
743    */    */
744      ESCRIPT_DLL_API
745    double    double
746    sup() const;    sup() const;
747    
# Line 660  class Data { Line 750  class Data {
750       Return the minimum value of this Data object.       Return the minimum value of this Data object.
751       *       *
752    */    */
753      ESCRIPT_DLL_API
754    double    double
755    inf() const;    inf() const;
756    
# Line 668  class Data { Line 759  class Data {
759       Return the absolute value of each data point of this Data object.       Return the absolute value of each data point of this Data object.
760       *       *
761    */    */
762      ESCRIPT_DLL_API
763    Data    Data
764    abs() const;    abs() const;
765    
# Line 676  class Data { Line 768  class Data {
768       Return the maximum value of each data point of this Data object.       Return the maximum value of each data point of this Data object.
769       *       *
770    */    */
771      ESCRIPT_DLL_API
772    Data    Data
773    maxval() const;    maxval() const;
774    
# Line 684  class Data { Line 777  class Data {
777       Return the minimum value of each data point of this Data object.       Return the minimum value of each data point of this Data object.
778       *       *
779    */    */
780      ESCRIPT_DLL_API
781    Data    Data
782    minval() const;    minval() const;
783    
# Line 692  class Data { Line 786  class Data {
786       Return the (sample number, data-point number) of the data point with       Return the (sample number, data-point number) of the data point with
787       the minimum value in this Data object.       the minimum value in this Data object.
788    */    */
789      ESCRIPT_DLL_API
790    const boost::python::tuple    const boost::python::tuple
791    mindp() const;    mindp() const;
792    
793      ESCRIPT_DLL_API
794    void    void
795    #ifndef PASO_MPI
796    calc_mindp(int& SampleNo,    calc_mindp(int& SampleNo,
797               int& DataPointNo) const;               int& DataPointNo) const;
798    #else
799      calc_mindp(int& ProcNo,
800                            int& SampleNo,  
801                 int& DataPointNo) const;
802    #endif
803    /**    /**
804       \brief       \brief
805       Return the sign of each data point of this Data object.       Return the sign of each data point of this Data object.
806       -1 for negative values, zero for zero values, 1 for positive values.       -1 for negative values, zero for zero values, 1 for positive values.
807       *       *
808    */    */
809      ESCRIPT_DLL_API
810    Data    Data
811    sign() const;    sign() const;
812    
813    /**    /**
814       \brief       \brief
815         Return the symmetric part of a matrix which is half the matrix plus its transpose.
816         *
817      */
818      ESCRIPT_DLL_API
819      Data
820      symmetric() const;
821    
822      /**
823         \brief
824         Return the nonsymmetric part of a matrix which is half the matrix minus its transpose.
825         *
826      */
827      ESCRIPT_DLL_API
828      Data
829      nonsymmetric() const;
830    
831      /**
832         \brief
833         Return the trace of a matrix
834         *
835      */
836      ESCRIPT_DLL_API
837      Data
838      matrixtrace(int axis_offset) const;
839    
840      /**
841         \brief
842       Transpose each data point of this Data object around the given axis.       Transpose each data point of this Data object around the given axis.
      --* not implemented yet *--  
843       *       *
844    */    */
845      ESCRIPT_DLL_API
846    Data    Data
847    transpose(int axis) const;    transpose(int axis_offset) const;
848    
849      /**
850         \brief
851         Return the eigenvalues of the symmetric part at each data point of this Data object in increasing values.
852         Currently this function is restricted to rank 2, square shape, and dimension 3.
853         *
854      */
855      ESCRIPT_DLL_API
856      Data
857      eigenvalues() const;
858    
859      /**
860         \brief
861         Return the eigenvalues and corresponding eigenvcetors of the symmetric part at each data point of this Data object.
862         the eigenvalues are ordered in increasing size where eigenvalues with relative difference less than
863         tol are treated as equal. The eigenvectors are orthogonal, normalized and the sclaed such that the
864         first non-zero entry is positive.
865         Currently this function is restricted to rank 2, square shape, and dimension 3
866         *
867      */
868      ESCRIPT_DLL_API
869      const boost::python::tuple
870      eigenvalues_and_eigenvectors(const double tol=1.e-12) const;
871    
872    /**    /**
873       \brief       \brief
874       Calculate the trace of each data point of this Data object.       Calculate the trace of each data point of this Data object.
      sum(A[i,i,i,i])  
875       *       *
876    */    */
877      ESCRIPT_DLL_API
878    Data    Data
879    trace() const;    trace() const;
880    
# Line 731  class Data { Line 883  class Data {
883       Return the sin of each data point of this Data object.       Return the sin of each data point of this Data object.
884       *       *
885    */    */
886      ESCRIPT_DLL_API
887    Data    Data
888    sin() const;    sin() const;
889    
# Line 739  class Data { Line 892  class Data {
892       Return the cos of each data point of this Data object.       Return the cos of each data point of this Data object.
893       *       *
894    */    */
895      ESCRIPT_DLL_API
896    Data    Data
897    cos() const;    cos() const;
898    
# Line 747  class Data { Line 901  class Data {
901       Return the tan of each data point of this Data object.       Return the tan of each data point of this Data object.
902       *       *
903    */    */
904      ESCRIPT_DLL_API
905    Data    Data
906    tan() const;    tan() const;
907    
# Line 755  class Data { Line 910  class Data {
910       Return the asin of each data point of this Data object.       Return the asin of each data point of this Data object.
911       *       *
912    */    */
913      ESCRIPT_DLL_API
914    Data    Data
915    asin() const;    asin() const;
916    
# Line 763  class Data { Line 919  class Data {
919       Return the acos of each data point of this Data object.       Return the acos of each data point of this Data object.
920       *       *
921    */    */
922      ESCRIPT_DLL_API
923    Data    Data
924    acos() const;    acos() const;
925    
# Line 771  class Data { Line 928  class Data {
928       Return the atan of each data point of this Data object.       Return the atan of each data point of this Data object.
929       *       *
930    */    */
931      ESCRIPT_DLL_API
932    Data    Data
933    atan() const;    atan() const;
934    
# Line 779  class Data { Line 937  class Data {
937       Return the sinh of each data point of this Data object.       Return the sinh of each data point of this Data object.
938       *       *
939    */    */
940      ESCRIPT_DLL_API
941    Data    Data
942    sinh() const;    sinh() const;
943    
# Line 787  class Data { Line 946  class Data {
946       Return the cosh of each data point of this Data object.       Return the cosh of each data point of this Data object.
947       *       *
948    */    */
949      ESCRIPT_DLL_API
950    Data    Data
951    cosh() const;    cosh() const;
952    
# Line 795  class Data { Line 955  class Data {
955       Return the tanh of each data point of this Data object.       Return the tanh of each data point of this Data object.
956       *       *
957    */    */
958      ESCRIPT_DLL_API
959    Data    Data
960    tanh() const;    tanh() const;
961    
# Line 803  class Data { Line 964  class Data {
964       Return the asinh of each data point of this Data object.       Return the asinh of each data point of this Data object.
965       *       *
966    */    */
967      ESCRIPT_DLL_API
968    Data    Data
969    asinh() const;    asinh() const;
970    
# Line 811  class Data { Line 973  class Data {
973       Return the acosh of each data point of this Data object.       Return the acosh of each data point of this Data object.
974       *       *
975    */    */
976      ESCRIPT_DLL_API
977    Data    Data
978    acosh() const;    acosh() const;
979    
# Line 819  class Data { Line 982  class Data {
982       Return the atanh of each data point of this Data object.       Return the atanh of each data point of this Data object.
983       *       *
984    */    */
985      ESCRIPT_DLL_API
986    Data    Data
987    atanh() const;    atanh() const;
988    
# Line 827  class Data { Line 991  class Data {
991       Return the log to base 10 of each data point of this Data object.       Return the log to base 10 of each data point of this Data object.
992       *       *
993    */    */
994      ESCRIPT_DLL_API
995    Data    Data
996    log10() const;    log10() const;
997    
# Line 835  class Data { Line 1000  class Data {
1000       Return the natural log of each data point of this Data object.       Return the natural log of each data point of this Data object.
1001       *       *
1002    */    */
1003      ESCRIPT_DLL_API
1004    Data    Data
1005    log() const;    log() const;
1006    
# Line 843  class Data { Line 1009  class Data {
1009       Return the exponential function of each data point of this Data object.       Return the exponential function of each data point of this Data object.
1010       *       *
1011    */    */
1012      ESCRIPT_DLL_API
1013    Data    Data
1014    exp() const;    exp() const;
1015    
# Line 851  class Data { Line 1018  class Data {
1018       Return the square root of each data point of this Data object.       Return the square root of each data point of this Data object.
1019       *       *
1020    */    */
1021      ESCRIPT_DLL_API
1022    Data    Data
1023    sqrt() const;    sqrt() const;
1024    
# Line 859  class Data { Line 1027  class Data {
1027       Return the negation of each data point of this Data object.       Return the negation of each data point of this Data object.
1028       *       *
1029    */    */
1030      ESCRIPT_DLL_API
1031    Data    Data
1032    neg() const;    neg() const;
1033    
# Line 868  class Data { Line 1037  class Data {
1037       Simply returns this object unmodified.       Simply returns this object unmodified.
1038       *       *
1039    */    */
1040      ESCRIPT_DLL_API
1041    Data    Data
1042    pos() const;    pos() const;
1043    
# Line 878  class Data { Line 1048  class Data {
1048       \param right Input - the power to raise the object to.       \param right Input - the power to raise the object to.
1049       *       *
1050    */    */
1051      ESCRIPT_DLL_API
1052    Data    Data
1053    powD(const Data& right) const;    powD(const Data& right) const;
1054    
# Line 888  class Data { Line 1059  class Data {
1059       \param right Input - the power to raise the object to.       \param right Input - the power to raise the object to.
1060       *       *
1061     */     */
1062      ESCRIPT_DLL_API
1063    Data    Data
1064    powO(const boost::python::object& right) const;    powO(const boost::python::object& right) const;
1065    
1066    /**    /**
1067       \brief       \brief
1068         Return the given power of each data point of this boost python object.
1069        
1070         \param left Input - the bases
1071         *
1072       */
1073    
1074      ESCRIPT_DLL_API
1075      Data
1076      rpowO(const boost::python::object& left) const;
1077    
1078      /**
1079         \brief
1080       writes the object to a file in the DX file format       writes the object to a file in the DX file format
1081    */    */
1082      ESCRIPT_DLL_API
1083    void    void
1084    saveDX(std::string fileName) const;    saveDX(std::string fileName) const;
1085    
# Line 902  class Data { Line 1087  class Data {
1087       \brief       \brief
1088       writes the object to a file in the VTK file format       writes the object to a file in the VTK file format
1089    */    */
1090      ESCRIPT_DLL_API
1091    void    void
1092    saveVTK(std::string fileName) const;    saveVTK(std::string fileName) const;
1093    
# Line 911  class Data { Line 1097  class Data {
1097       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1098       *       *
1099    */    */
1100      ESCRIPT_DLL_API
1101    Data& operator+=(const Data& right);    Data& operator+=(const Data& right);
1102      ESCRIPT_DLL_API
1103    Data& operator+=(const boost::python::object& right);    Data& operator+=(const boost::python::object& right);
1104    
1105    /**    /**
# Line 920  class Data { Line 1108  class Data {
1108       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1109       *       *
1110    */    */
1111      ESCRIPT_DLL_API
1112    Data& operator-=(const Data& right);    Data& operator-=(const Data& right);
1113      ESCRIPT_DLL_API
1114    Data& operator-=(const boost::python::object& right);    Data& operator-=(const boost::python::object& right);
1115    
1116   /**   /**
# Line 929  class Data { Line 1119  class Data {
1119       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1120       *       *
1121    */    */
1122      ESCRIPT_DLL_API
1123    Data& operator*=(const Data& right);    Data& operator*=(const Data& right);
1124      ESCRIPT_DLL_API
1125    Data& operator*=(const boost::python::object& right);    Data& operator*=(const boost::python::object& right);
1126    
1127   /**   /**
# Line 938  class Data { Line 1130  class Data {
1130       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1131       *       *
1132    */    */
1133      ESCRIPT_DLL_API
1134    Data& operator/=(const Data& right);    Data& operator/=(const Data& right);
1135      ESCRIPT_DLL_API
1136    Data& operator/=(const boost::python::object& right);    Data& operator/=(const boost::python::object& right);
1137    
1138    /**    /**
1139       \brief       \brief
1140       Returns true if this can be interpolated to functionspace.       Returns true if this can be interpolated to functionspace.
1141    */    */
1142      ESCRIPT_DLL_API
1143    bool    bool
1144    probeInterpolation(const FunctionSpace& functionspace) const;    probeInterpolation(const FunctionSpace& functionspace) const;
1145    
# Line 963  class Data { Line 1158  class Data {
1158       \param key - Input - python slice tuple specifying       \param key - Input - python slice tuple specifying
1159       slice to return.       slice to return.
1160    */    */
1161      ESCRIPT_DLL_API
1162    Data    Data
1163    getItem(const boost::python::object& key) const;    getItem(const boost::python::object& key) const;
1164    
# Line 977  class Data { Line 1173  class Data {
1173       slice to copy from value.       slice to copy from value.
1174       \param value - Input - Data object to copy from.       \param value - Input - Data object to copy from.
1175    */    */
1176      ESCRIPT_DLL_API
1177    void    void
1178    setItemD(const boost::python::object& key,    setItemD(const boost::python::object& key,
1179             const Data& value);             const Data& value);
1180    
1181      ESCRIPT_DLL_API
1182    void    void
1183    setItemO(const boost::python::object& key,    setItemO(const boost::python::object& key,
1184             const boost::python::object& value);             const boost::python::object& value);
# Line 993  class Data { Line 1191  class Data {
1191       this Data object.       this Data object.
1192    */    */
1193    template <class UnaryFunction>    template <class UnaryFunction>
1194      ESCRIPT_DLL_API
1195    inline    inline
1196    void    void
1197    unaryOp(UnaryFunction operation);    unaryOp(UnaryFunction operation);
# Line 1004  class Data { Line 1203  class Data {
1203       \param region - Input - Region to copy.       \param region - Input - Region to copy.
1204       *       *
1205    */    */
1206      ESCRIPT_DLL_API
1207    Data    Data
1208    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataArrayView::RegionType& region) const;
1209    
# Line 1015  class Data { Line 1215  class Data {
1215       \param region - Input - Region to copy.       \param region - Input - Region to copy.
1216       *       *
1217    */    */
1218      ESCRIPT_DLL_API
1219    void    void
1220    setSlice(const Data& value,    setSlice(const Data& value,
1221             const DataArrayView::RegionType& region);             const DataArrayView::RegionType& region);
# Line 1024  class Data { Line 1225  class Data {
1225       Archive the current Data object to the given file.       Archive the current Data object to the given file.
1226       \param fileName - Input - file to archive to.       \param fileName - Input - file to archive to.
1227    */    */
1228      ESCRIPT_DLL_API
1229    void    void
1230    archiveData(const std::string fileName);    archiveData(const std::string fileName);
1231    
# Line 1035  class Data { Line 1237  class Data {
1237       \param fileName - Input - file to extract from.       \param fileName - Input - file to extract from.
1238       \param fspace - Input - a suitable FunctionSpace descibing the data.       \param fspace - Input - a suitable FunctionSpace descibing the data.
1239    */    */
1240      ESCRIPT_DLL_API
1241    void    void
1242    extractData(const std::string fileName,    extractData(const std::string fileName,
1243                const FunctionSpace& fspace);                const FunctionSpace& fspace);
1244    
1245    
1246    #ifdef PASO_MPI
1247      /**
1248         \brief
1249         print the data values to stdout. Used for debugging
1250      */
1251      ESCRIPT_DLL_API
1252      void
1253        print(void);
1254    
1255      /**
1256         \brief
1257         return the MPI rank number of the local data
1258             MPI_COMM_WORLD is assumed and the result of MPI_Comm_size()
1259             is returned
1260      */
1261      ESCRIPT_DLL_API
1262        int
1263        get_MPIRank(void) const;
1264    
1265      /**
1266         \brief
1267         return the MPI rank number of the local data
1268             MPI_COMM_WORLD is assumed and the result of MPI_Comm_rank()
1269             is returned
1270      */
1271      ESCRIPT_DLL_API
1272        int
1273        get_MPISize(void) const;
1274    
1275      /**
1276         \brief
1277         return the MPI rank number of the local data
1278             MPI_COMM_WORLD is assumed and returned.
1279      */
1280      ESCRIPT_DLL_API
1281        MPI_Comm
1282        get_MPIComm(void) const;
1283    #endif
1284        
1285   protected:   protected:
1286    
1287   private:   private:
# Line 1142  class Data { Line 1385  class Data {
1385    reshapeDataPoint(const DataArrayView::ShapeType& shape);    reshapeDataPoint(const DataArrayView::ShapeType& shape);
1386    
1387    //    //
1388      // flag to protect the data object against any update
1389      bool m_protected;
1390    
1391      //
1392    // pointer to the actual data object    // pointer to the actual data object
1393    boost::shared_ptr<DataAbstract> m_data;    boost::shared_ptr<DataAbstract> m_data;
1394    
# Line 1182  Data::initialise(const IValueType& value Line 1429  Data::initialise(const IValueType& value
1429    Operator+    Operator+
1430    Takes two Data objects.    Takes two Data objects.
1431  */  */
1432  Data operator+(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator+(const Data& left, const Data& right);
1433    
1434  /**  /**
1435    \brief    \brief
1436    Operator-    Operator-
1437    Takes two Data objects.    Takes two Data objects.
1438  */  */
1439  Data operator-(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator-(const Data& left, const Data& right);
1440    
1441  /**  /**
1442    \brief    \brief
1443    Operator*    Operator*
1444    Takes two Data objects.    Takes two Data objects.
1445  */  */
1446  Data operator*(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator*(const Data& left, const Data& right);
1447    
1448  /**  /**
1449    \brief    \brief
1450    Operator/    Operator/
1451    Takes two Data objects.    Takes two Data objects.
1452  */  */
1453  Data operator/(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator/(const Data& left, const Data& right);
1454    
1455  /**  /**
1456    \brief    \brief
# Line 1211  Data operator/(const Data& left, const D Line 1458  Data operator/(const Data& left, const D
1458    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1459    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1460  */  */
1461  Data operator+(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator+(const Data& left, const boost::python::object& right);
1462    
1463  /**  /**
1464    \brief    \brief
# Line 1219  Data operator+(const Data& left, const b Line 1466  Data operator+(const Data& left, const b
1466    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1467    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1468  */  */
1469  Data operator-(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator-(const Data& left, const boost::python::object& right);
1470    
1471  /**  /**
1472    \brief    \brief
# Line 1227  Data operator-(const Data& left, const b Line 1474  Data operator-(const Data& left, const b
1474    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1475    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1476  */  */
1477  Data operator*(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator*(const Data& left, const boost::python::object& right);
1478    
1479  /**  /**
1480    \brief    \brief
# Line 1235  Data operator*(const Data& left, const b Line 1482  Data operator*(const Data& left, const b
1482    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1483    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1484  */  */
1485  Data operator/(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator/(const Data& left, const boost::python::object& right);
1486    
1487  /**  /**
1488    \brief    \brief
# Line 1243  Data operator/(const Data& left, const b Line 1490  Data operator/(const Data& left, const b
1490    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1491    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1492  */  */
1493  Data operator+(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator+(const boost::python::object& left, const Data& right);
1494    
1495  /**  /**
1496    \brief    \brief
# Line 1251  Data operator+(const boost::python::obje Line 1498  Data operator+(const boost::python::obje
1498    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1499    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1500  */  */
1501  Data operator-(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator-(const boost::python::object& left, const Data& right);
1502    
1503  /**  /**
1504    \brief    \brief
# Line 1259  Data operator-(const boost::python::obje Line 1506  Data operator-(const boost::python::obje
1506    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1507    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1508  */  */
1509  Data operator*(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator*(const boost::python::object& left, const Data& right);
1510    
1511  /**  /**
1512    \brief    \brief
# Line 1267  Data operator*(const boost::python::obje Line 1514  Data operator*(const boost::python::obje
1514    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1515    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1516  */  */
1517  Data operator/(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator/(const boost::python::object& left, const Data& right);
1518    
1519  /**  /**
1520    \brief    \brief
1521    Output operator    Output operator
1522  */  */
1523  std::ostream& operator<<(std::ostream& o, const Data& data);  ESCRIPT_DLL_API std::ostream& operator<<(std::ostream& o, const Data& data);
1524    
1525  /**  /**
1526    \brief    \brief
# Line 1281  std::ostream& operator<<(std::ostream& o Line 1528  std::ostream& operator<<(std::ostream& o
1528    NB: this operator does very little at this point, and isn't to    NB: this operator does very little at this point, and isn't to
1529    be relied on. Requires further implementation.    be relied on. Requires further implementation.
1530  */  */
1531  //bool operator==(const Data& left, const Data& right);  //ESCRIPT_DLL_API bool operator==(const Data& left, const Data& right);
1532    
1533  /**  /**
1534    \brief    \brief
# Line 1478  inline Line 1725  inline
1725  Data  Data
1726  Data::dp_algorithm(BinaryFunction operation, double initial_value) const  Data::dp_algorithm(BinaryFunction operation, double initial_value) const
1727  {  {
   Data result(0,DataArrayView::ShapeType(),getFunctionSpace(),isExpanded());  
1728    if (isExpanded()) {    if (isExpanded()) {
1729        Data result(0,DataArrayView::ShapeType(),getFunctionSpace(),isExpanded());
1730      DataExpanded* dataE=dynamic_cast<DataExpanded*>(m_data.get());      DataExpanded* dataE=dynamic_cast<DataExpanded*>(m_data.get());
1731      DataExpanded* resultE=dynamic_cast<DataExpanded*>(result.m_data.get());      DataExpanded* resultE=dynamic_cast<DataExpanded*>(result.m_data.get());
1732      EsysAssert((dataE!=0), "Programming error - casting data to DataExpanded.");      EsysAssert((dataE!=0), "Programming error - casting data to DataExpanded.");
1733      EsysAssert((resultE!=0), "Programming error - casting result to DataExpanded.");      EsysAssert((resultE!=0), "Programming error - casting result to DataExpanded.");
1734      escript::dp_algorithm(*dataE,*resultE,operation,initial_value);      escript::dp_algorithm(*dataE,*resultE,operation,initial_value);
1735        return result;
1736    } else if (isTagged()) {    } else if (isTagged()) {
1737      DataTagged* dataT=dynamic_cast<DataTagged*>(m_data.get());      DataTagged* dataT=dynamic_cast<DataTagged*>(m_data.get());
1738        DataArrayView::ShapeType viewShape;
1739        DataArrayView::ValueType viewData(1);
1740        viewData[0]=0;
1741        DataArrayView defaultValue(viewData,viewShape);
1742        DataTagged::TagListType keys;
1743        DataTagged::ValueListType values;
1744        DataTagged::DataMapType::const_iterator i;
1745        for (i=dataT->getTagLookup().begin();i!=dataT->getTagLookup().end();i++) {
1746          keys.push_back(i->first);
1747          values.push_back(defaultValue);
1748        }
1749        Data result(keys,values,defaultValue,getFunctionSpace());
1750      DataTagged* resultT=dynamic_cast<DataTagged*>(result.m_data.get());      DataTagged* resultT=dynamic_cast<DataTagged*>(result.m_data.get());
1751      EsysAssert((dataT!=0), "Programming error - casting data to DataTagged.");      EsysAssert((dataT!=0), "Programming error - casting data to DataTagged.");
1752      EsysAssert((resultT!=0), "Programming error - casting result to DataTagged.");      EsysAssert((resultT!=0), "Programming error - casting result to DataTagged.");
1753      escript::dp_algorithm(*dataT,*resultT,operation,initial_value);      escript::dp_algorithm(*dataT,*resultT,operation,initial_value);
1754        return result;
1755    } else if (isConstant()) {    } else if (isConstant()) {
1756        Data result(0,DataArrayView::ShapeType(),getFunctionSpace(),isExpanded());
1757      DataConstant* dataC=dynamic_cast<DataConstant*>(m_data.get());      DataConstant* dataC=dynamic_cast<DataConstant*>(m_data.get());
1758      DataConstant* resultC=dynamic_cast<DataConstant*>(result.m_data.get());      DataConstant* resultC=dynamic_cast<DataConstant*>(result.m_data.get());
1759      EsysAssert((dataC!=0), "Programming error - casting data to DataConstant.");      EsysAssert((dataC!=0), "Programming error - casting data to DataConstant.");
1760      EsysAssert((resultC!=0), "Programming error - casting result to DataConstant.");      EsysAssert((resultC!=0), "Programming error - casting result to DataConstant.");
1761      escript::dp_algorithm(*dataC,*resultC,operation,initial_value);      escript::dp_algorithm(*dataC,*resultC,operation,initial_value);
1762        return result;
1763    }    }
1764    return result;    Data falseRetVal; // to keep compiler quiet
1765      return falseRetVal;
1766  }  }
1767    
1768  }  }

Legend:
Removed from v.480  
changed lines
  Added in v.789

  ViewVC Help
Powered by ViewVC 1.1.26