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

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

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

revision 99 by jgs, Tue Dec 14 05:39:33 2004 UTC revision 100 by jgs, Wed Dec 15 03:48:48 2004 UTC
# Line 1  Line 1 
 // $Id$  
1  /*  /*
2   ******************************************************************************   ******************************************************************************
3   *                                                                            *   *                                                                            *
# Line 13  Line 12 
12   ******************************************************************************   ******************************************************************************
13  */  */
14                                                                                                                                                        
15  #if !defined escript_DataExpanded_20040323_H  #if !defined  escript_DataExpanded_20040323_H
16  #define escript_DataExpanded_20040323_H  #define escript_DataExpanded_20040323_H
17    
18  #include "DataAbstract.h"  #include "DataAbstract.h"
# Line 25  Line 24 
24    
25  namespace escript {  namespace escript {
26    
27  class DataEmpty;    class DataConstant;
28  class DataConstant;    class DataTagged;
 class DataTagged;  
29    
30  /**  /**
31     \brief     \brief
# Line 53  class DataExpanded : public DataAbstract Line 51  class DataExpanded : public DataAbstract
51    
52    /**    /**
53       \brief       \brief
54       Construct a DataExpanded from a DataConstant.       Construct a DataExpanded from a DataConstant
55    */    */
56    DataExpanded(const DataConstant& other);    DataExpanded(const DataConstant& other);
57    
58    /**    /**
59       \brief       \brief
60       Construct a DataExpanded from a DataTagged.       Construct a DataExpanded from a DataTagged
61    */    */
62    DataExpanded(const DataTagged& other);    DataExpanded(const DataTagged& other);
63    
# Line 72  class DataExpanded : public DataAbstract Line 70  class DataExpanded : public DataAbstract
70       \param value - Input - Data value for a single point.       \param value - Input - Data value for a single point.
71       \param what - Input - A description of what this data represents.       \param what - Input - A description of what this data represents.
72    */    */
73    DataExpanded(const boost::python::numeric::array& value,    DataExpanded(const boost::python::numeric::array& value, const FunctionSpace& what);
                const FunctionSpace& what);  
74    
75    /**    /**
76       \brief       \brief
77       Alternative constructor for DataExpanded       Alternative constructor for DataExpanded
78    
79       Description:       Description:
80       Alternative Constructor for DataExpanded.       Alternative Constructor for DataExpanded
81       \param value - Input - Data value for a single point.       \param value - Input - Data value for a single point.
82       \param what - Input - A description of what this data represents.       \param what - Input - A description of what this data represents.
83    
84    */    */
85    DataExpanded(const DataArrayView& value,    DataExpanded(const DataArrayView& value, const FunctionSpace& what);
                const FunctionSpace& what);  
86    
87    /**    /**
88       \brief       \brief
89       Alternative constructor for DataExpanded that copies a slice from       Alternative constructor for DataExpanded that copies a slice from
90       another DataExpanded.       another DataExpanded.
91    
92       \param other - Input - DataExpanded object to slice from.       \param other - Input - DataExpanded object to slice from
93       \param region - Input - region to copy.       \param region - Input - region to copy
94    */    */
95    DataExpanded(const DataExpanded& other,    DataExpanded(const DataExpanded& other, const DataArrayView::RegionType& region);
                const DataArrayView::RegionType& region);  
96    
97    /**    /**
98       \brief       \brief
99       Destructor       Destructor
100    */    */
101    virtual    virtual ~DataExpanded();
   ~DataExpanded();  
102    
103    /**    /**
104       \brief       \brief
105       Return a textual representation of the data       Return a textual representation of the data
106    */    */
107    virtual    virtual std::string toString() const;
   std::string  
   toString() const;  
108    
109    /**    /**
110       \brief       \brief
# Line 120  class DataExpanded : public DataAbstract Line 112  class DataExpanded : public DataAbstract
112       The original data point value is used for all values of the new       The original data point value is used for all values of the new
113       data point.       data point.
114    */    */
115    void    void reshapeDataPoint(const DataArrayView::ShapeType& shape);
   reshapeDataPoint(const DataArrayView::ShapeType& shape);  
116    
117    /**    /**
118       \brief       \brief
# Line 131  class DataExpanded : public DataAbstract Line 122  class DataExpanded : public DataAbstract
122       \param sampleNo - Input - number of samples.       \param sampleNo - Input - number of samples.
123       \param dataPointNo - Input - Input.       \param dataPointNo - Input - Input.
124    */    */
125    virtual    virtual DataArrayView::ValueType::size_type getPointOffset(int sampleNo, int dataPointNo) const;
   DataArrayView::ValueType::size_type  
   getPointOffset(int sampleNo,  
                  int dataPointNo) const;  
126    
127    /**    /**
128       \brief       \brief
129       Return a view into the data for the data point specified.       Return a view into the data for the data point specified.
130       NOTE: Construction of the DataArrayView is a relatively expensive       NOTE: Construction of the DataArrayView is a relatively expensive
131       operation.       operation
132       \param sampleNo - Input       \param sampleNo - Input
133       \param dataPointNo - Input       \param dataPointNo - Input
134       \return DataArrayView of the data point.       \return DataArrayView of the data point.
135    */    */
136    DataArrayView    DataArrayView getDataPoint(int sampleNo, int dataPointNo);
   getDataPoint(int sampleNo,  
                int dataPointNo);  
137    
138    /**    /**
139       \brief       \brief
140       Return the number of doubles stored for the Data.       Return the number of doubles stored for the Data
141    */    */
142    virtual    virtual ValueType::size_type getLength() const;
   ValueType::size_type  
   getLength() const;  
143    
144    /**    /**
145       \brief       \brief
# Line 163  class DataExpanded : public DataAbstract Line 147  class DataExpanded : public DataAbstract
147       The caller is reponsible for managing the object created.       The caller is reponsible for managing the object created.
148       \param region - Input - Region to copy.       \param region - Input - Region to copy.
149    */    */
150    virtual    virtual DataAbstract* getSlice(const DataArrayView::RegionType& region) const;
   DataAbstract*  
   getSlice(const DataArrayView::RegionType& region) const;  
151    
152    /**    /**
153       \brief       \brief
# Line 173  class DataExpanded : public DataAbstract Line 155  class DataExpanded : public DataAbstract
155       \param value - Input - Data to copy from       \param value - Input - Data to copy from
156       \param region - Input - Region to copy.       \param region - Input - Region to copy.
157    */    */
158    virtual    virtual void setSlice(const DataAbstract* value, const DataArrayView::RegionType& region);
   void  
   setSlice(const DataAbstract* value,  
            const DataArrayView::RegionType& region);  
159    
160   protected:   protected:
161    
# Line 192  class DataExpanded : public DataAbstract Line 171  class DataExpanded : public DataAbstract
171       \param noSamples - Input - number of samples.       \param noSamples - Input - number of samples.
172       \param noDataPointsPerSample - Input -       \param noDataPointsPerSample - Input -
173    */    */
174    void    void initialise(const DataArrayView::ShapeType& shape, int noSamples, int noDataPointsPerSample);
   initialise(const DataArrayView::ShapeType& shape,  
              int noSamples,  
              int noDataPointsPerSample);  
175    
176    /**    /**
177       \brief       \brief
# Line 203  class DataExpanded : public DataAbstract Line 179  class DataExpanded : public DataAbstract
179    
180       Description:       Description:
181       Copy the given data point to all data points.       Copy the given data point to all data points.
182       \param value Input - Value for a single data point.       \param value Input - Value for a single data point
183    */    */
184    void    void copy(const DataArrayView& value);
185    copy(const DataArrayView& value);    void copy(const boost::python::numeric::array& value);
   
   void  
   copy(const boost::python::numeric::array& value);  
186    
187    //    //
188    // The main data storage, a 2D array of data blocks.    // The main data storage, a 2D array of data blocks
189    DataBlocks2D m_data;    DataBlocks2D m_data;
190    
191  };  };
192    
193  } // end of namespace  } // end of namespace
   
194  #endif  #endif
195    
196    
197    
198    

Legend:
Removed from v.99  
changed lines
  Added in v.100

  ViewVC Help
Powered by ViewVC 1.1.26