/[escript]/branches/schroedinger/escript/src/Data.h
ViewVC logotype

Diff of /branches/schroedinger/escript/src/Data.h

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

revision 698 by gross, Fri Mar 31 04:52:55 2006 UTC revision 775 by ksteube, Mon Jul 10 04:00:08 2006 UTC
# Line 15  Line 15 
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 25  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 73  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 80  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 88  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 101  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 116  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 128  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 153  class Data {
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 161  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 176  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 189  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 196  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 204  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 221  class Data { Line 236  class Data {
236       \brief       \brief
237       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.
238    */    */
239      ESCRIPT_DLL_API
240    const boost::python::numeric::array    const boost::python::numeric::array
241    convertToNumArray();    convertToNumArray();
242    
# Line 228  class Data { Line 244  class Data {
244       \brief       \brief
245       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.
246    */    */
247      ESCRIPT_DLL_API
248    const boost::python::numeric::array    const boost::python::numeric::array
249    convertToNumArrayFromSampleNo(int sampleNo);    convertToNumArrayFromSampleNo(int sampleNo);
250    
# Line 235  class Data { Line 252  class Data {
252       \brief       \brief
253       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.
254    */    */
255      ESCRIPT_DLL_API
256    const boost::python::numeric::array    const boost::python::numeric::array
257    convertToNumArrayFromDPNo(int sampleNo,    convertToNumArrayFromDPNo(int sampleNo,
258                              int dataPointNo);                              int dataPointNo);
# Line 243  class Data { Line 261  class Data {
261       \brief       \brief
262       Fills the expanded Data object from values of a python numarray object.       Fills the expanded Data object from values of a python numarray object.
263    */    */
264      ESCRIPT_DLL_API
265    void    void
266    fillFromNumArray(const boost::python::numeric::array);    fillFromNumArray(const boost::python::numeric::array);
267    
# Line 253  class Data { Line 272  class Data {
272       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
273       numarray returned by convertToNumArray.       numarray returned by convertToNumArray.
274    */    */
275      ESCRIPT_DLL_API
276    int    int
277    getTagNumber(int dpno);    getTagNumber(int dpno);
278    
# Line 260  class Data { Line 280  class Data {
280       \brief       \brief
281       Return the C wrapper for the Data object.       Return the C wrapper for the Data object.
282    */    */
283      ESCRIPT_DLL_API
284    escriptDataC    escriptDataC
285    getDataC();    getDataC();
286    
# Line 267  class Data { Line 288  class Data {
288       \brief       \brief
289       Return the C wrapper for the Data object - const version.       Return the C wrapper for the Data object - const version.
290    */    */
291      ESCRIPT_DLL_API
292    escriptDataC    escriptDataC
293    getDataC() const;    getDataC() const;
294    
# Line 274  class Data { Line 296  class Data {
296       \brief       \brief
297       Write the data as a string.       Write the data as a string.
298    */    */
299      ESCRIPT_DLL_API
300    inline    inline
301    std::string    std::string
302    toString() const    toString() const
# Line 287  class Data { Line 310  class Data {
310       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
311       to manipulate the point data.       to manipulate the point data.
312    */    */
313      ESCRIPT_DLL_API
314    inline    inline
315    const DataArrayView&    const DataArrayView&
316    getPointDataView() const    getPointDataView() const
# Line 298  class Data { Line 322  class Data {
322       \brief       \brief
323       Whatever the current Data type make this into a DataExpanded.       Whatever the current Data type make this into a DataExpanded.
324    */    */
325      ESCRIPT_DLL_API
326    void    void
327    expand();    expand();
328    
# Line 308  class Data { Line 333  class Data {
333       Expanded data to tagged will throw an exception.       Expanded data to tagged will throw an exception.
334      ==>*      ==>*
335    */    */
336      ESCRIPT_DLL_API
337    void    void
338    tag();    tag();
339    
# Line 315  class Data { Line 341  class Data {
341       \brief       \brief
342       Return true if this Data is expanded.       Return true if this Data is expanded.
343    */    */
344      ESCRIPT_DLL_API
345    bool    bool
346    isExpanded() const;    isExpanded() const;
347    
# Line 322  class Data { Line 349  class Data {
349       \brief       \brief
350       Return true if this Data is tagged.       Return true if this Data is tagged.
351    */    */
352      ESCRIPT_DLL_API
353    bool    bool
354    isTagged() const;    isTagged() const;
355    
# Line 329  class Data { Line 357  class Data {
357       \brief       \brief
358       Return true if this Data is constant.       Return true if this Data is constant.
359    */    */
360      ESCRIPT_DLL_API
361    bool    bool
362    isConstant() const;    isConstant() const;
363    
# Line 336  class Data { Line 365  class Data {
365       \brief       \brief
366       Return true if this Data is empty.       Return true if this Data is empty.
367    */    */
368      ESCRIPT_DLL_API
369    bool    bool
370    isEmpty() const;    isEmpty() const;
371    
# Line 343  class Data { Line 373  class Data {
373       \brief       \brief
374       Return the function space.       Return the function space.
375    */    */
376      ESCRIPT_DLL_API
377    inline    inline
378    const FunctionSpace&    const FunctionSpace&
379    getFunctionSpace() const    getFunctionSpace() const
# Line 354  class Data { Line 385  class Data {
385       \brief       \brief
386       Return a copy of the function space.       Return a copy of the function space.
387    */    */
388      ESCRIPT_DLL_API
389    const FunctionSpace    const FunctionSpace
390    getCopyOfFunctionSpace() const;    getCopyOfFunctionSpace() const;
391    
# Line 361  class Data { Line 393  class Data {
393       \brief       \brief
394       Return the domain.       Return the domain.
395    */    */
396      ESCRIPT_DLL_API
397    inline    inline
398    const AbstractDomain&    const AbstractDomain&
399    getDomain() const    getDomain() const
# Line 372  class Data { Line 405  class Data {
405       \brief       \brief
406       Return a copy of the domain.       Return a copy of the domain.
407    */    */
408      ESCRIPT_DLL_API
409    const AbstractDomain    const AbstractDomain
410    getCopyOfDomain() const;    getCopyOfDomain() const;
411    
# Line 379  class Data { Line 413  class Data {
413       \brief       \brief
414       Return the rank of the point data.       Return the rank of the point data.
415    */    */
416      ESCRIPT_DLL_API
417    inline    inline
418    int    int
419    getDataPointRank() const    getDataPointRank() const
# Line 390  class Data { Line 425  class Data {
425       \brief       \brief
426       Return the number of samples.       Return the number of samples.
427    */    */
428      ESCRIPT_DLL_API
429    inline    inline
430    int    int
431    getNumSamples() const    getNumSamples() const
# Line 401  class Data { Line 437  class Data {
437       \brief       \brief
438       Return the number of data points per sample.       Return the number of data points per sample.
439    */    */
440      ESCRIPT_DLL_API
441    inline    inline
442    int    int
443    getNumDataPointsPerSample() const    getNumDataPointsPerSample() const
# Line 414  class Data { Line 451  class Data {
451       preferred interface but is provided for use by C code.       preferred interface but is provided for use by C code.
452       \param sampleNo - Input - the given sample no.       \param sampleNo - Input - the given sample no.
453    */    */
454      ESCRIPT_DLL_API
455    inline    inline
456    DataAbstract::ValueType::value_type*    DataAbstract::ValueType::value_type*
457    getSampleData(DataAbstract::ValueType::size_type sampleNo)    getSampleData(DataAbstract::ValueType::size_type sampleNo)
# Line 427  class Data { Line 465  class Data {
465       access data that isn't tagged an exception will be thrown.       access data that isn't tagged an exception will be thrown.
466       \param tag - Input - the tag key.       \param tag - Input - the tag key.
467    */    */
468      ESCRIPT_DLL_API
469    inline    inline
470    DataAbstract::ValueType::value_type*    DataAbstract::ValueType::value_type*
471    getSampleDataByTag(int tag)    getSampleDataByTag(int tag)
# Line 450  class Data { Line 489  class Data {
489       \param value - Input - value to assign to data-points associated with       \param value - Input - value to assign to data-points associated with
490                              the given reference number.                              the given reference number.
491    */    */
492      ESCRIPT_DLL_API
493    void    void
494    setRefValue(int ref,    setRefValue(int ref,
495                const boost::python::numeric::array& value);                const boost::python::numeric::array& value);
# Line 469  class Data { Line 509  class Data {
509       \param value - Output - object to receive values from data-points       \param value - Output - object to receive values from data-points
510                               associated with the given reference number.                               associated with the given reference number.
511    */    */
512      ESCRIPT_DLL_API
513    void    void
514    getRefValue(int ref,    getRefValue(int ref,
515                boost::python::numeric::array& value);                boost::python::numeric::array& value);
# Line 481  class Data { Line 522  class Data {
522       \param sampleNo - Input -       \param sampleNo - Input -
523       \param dataPointNo - Input -       \param dataPointNo - Input -
524    */    */
525      ESCRIPT_DLL_API
526    inline    inline
527    DataArrayView    DataArrayView
528    getDataPoint(int sampleNo,    getDataPoint(int sampleNo,
# Line 493  class Data { Line 535  class Data {
535       \brief       \brief
536       Return a reference to the data point shape.       Return a reference to the data point shape.
537    */    */
538      ESCRIPT_DLL_API
539    const DataArrayView::ShapeType&    const DataArrayView::ShapeType&
540    getDataPointShape() const;    getDataPointShape() const;
541    
# Line 500  class Data { Line 543  class Data {
543       \brief       \brief
544       Return the data point shape as a tuple of integers.       Return the data point shape as a tuple of integers.
545    */    */
546      ESCRIPT_DLL_API
547    const boost::python::tuple    const boost::python::tuple
548    getShapeTuple() const;    getShapeTuple() const;
549    
# Line 508  class Data { Line 552  class Data {
552       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
553       data point shape dimensions.       data point shape dimensions.
554    */    */
555      ESCRIPT_DLL_API
556    int    int
557    getDataPointSize() const;    getDataPointSize() const;
558    
# Line 515  class Data { Line 560  class Data {
560       \brief       \brief
561       Return the number of doubles stored for this Data.       Return the number of doubles stored for this Data.
562    */    */
563      ESCRIPT_DLL_API
564    DataArrayView::ValueType::size_type    DataArrayView::ValueType::size_type
565    getLength() const;    getLength() const;
566    
# Line 527  class Data { Line 573  class Data {
573       \param value - Input - Value to associate with given key.       \param value - Input - Value to associate with given key.
574      ==>*      ==>*
575    */    */
576      ESCRIPT_DLL_API
577    void    void
578    setTaggedValue(int tagKey,    setTaggedValue(int tagKey,
579                   const boost::python::object& value);                   const boost::python::object& value);
# Line 540  class Data { Line 587  class Data {
587       \param value - Input - Value to associate with given key.       \param value - Input - Value to associate with given key.
588      ==>*      ==>*
589    */    */
590      ESCRIPT_DLL_API
591    void    void
592    setTaggedValueFromCPP(int tagKey,    setTaggedValueFromCPP(int tagKey,
593                          const DataArrayView& value);                          const DataArrayView& value);
# Line 548  class Data { Line 596  class Data {
596      \brief      \brief
597      Copy other Data object into this Data object where mask is positive.      Copy other Data object into this Data object where mask is positive.
598    */    */
599      ESCRIPT_DLL_API
600    void    void
601    copyWithMask(const Data& other,    copyWithMask(const Data& other,
602                 const Data& mask);                 const Data& mask);
# Line 562  class Data { Line 611  class Data {
611       the result as a Data object.       the result as a Data object.
612       *       *
613    */    */
614      ESCRIPT_DLL_API
615    Data    Data
616    interpolate(const FunctionSpace& functionspace) const;    interpolate(const FunctionSpace& functionspace) const;
617    
# Line 571  class Data { Line 621  class Data {
621       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.
622       *       *
623    */    */
624      ESCRIPT_DLL_API
625    Data    Data
626    gradOn(const FunctionSpace& functionspace) const;    gradOn(const FunctionSpace& functionspace) const;
627    
628      ESCRIPT_DLL_API
629    Data    Data
630    grad() const;    grad() const;
631    
# Line 582  class Data { Line 634  class Data {
634       Calculate the integral over the function space domain.       Calculate the integral over the function space domain.
635       *       *
636    */    */
637      ESCRIPT_DLL_API
638    boost::python::numeric::array    boost::python::numeric::array
639    integrate() const;    integrate() const;
640    
# Line 590  class Data { Line 643  class Data {
643       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.
644       *       *
645    */    */
646      ESCRIPT_DLL_API
647    Data    Data
648    wherePositive() const;    wherePositive() const;
649    
# Line 598  class Data { Line 652  class Data {
652       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.
653       *       *
654    */    */
655      ESCRIPT_DLL_API
656    Data    Data
657    whereNegative() const;    whereNegative() const;
658    
# Line 606  class Data { Line 661  class Data {
661       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.
662       *       *
663    */    */
664      ESCRIPT_DLL_API
665    Data    Data
666    whereNonNegative() const;    whereNonNegative() const;
667    
# Line 614  class Data { Line 670  class Data {
670       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.
671       *       *
672    */    */
673      ESCRIPT_DLL_API
674    Data    Data
675    whereNonPositive() const;    whereNonPositive() const;
676    
# Line 622  class Data { Line 679  class Data {
679       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.
680       *       *
681    */    */
682      ESCRIPT_DLL_API
683    Data    Data
684    whereZero(double tol=0.0) const;    whereZero(double tol=0.0) const;
685    
# Line 630  class Data { Line 688  class Data {
688       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.
689       *       *
690    */    */
691      ESCRIPT_DLL_API
692    Data    Data
693    whereNonZero(double tol=0.0) const;    whereNonZero(double tol=0.0) const;
694    
# Line 638  class Data { Line 697  class Data {
697       Return the maximum absolute value of this Data object.       Return the maximum absolute value of this Data object.
698       *       *
699    */    */
700      ESCRIPT_DLL_API
701    double    double
702    Lsup() const;    Lsup() const;
703    
# Line 646  class Data { Line 706  class Data {
706       Return the minimum absolute value of this Data object.       Return the minimum absolute value of this Data object.
707       *       *
708    */    */
709      ESCRIPT_DLL_API
710    double    double
711    Linf() const;    Linf() const;
712    
# Line 654  class Data { Line 715  class Data {
715       Return the maximum value of this Data object.       Return the maximum value of this Data object.
716       *       *
717    */    */
718      ESCRIPT_DLL_API
719    double    double
720    sup() const;    sup() const;
721    
# Line 662  class Data { Line 724  class Data {
724       Return the minimum value of this Data object.       Return the minimum value of this Data object.
725       *       *
726    */    */
727      ESCRIPT_DLL_API
728    double    double
729    inf() const;    inf() const;
730    
# Line 670  class Data { Line 733  class Data {
733       Return the absolute value of each data point of this Data object.       Return the absolute value of each data point of this Data object.
734       *       *
735    */    */
736      ESCRIPT_DLL_API
737    Data    Data
738    abs() const;    abs() const;
739    
# Line 678  class Data { Line 742  class Data {
742       Return the maximum value of each data point of this Data object.       Return the maximum value of each data point of this Data object.
743       *       *
744    */    */
745      ESCRIPT_DLL_API
746    Data    Data
747    maxval() const;    maxval() const;
748    
# Line 686  class Data { Line 751  class Data {
751       Return the minimum value of each data point of this Data object.       Return the minimum value of each data point of this Data object.
752       *       *
753    */    */
754      ESCRIPT_DLL_API
755    Data    Data
756    minval() const;    minval() const;
757    
# Line 694  class Data { Line 760  class Data {
760       Return the (sample number, data-point number) of the data point with       Return the (sample number, data-point number) of the data point with
761       the minimum value in this Data object.       the minimum value in this Data object.
762    */    */
763      ESCRIPT_DLL_API
764    const boost::python::tuple    const boost::python::tuple
765    mindp() const;    mindp() const;
766    
767      ESCRIPT_DLL_API
768    void    void
769    calc_mindp(int& SampleNo,    calc_mindp(int& SampleNo,
770               int& DataPointNo) const;               int& DataPointNo) const;
# Line 707  class Data { Line 775  class Data {
775       -1 for negative values, zero for zero values, 1 for positive values.       -1 for negative values, zero for zero values, 1 for positive values.
776       *       *
777    */    */
778      ESCRIPT_DLL_API
779    Data    Data
780    sign() const;    sign() const;
781    
782    /**    /**
783       \brief       \brief
784         Return the symmetric part of a matrix which is half the matrix plus its transpose.
785         *
786      */
787      ESCRIPT_DLL_API
788      Data
789      symmetric() const;
790    
791      /**
792         \brief
793         Return the nonsymmetric part of a matrix which is half the matrix minus its transpose.
794         *
795      */
796      ESCRIPT_DLL_API
797      Data
798      nonsymmetric() const;
799    
800      /**
801         \brief
802         Return the trace of a matrix
803         *
804      */
805      ESCRIPT_DLL_API
806      Data
807      matrixtrace(int axis_offset) const;
808    
809      /**
810         \brief
811         Transpose each data point of this Data object around the given axis.
812         *
813      */
814      ESCRIPT_DLL_API
815      Data
816      transpose(int axis_offset) const;
817    
818      /**
819         \brief
820       Return the eigenvalues of the symmetric part at each data point of this Data object in increasing values.       Return the eigenvalues of the symmetric part at each data point of this Data object in increasing values.
821       Currently this function is restricted to rank 2, square shape, and dimension 3.       Currently this function is restricted to rank 2, square shape, and dimension 3.
822       *       *
823    */    */
824      ESCRIPT_DLL_API
825    Data    Data
826    eigenvalues() const;    eigenvalues() const;
827    
# Line 728  class Data { Line 834  class Data {
834       Currently this function is restricted to rank 2, square shape, and dimension 3       Currently this function is restricted to rank 2, square shape, and dimension 3
835       *       *
836    */    */
837      ESCRIPT_DLL_API
838    const boost::python::tuple    const boost::python::tuple
839    eigenvalues_and_eigenvectors(const double tol=1.e-12) const;    eigenvalues_and_eigenvectors(const double tol=1.e-12) const;
840    
841    /**    /**
842       \brief       \brief
      Transpose each data point of this Data object around the given axis.  
      --* not implemented yet *--  
      *  
   */  
   Data  
   transpose(int axis) const;  
   
   /**  
      \brief  
843       Calculate the trace of each data point of this Data object.       Calculate the trace of each data point of this Data object.
844       *       *
845    */    */
846      ESCRIPT_DLL_API
847    Data    Data
848    trace() const;    trace() const;
849    
# Line 753  class Data { Line 852  class Data {
852       Return the sin of each data point of this Data object.       Return the sin of each data point of this Data object.
853       *       *
854    */    */
855      ESCRIPT_DLL_API
856    Data    Data
857    sin() const;    sin() const;
858    
# Line 761  class Data { Line 861  class Data {
861       Return the cos of each data point of this Data object.       Return the cos of each data point of this Data object.
862       *       *
863    */    */
864      ESCRIPT_DLL_API
865    Data    Data
866    cos() const;    cos() const;
867    
# Line 769  class Data { Line 870  class Data {
870       Return the tan of each data point of this Data object.       Return the tan of each data point of this Data object.
871       *       *
872    */    */
873      ESCRIPT_DLL_API
874    Data    Data
875    tan() const;    tan() const;
876    
# Line 777  class Data { Line 879  class Data {
879       Return the asin of each data point of this Data object.       Return the asin of each data point of this Data object.
880       *       *
881    */    */
882      ESCRIPT_DLL_API
883    Data    Data
884    asin() const;    asin() const;
885    
# Line 785  class Data { Line 888  class Data {
888       Return the acos of each data point of this Data object.       Return the acos of each data point of this Data object.
889       *       *
890    */    */
891      ESCRIPT_DLL_API
892    Data    Data
893    acos() const;    acos() const;
894    
# Line 793  class Data { Line 897  class Data {
897       Return the atan of each data point of this Data object.       Return the atan of each data point of this Data object.
898       *       *
899    */    */
900      ESCRIPT_DLL_API
901    Data    Data
902    atan() const;    atan() const;
903    
# Line 801  class Data { Line 906  class Data {
906       Return the sinh of each data point of this Data object.       Return the sinh of each data point of this Data object.
907       *       *
908    */    */
909      ESCRIPT_DLL_API
910    Data    Data
911    sinh() const;    sinh() const;
912    
# Line 809  class Data { Line 915  class Data {
915       Return the cosh of each data point of this Data object.       Return the cosh of each data point of this Data object.
916       *       *
917    */    */
918      ESCRIPT_DLL_API
919    Data    Data
920    cosh() const;    cosh() const;
921    
# Line 817  class Data { Line 924  class Data {
924       Return the tanh of each data point of this Data object.       Return the tanh of each data point of this Data object.
925       *       *
926    */    */
927      ESCRIPT_DLL_API
928    Data    Data
929    tanh() const;    tanh() const;
930    
# Line 825  class Data { Line 933  class Data {
933       Return the asinh of each data point of this Data object.       Return the asinh of each data point of this Data object.
934       *       *
935    */    */
936      ESCRIPT_DLL_API
937    Data    Data
938    asinh() const;    asinh() const;
939    
# Line 833  class Data { Line 942  class Data {
942       Return the acosh of each data point of this Data object.       Return the acosh of each data point of this Data object.
943       *       *
944    */    */
945      ESCRIPT_DLL_API
946    Data    Data
947    acosh() const;    acosh() const;
948    
# Line 841  class Data { Line 951  class Data {
951       Return the atanh of each data point of this Data object.       Return the atanh of each data point of this Data object.
952       *       *
953    */    */
954      ESCRIPT_DLL_API
955    Data    Data
956    atanh() const;    atanh() const;
957    
# Line 849  class Data { Line 960  class Data {
960       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.
961       *       *
962    */    */
963      ESCRIPT_DLL_API
964    Data    Data
965    log10() const;    log10() const;
966    
# Line 857  class Data { Line 969  class Data {
969       Return the natural log of each data point of this Data object.       Return the natural log of each data point of this Data object.
970       *       *
971    */    */
972      ESCRIPT_DLL_API
973    Data    Data
974    log() const;    log() const;
975    
# Line 865  class Data { Line 978  class Data {
978       Return the exponential function of each data point of this Data object.       Return the exponential function of each data point of this Data object.
979       *       *
980    */    */
981      ESCRIPT_DLL_API
982    Data    Data
983    exp() const;    exp() const;
984    
# Line 873  class Data { Line 987  class Data {
987       Return the square root of each data point of this Data object.       Return the square root of each data point of this Data object.
988       *       *
989    */    */
990      ESCRIPT_DLL_API
991    Data    Data
992    sqrt() const;    sqrt() const;
993    
# Line 881  class Data { Line 996  class Data {
996       Return the negation of each data point of this Data object.       Return the negation of each data point of this Data object.
997       *       *
998    */    */
999      ESCRIPT_DLL_API
1000    Data    Data
1001    neg() const;    neg() const;
1002    
# Line 890  class Data { Line 1006  class Data {
1006       Simply returns this object unmodified.       Simply returns this object unmodified.
1007       *       *
1008    */    */
1009      ESCRIPT_DLL_API
1010    Data    Data
1011    pos() const;    pos() const;
1012    
# Line 900  class Data { Line 1017  class Data {
1017       \param right Input - the power to raise the object to.       \param right Input - the power to raise the object to.
1018       *       *
1019    */    */
1020      ESCRIPT_DLL_API
1021    Data    Data
1022    powD(const Data& right) const;    powD(const Data& right) const;
1023    
# Line 910  class Data { Line 1028  class Data {
1028       \param right Input - the power to raise the object to.       \param right Input - the power to raise the object to.
1029       *       *
1030     */     */
1031      ESCRIPT_DLL_API
1032    Data    Data
1033    powO(const boost::python::object& right) const;    powO(const boost::python::object& right) const;
1034    
1035    /**    /**
1036       \brief       \brief
1037         Return the given power of each data point of this boost python object.
1038        
1039         \param left Input - the bases
1040         *
1041       */
1042    
1043      ESCRIPT_DLL_API
1044      Data
1045      rpowO(const boost::python::object& left) const;
1046    
1047      /**
1048         \brief
1049       writes the object to a file in the DX file format       writes the object to a file in the DX file format
1050    */    */
1051      ESCRIPT_DLL_API
1052    void    void
1053    saveDX(std::string fileName) const;    saveDX(std::string fileName) const;
1054    
# Line 924  class Data { Line 1056  class Data {
1056       \brief       \brief
1057       writes the object to a file in the VTK file format       writes the object to a file in the VTK file format
1058    */    */
1059      ESCRIPT_DLL_API
1060    void    void
1061    saveVTK(std::string fileName) const;    saveVTK(std::string fileName) const;
1062    
# Line 933  class Data { Line 1066  class Data {
1066       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1067       *       *
1068    */    */
1069      ESCRIPT_DLL_API
1070    Data& operator+=(const Data& right);    Data& operator+=(const Data& right);
1071      ESCRIPT_DLL_API
1072    Data& operator+=(const boost::python::object& right);    Data& operator+=(const boost::python::object& right);
1073    
1074    /**    /**
# Line 942  class Data { Line 1077  class Data {
1077       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1078       *       *
1079    */    */
1080      ESCRIPT_DLL_API
1081    Data& operator-=(const Data& right);    Data& operator-=(const Data& right);
1082      ESCRIPT_DLL_API
1083    Data& operator-=(const boost::python::object& right);    Data& operator-=(const boost::python::object& right);
1084    
1085   /**   /**
# Line 951  class Data { Line 1088  class Data {
1088       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1089       *       *
1090    */    */
1091      ESCRIPT_DLL_API
1092    Data& operator*=(const Data& right);    Data& operator*=(const Data& right);
1093      ESCRIPT_DLL_API
1094    Data& operator*=(const boost::python::object& right);    Data& operator*=(const boost::python::object& right);
1095    
1096   /**   /**
# Line 960  class Data { Line 1099  class Data {
1099       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1100       *       *
1101    */    */
1102      ESCRIPT_DLL_API
1103    Data& operator/=(const Data& right);    Data& operator/=(const Data& right);
1104      ESCRIPT_DLL_API
1105    Data& operator/=(const boost::python::object& right);    Data& operator/=(const boost::python::object& right);
1106    
1107    /**    /**
1108       \brief       \brief
1109       Returns true if this can be interpolated to functionspace.       Returns true if this can be interpolated to functionspace.
1110    */    */
1111      ESCRIPT_DLL_API
1112    bool    bool
1113    probeInterpolation(const FunctionSpace& functionspace) const;    probeInterpolation(const FunctionSpace& functionspace) const;
1114    
# Line 985  class Data { Line 1127  class Data {
1127       \param key - Input - python slice tuple specifying       \param key - Input - python slice tuple specifying
1128       slice to return.       slice to return.
1129    */    */
1130      ESCRIPT_DLL_API
1131    Data    Data
1132    getItem(const boost::python::object& key) const;    getItem(const boost::python::object& key) const;
1133    
# Line 999  class Data { Line 1142  class Data {
1142       slice to copy from value.       slice to copy from value.
1143       \param value - Input - Data object to copy from.       \param value - Input - Data object to copy from.
1144    */    */
1145      ESCRIPT_DLL_API
1146    void    void
1147    setItemD(const boost::python::object& key,    setItemD(const boost::python::object& key,
1148             const Data& value);             const Data& value);
1149    
1150      ESCRIPT_DLL_API
1151    void    void
1152    setItemO(const boost::python::object& key,    setItemO(const boost::python::object& key,
1153             const boost::python::object& value);             const boost::python::object& value);
# Line 1015  class Data { Line 1160  class Data {
1160       this Data object.       this Data object.
1161    */    */
1162    template <class UnaryFunction>    template <class UnaryFunction>
1163      ESCRIPT_DLL_API
1164    inline    inline
1165    void    void
1166    unaryOp(UnaryFunction operation);    unaryOp(UnaryFunction operation);
# Line 1026  class Data { Line 1172  class Data {
1172       \param region - Input - Region to copy.       \param region - Input - Region to copy.
1173       *       *
1174    */    */
1175      ESCRIPT_DLL_API
1176    Data    Data
1177    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataArrayView::RegionType& region) const;
1178    
# Line 1037  class Data { Line 1184  class Data {
1184       \param region - Input - Region to copy.       \param region - Input - Region to copy.
1185       *       *
1186    */    */
1187      ESCRIPT_DLL_API
1188    void    void
1189    setSlice(const Data& value,    setSlice(const Data& value,
1190             const DataArrayView::RegionType& region);             const DataArrayView::RegionType& region);
# Line 1046  class Data { Line 1194  class Data {
1194       Archive the current Data object to the given file.       Archive the current Data object to the given file.
1195       \param fileName - Input - file to archive to.       \param fileName - Input - file to archive to.
1196    */    */
1197      ESCRIPT_DLL_API
1198    void    void
1199    archiveData(const std::string fileName);    archiveData(const std::string fileName);
1200    
# Line 1057  class Data { Line 1206  class Data {
1206       \param fileName - Input - file to extract from.       \param fileName - Input - file to extract from.
1207       \param fspace - Input - a suitable FunctionSpace descibing the data.       \param fspace - Input - a suitable FunctionSpace descibing the data.
1208    */    */
1209      ESCRIPT_DLL_API
1210    void    void
1211    extractData(const std::string fileName,    extractData(const std::string fileName,
1212                const FunctionSpace& fspace);                const FunctionSpace& fspace);
1213    
1214    
1215      /**
1216         \brief
1217         print the data values to stdout. Used for debugging
1218      */
1219      void print();
1220    
1221   protected:   protected:
1222    
1223   private:   private:
# Line 1204  Data::initialise(const IValueType& value Line 1361  Data::initialise(const IValueType& value
1361    Operator+    Operator+
1362    Takes two Data objects.    Takes two Data objects.
1363  */  */
1364  Data operator+(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator+(const Data& left, const Data& right);
1365    
1366  /**  /**
1367    \brief    \brief
1368    Operator-    Operator-
1369    Takes two Data objects.    Takes two Data objects.
1370  */  */
1371  Data operator-(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator-(const Data& left, const Data& right);
1372    
1373  /**  /**
1374    \brief    \brief
1375    Operator*    Operator*
1376    Takes two Data objects.    Takes two Data objects.
1377  */  */
1378  Data operator*(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator*(const Data& left, const Data& right);
1379    
1380  /**  /**
1381    \brief    \brief
1382    Operator/    Operator/
1383    Takes two Data objects.    Takes two Data objects.
1384  */  */
1385  Data operator/(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator/(const Data& left, const Data& right);
1386    
1387  /**  /**
1388    \brief    \brief
# Line 1233  Data operator/(const Data& left, const D Line 1390  Data operator/(const Data& left, const D
1390    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1391    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1392  */  */
1393  Data operator+(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator+(const Data& left, const boost::python::object& right);
1394    
1395  /**  /**
1396    \brief    \brief
# Line 1241  Data operator+(const Data& left, const b Line 1398  Data operator+(const Data& left, const b
1398    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1399    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1400  */  */
1401  Data operator-(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator-(const Data& left, const boost::python::object& right);
1402    
1403  /**  /**
1404    \brief    \brief
# Line 1249  Data operator-(const Data& left, const b Line 1406  Data operator-(const Data& left, const b
1406    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1407    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1408  */  */
1409  Data operator*(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator*(const Data& left, const boost::python::object& right);
1410    
1411  /**  /**
1412    \brief    \brief
# Line 1257  Data operator*(const Data& left, const b Line 1414  Data operator*(const Data& left, const b
1414    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1415    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1416  */  */
1417  Data operator/(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator/(const Data& left, const boost::python::object& right);
1418    
1419  /**  /**
1420    \brief    \brief
# Line 1265  Data operator/(const Data& left, const b Line 1422  Data operator/(const Data& left, const b
1422    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1423    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1424  */  */
1425  Data operator+(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator+(const boost::python::object& left, const Data& right);
1426    
1427  /**  /**
1428    \brief    \brief
# Line 1273  Data operator+(const boost::python::obje Line 1430  Data operator+(const boost::python::obje
1430    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1431    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1432  */  */
1433  Data operator-(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator-(const boost::python::object& left, const Data& right);
1434    
1435  /**  /**
1436    \brief    \brief
# Line 1281  Data operator-(const boost::python::obje Line 1438  Data operator-(const boost::python::obje
1438    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1439    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1440  */  */
1441  Data operator*(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator*(const boost::python::object& left, const Data& right);
1442    
1443  /**  /**
1444    \brief    \brief
# Line 1289  Data operator*(const boost::python::obje Line 1446  Data operator*(const boost::python::obje
1446    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1447    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1448  */  */
1449  Data operator/(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator/(const boost::python::object& left, const Data& right);
1450    
1451  /**  /**
1452    \brief    \brief
1453    Output operator    Output operator
1454  */  */
1455  std::ostream& operator<<(std::ostream& o, const Data& data);  ESCRIPT_DLL_API std::ostream& operator<<(std::ostream& o, const Data& data);
1456    
1457  /**  /**
1458    \brief    \brief
# Line 1303  std::ostream& operator<<(std::ostream& o Line 1460  std::ostream& operator<<(std::ostream& o
1460    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
1461    be relied on. Requires further implementation.    be relied on. Requires further implementation.
1462  */  */
1463  //bool operator==(const Data& left, const Data& right);  //ESCRIPT_DLL_API bool operator==(const Data& left, const Data& right);
1464    
1465  /**  /**
1466    \brief    \brief

Legend:
Removed from v.698  
changed lines
  Added in v.775

  ViewVC Help
Powered by ViewVC 1.1.26