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

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

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

revision 615 by elspeth, Wed Mar 22 02:12:00 2006 UTC revision 1118 by gross, Tue Apr 24 08:55:04 2007 UTC
# Line 13  Line 13 
13    
14  #if !defined escript_DataConstant_20040323_H  #if !defined escript_DataConstant_20040323_H
15  #define escript_DataConstant_20040323_H  #define escript_DataConstant_20040323_H
16    #include "system_dep.h"
17    
18  #include "DataAbstract.h"  #include "DataAbstract.h"
19  #include "DataArrayView.h"  #include "DataArrayView.h"
# Line 44  class DataConstant : public DataAbstract Line 45  class DataConstant : public DataAbstract
45       \param value - Input - Data value for a single point.       \param value - Input - Data value for a single point.
46       \param what - Input - A description of what this data object represents.       \param what - Input - A description of what this data object represents.
47    */    */
48      ESCRIPT_DLL_API
49    DataConstant(const boost::python::numeric::array& value,    DataConstant(const boost::python::numeric::array& value,
50                 const FunctionSpace& what);                 const FunctionSpace& what);
51    
# Line 51  class DataConstant : public DataAbstract Line 53  class DataConstant : public DataAbstract
53       \brief       \brief
54       Copy constructor. Performs a deep copy.       Copy constructor. Performs a deep copy.
55    */    */
56      ESCRIPT_DLL_API
57    DataConstant(const DataConstant& other);    DataConstant(const DataConstant& other);
58    
59    /**    /**
# Line 62  class DataConstant : public DataAbstract Line 65  class DataConstant : public DataAbstract
65       \param value - Input - Data value for a single point.       \param value - Input - Data value for a single point.
66       \param what - Input - A description of what this data object represents.       \param what - Input - A description of what this data object represents.
67    */    */
68      ESCRIPT_DLL_API
69    DataConstant(const DataArrayView& value,    DataConstant(const DataArrayView& value,
70                 const FunctionSpace& what);                 const FunctionSpace& what);
71    
# Line 74  class DataConstant : public DataAbstract Line 78  class DataConstant : public DataAbstract
78       \param other - Input - Data object to copy from.       \param other - Input - Data object to copy from.
79       \param region - Input - region to copy.       \param region - Input - region to copy.
80    */    */
81      ESCRIPT_DLL_API
82    DataConstant(const DataConstant& other,    DataConstant(const DataConstant& other,
83                 const DataArrayView::RegionType& region);                 const DataArrayView::RegionType& region);
84    
# Line 87  class DataConstant : public DataAbstract Line 92  class DataConstant : public DataAbstract
92       \param shape - Input - the shape of each data-point.       \param shape - Input - the shape of each data-point.
93       \param data - the data values for each data-point.       \param data - the data values for each data-point.
94    */    */
95      ESCRIPT_DLL_API
96    DataConstant(const FunctionSpace& what,    DataConstant(const FunctionSpace& what,
97                 const DataArrayView::ShapeType &shape,                 const DataArrayView::ShapeType &shape,
98                 const DataArrayView::ValueType &data);                 const DataArrayView::ValueType &data);
# Line 95  class DataConstant : public DataAbstract Line 101  class DataConstant : public DataAbstract
101       \brief       \brief
102       Write the data as a string.       Write the data as a string.
103    */    */
104      ESCRIPT_DLL_API
105    std::string    std::string
106    toString() const;    toString() const;
107     /**
108         \brief
109         dumps the object into a netCDF file
110      */
111      ESCRIPT_DLL_API
112      virtual
113      void
114      dump(const std::string fileName) const;
115    
116     /**
117         \brief
118        sets all values to zero
119      */
120      ESCRIPT_DLL_API
121      virtual
122      void
123      setToZero();
124    
125    /**    /**
126       \brief       \brief
# Line 107  class DataConstant : public DataAbstract Line 131  class DataConstant : public DataAbstract
131       \param sampleNo - Input - sample number.       \param sampleNo - Input - sample number.
132       \param dataPointNo - Input - data point number for the sample.       \param dataPointNo - Input - data point number for the sample.
133     */     */
134      ESCRIPT_DLL_API
135    virtual    virtual
136    DataArrayView::ValueType::size_type    DataArrayView::ValueType::size_type
137    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
# Line 118  class DataConstant : public DataAbstract Line 143  class DataConstant : public DataAbstract
143       \param sampleNo - Input - sample number.       \param sampleNo - Input - sample number.
144       \param dataPointNo - Input - data point number for the sample.       \param dataPointNo - Input - data point number for the sample.
145    */    */
146      ESCRIPT_DLL_API
147    virtual    virtual
148    DataArrayView    DataArrayView
149    getDataPoint(int sampleNo,    getDataPoint(int sampleNo,
# Line 127  class DataConstant : public DataAbstract Line 153  class DataConstant : public DataAbstract
153       \brief       \brief
154       Return the number of doubles stored for the Data object.       Return the number of doubles stored for the Data object.
155    */    */
156      ESCRIPT_DLL_API
157    virtual    virtual
158    DataArrayView::ValueType::size_type    DataArrayView::ValueType::size_type
159    getLength() const;    getLength() const;
# Line 138  class DataConstant : public DataAbstract Line 165  class DataConstant : public DataAbstract
165       The caller is reponsible for managing the object created.       The caller is reponsible for managing the object created.
166       \param region - Input - region to slice from this object.       \param region - Input - region to slice from this object.
167    */    */
168      ESCRIPT_DLL_API
169    virtual    virtual
170    DataAbstract*    DataAbstract*
171    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataArrayView::RegionType& region) const;
# Line 148  class DataConstant : public DataAbstract Line 176  class DataConstant : public DataAbstract
176       \param value - Input - Data object to copy from.       \param value - Input - Data object to copy from.
177       \param region - Input - Region to copy.       \param region - Input - Region to copy.
178    */    */
179      ESCRIPT_DLL_API
180    virtual    virtual
181    void    void
182    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
183             const DataArrayView::RegionType& region);             const DataArrayView::RegionType& region);
184    
185    /**    /**
      \brief  
      Reshape the data point if the data point is currently rank 0.  
      The original data point value is used for all values of the new  
      data point.  
   */  
   void  
   reshapeDataPoint(const DataArrayView::ShapeType& shape);  
   
   /**  
186      \brief      \brief
187      Archive the underlying data values to the file referenced      Archive the underlying data values to the file referenced
188      by ofstream. A count of the number of values expected to be written      by ofstream. A count of the number of values expected to be written
# Line 170  class DataConstant : public DataAbstract Line 190  class DataConstant : public DataAbstract
190    
191      The return value indicates success (0) or otherwise (1).      The return value indicates success (0) or otherwise (1).
192    */    */
193      ESCRIPT_DLL_API
194    int    int
195    archiveData(std::ofstream& archiveFile,    archiveData(std::ofstream& archiveFile,
196                const DataArrayView::ValueType::size_type noValues) const;                const DataArrayView::ValueType::size_type noValues) const;
# Line 181  class DataConstant : public DataAbstract Line 202  class DataConstant : public DataAbstract
202    
203      The return value indicates success (0) or otherwise (1).      The return value indicates success (0) or otherwise (1).
204    */    */
205      ESCRIPT_DLL_API
206    int    int
207    extractData(std::ifstream& archiveFile,    extractData(std::ifstream& archiveFile,
208                const DataArrayView::ValueType::size_type noValues);                const DataArrayView::ValueType::size_type noValues);
209    
210    /**    /**
211       \brief       \brief
212         Computes a symmetric matrix (A + AT) / 2
213    
214         \param ev - Output - symmetric matrix
215    
216      */
217      ESCRIPT_DLL_API
218      virtual void
219      symmetric(DataAbstract* ev);
220    
221      /**
222         \brief
223         Computes a nonsymmetric matrix (A - AT) / 2
224    
225         \param ev - Output - nonsymmetric matrix
226    
227      */
228      ESCRIPT_DLL_API
229      virtual void
230      nonsymmetric(DataAbstract* ev);
231    
232      /**
233         \brief
234         Computes the trace of a matrix
235    
236         \param ev - Output - trace of matrix
237    
238      */
239      ESCRIPT_DLL_API
240      virtual void
241      trace(DataAbstract* ev, int axis_offset);
242    
243      /**
244         \brief
245         Transpose each data point of this Data object around the given axis.
246    
247         \param ev - Output - transpose of matrix
248    
249      */
250      ESCRIPT_DLL_API
251      virtual void
252      transpose(DataAbstract* ev, int axis_offset);
253    
254      /**
255         \brief
256         swaps components axis0 and axis1
257    
258         \param ev - Output - swapped components
259    
260      */
261      ESCRIPT_DLL_API
262      virtual void
263      swapaxes(DataAbstract* ev, int axis0, int axis1);
264    
265    
266      /**
267         \brief
268       solves the eigenvalue problem this*V=ev*V for the eigenvalues ev       solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
269    
270       \param ev - Output - eigenvalues in increasing order at each data point       \param ev - Output - eigenvalues in increasing order at each data point
271    
272    */    */
273      ESCRIPT_DLL_API
274    virtual void    virtual void
275    eigenvalues(DataAbstract* ev);    eigenvalues(DataAbstract* ev);
276    
# Line 206  class DataConstant : public DataAbstract Line 285  class DataConstant : public DataAbstract
285    
286    */    */
287    
288      ESCRIPT_DLL_API
289    virtual void    virtual void
290    eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13);    eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13);
291    

Legend:
Removed from v.615  
changed lines
  Added in v.1118

  ViewVC Help
Powered by ViewVC 1.1.26