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

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

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

revision 119 by jgs, Tue Apr 12 04:45:05 2005 UTC revision 121 by jgs, Fri May 6 04:26:16 2005 UTC
# Line 1  Line 1 
1  // $Id$  // $Id$
2  /*=============================================================================  /*
   
3   ******************************************************************************   ******************************************************************************
4   *                                                                            *   *                                                                            *
5   *       COPYRIGHT ACcESS 2004 -  All Rights Reserved                         *   *       COPYRIGHT ACcESS 2004 -  All Rights Reserved                         *
# Line 12  Line 11 
11   * person has a software license agreement with ACcESS.                       *   * person has a software license agreement with ACcESS.                       *
12   *                                                                            *   *                                                                            *
13   ******************************************************************************   ******************************************************************************
14    */
15    
16  ******************************************************************************/  /** \file Data.h */
17    
18  #ifndef DATA_H  #ifndef DATA_H
19  #define DATA_H  #define DATA_H
# Line 40  extern "C" { Line 40  extern "C" {
40  #include <boost/python/tuple.hpp>  #include <boost/python/tuple.hpp>
41  #include <boost/python/numeric.hpp>  #include <boost/python/numeric.hpp>
42    
43    namespace escript {
44    
45    //
46    // Forward declaration for various implimentations of Data.
47    class DataEmpty;
48    class DataConstant;
49    class DataTagged;
50    class DataExpanded;
51    
52  /**  /**
53     \brief     \brief
54     Data is essentially a factory class which creates the appropriate Data     Data creates the appropriate Data object for the given construction
55     object for the given construction arguments. It retains control over     arguments.
    the object created for the lifetime of the object.  
    The type of Data object referred to may change during the lifetime of  
    the Data object.  
56    
57     Description:     Description:
58     Data is essentially a factory class which creates the appropriate Data     Data is essentially a factory class which creates the appropriate Data
# Line 55  extern "C" { Line 61  extern "C" {
61     The type of Data object referred to may change during the lifetime of     The type of Data object referred to may change during the lifetime of
62     the Data object.     the Data object.
63  */  */
   
 namespace escript {  
   
 //  
 // Forward declaration for various implimentations of Data.  
 class DataEmpty;  
 class DataConstant;  
 class DataTagged;  
 class DataExpanded;  
   
64  class Data {  class Data {
65    
66    public:    public:
# Line 223  class Data { Line 219  class Data {
219    
220    /**    /**
221       \brief       \brief
222       Return the values of all data-points in a single python numarray object.       Return the values of all data-points as a single python numarray object.
223    */    */
224    boost::python::numeric::array    const boost::python::numeric::array
225    convertToNumArray();    convertToNumArray();
226    
227    /**    /**
228       \brief       \brief
229         Return the values of all data-points for the given sample as a single python numarray object.
230      */
231      const boost::python::numeric::array
232      convertToNumArrayFromSampleNo(int sampleNo);
233    
234      /**
235         \brief
236         Return the value of the specified data-point as a single python numarray object.
237      */
238      const boost::python::numeric::array
239      convertToNumArrayFromDPNo(int sampleNo,
240                                int dataPointNo);
241    
242      /**
243         \brief
244       Return the C wrapper for the Data object.       Return the C wrapper for the Data object.
245    */    */
246    escriptDataC    escriptDataC
# Line 471  class Data { Line 482  class Data {
482       \brief       \brief
483       Return the data point shape as a tuple of integers.       Return the data point shape as a tuple of integers.
484    */    */
485    boost::python::tuple    const boost::python::tuple
486    getShapeTuple() const;    getShapeTuple() const;
487    
488    /**    /**
# Line 508  class Data { Line 519  class Data {
519       cannot be converted to a DataTagged object.       cannot be converted to a DataTagged object.
520       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer key.
521       \param value - Input - Value to associate with given key.       \param value - Input - Value to associate with given key.
      Note: removed for now - this version not needed, and breaks escript.cpp  
522    */    */
   /*  
523    void    void
524    setTaggedValue(int tagKey,    setTaggedValueFromCPP(int tagKey,
525                   const DataArrayView& value);                          const DataArrayView& value);
   */  
526    
527    /**    /**
528      \brief      \brief
# Line 682  class Data { Line 690  class Data {
690    
691    /**    /**
692       \brief       \brief
693         Return the (sample number, data-point number) of the data point with
694         the minimum value in this Data object.
695      */
696      const boost::python::tuple
697      mindp() const;
698    
699      /**
700         \brief
701       Return the length of each data point of this Data object.       Return the length of each data point of this Data object.
702       sqrt(sum(A[i,j,k,l]^2))       sqrt(sum(A[i,j,k,l]^2))
703    */    */
# Line 697  class Data { Line 713  class Data {
713    sign() const;    sign() const;
714    
715    /**    /**
716      \transpose      \brief
717      Transpose each data point of this Data object around the given axis.      Transpose each data point of this Data object around the given axis.
718      --* not implemented yet *--      --* not implemented yet *--
719    */    */
# Line 705  class Data { Line 721  class Data {
721    transpose(int axis) const;    transpose(int axis) const;
722    
723    /**    /**
724      \trace      \brief
725      Calculate the trace of each data point of this Data object.      Calculate the trace of each data point of this Data object.
726      sum(A[i,i,i,i])      sum(A[i,i,i,i])
727    */    */
# Line 713  class Data { Line 729  class Data {
729    trace() const;    trace() const;
730    
731    /**    /**
732      \exp      \brief
733      Return the exponential function of each data point of this Data object.      Return the exponential function of each data point of this Data object.
734    */    */
735    Data    Data
736    exp() const;    exp() const;
737    
738    /**    /**
739      \sqrt      \brief
740      Return the square root of each data point of this Data object.      Return the square root of each data point of this Data object.
741    */    */
742    Data    Data
743    sqrt() const;    sqrt() const;
744    
745    /**    /**
746        \brief
747        Return the negation of each data point of this Data object.
748      */
749      Data
750      neg() const;
751    
752      /**
753        \brief
754        Return the identity of each data point of this Data object.
755        Simply returns this object unmodified.
756      */
757      Data
758      pos() const;
759    
760      /**
761       \brief       \brief
762       Return the given power of each data point of this Data object.       Return the given power of each data point of this Data object.
763    
764         \param right Input - the power to raise the object to.
765    */    */
766    Data    Data
767    powD(const Data& right) const;    powD(const Data& right) const;
768    
769      /**
770       * \brief
771       * Return the given power of each data point of this boost python object.
772       *
773       * \param right Input - the power to raise the object to.
774       */
775    Data    Data
776    powO(const boost::python::object& right) const;    powO(const boost::python::object& right) const;
777    
# Line 751  class Data { Line 790  class Data {
790    saveVTK(std::string fileName) const;    saveVTK(std::string fileName) const;
791    
792    /**    /**
     \brief  
     Return the negation of each data point of this Data object.  
   */  
   Data  
   neg() const;  
   
   /**  
     \brief  
     Return the identity of each data point of this Data object.  
     Simply returns this object unmodified.  
   */  
   Data  
   pos() const;  
   
   /**  
793       \brief       \brief
794       Overloaded operator +=       Overloaded operator +=
795       \param right - Input - The right hand side.       \param right - Input - The right hand side.
# Line 826  class Data { Line 850  class Data {
850       \brief       \brief
851       Copies slice from value into this Data object.       Copies slice from value into this Data object.
852    
      \description  
853       Implements the [] set operator in python.       Implements the [] set operator in python.
854       Calls setSlice.       Calls setSlice.
855    
# Line 888  class Data { Line 911  class Data {
911       the current Data object.       the current Data object.
912       Note - the current object must be of type DataEmpty.       Note - the current object must be of type DataEmpty.
913       \param fileName - Input - file to extract from.       \param fileName - Input - file to extract from.
914       \param what - Input - a suitable FunctionSpace descibing the data.       \param fspace - Input - a suitable FunctionSpace descibing the data.
915    */    */
916    void    void
917    extractData(const std::string fileName,    extractData(const std::string fileName,

Legend:
Removed from v.119  
changed lines
  Added in v.121

  ViewVC Help
Powered by ViewVC 1.1.26