/[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 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC revision 2742 by jfenwick, Thu Nov 12 06:03:37 2009 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2008 by University of Queensland  * Copyright (c) 2003-2009 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 16  Line 16 
16  #define escript_DataConstant_20040323_H  #define escript_DataConstant_20040323_H
17  #include "system_dep.h"  #include "system_dep.h"
18    
19  #include "DataAbstract.h"  #include "DataReady.h"
20    #include "WrappedArray.h"
21    
 #include <boost/python/numeric.hpp>  
22    
23  namespace escript {  namespace escript {
24    
# Line 31  namespace escript { Line 31  namespace escript {
31     DataConstant stores a single data point which represents the entire     DataConstant stores a single data point which represents the entire
32     function space.     function space.
33  */  */
34  class DataConstant : public DataAbstract  {  class DataConstant : public DataReady  {
35    typedef DataReady parent;
36   public:   public:
37    
38    /**    /**
# Line 46  class DataConstant : public DataAbstract Line 46  class DataConstant : public DataAbstract
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    ESCRIPT_DLL_API
49    DataConstant(const boost::python::numeric::array& value,    DataConstant(const WrappedArray& value,
50                 const FunctionSpace& what);                 const FunctionSpace& what);
51    
52    
53    /**    /**
54       \brief       \brief
55       Copy constructor. Performs a deep copy.       Copy constructor. Performs a deep copy.
# Line 56  class DataConstant : public DataAbstract Line 57  class DataConstant : public DataAbstract
57    ESCRIPT_DLL_API    ESCRIPT_DLL_API
58    DataConstant(const DataConstant& other);    DataConstant(const DataConstant& other);
59    
 //  /**  
 /*     \brief  
      Alternative constructor for DataConstant objects.  
   
      Description:  
      Alternative Constructor for DataConstant objects.  
      \param value - Input - Data value for a single point.  
      \param what - Input - A description of what this data object represents.*/  
 //  */  
 //   ESCRIPT_DLL_API  
 //   DataConstant(const DataArrayView& value,  
 //                const FunctionSpace& what);  
60    
61    /**    /**
62       \brief       \brief
# Line 97  class DataConstant : public DataAbstract Line 86  class DataConstant : public DataAbstract
86                 const DataTypes::ShapeType &shape,                 const DataTypes::ShapeType &shape,
87                 const DataTypes::ValueType &data);                 const DataTypes::ValueType &data);
88    
89    
90      ESCRIPT_DLL_API
91      bool
92      isConstant() const
93      {
94        return true;
95      };
96    
97    /**    /**
98       \brief       \brief
99       Write the data as a string.       Write the data as a string.
# Line 147  class DataConstant : public DataAbstract Line 144  class DataConstant : public DataAbstract
144    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
145                   int dataPointNo) const;                   int dataPointNo) const;
146    
147  //  /**    ESCRIPT_DLL_API
148  /*     \brief    virtual
149       Return a view into the data for the data point specified.    DataTypes::ValueType::size_type
150       \param sampleNo - Input - sample number.    getPointOffset(int sampleNo,
151       \param dataPointNo - Input - data point number for the sample.*/                   int dataPointNo);
 //  */  
 //   ESCRIPT_DLL_API  
 //   virtual  
 //   DataArrayView  
 //   getDataPoint(int sampleNo,  
 //                int dataPointNo);  
152    
153    /**    /**
154       \brief       \brief
# Line 220  class DataConstant : public DataAbstract Line 211  class DataConstant : public DataAbstract
211       Computes the trace of a matrix       Computes the trace of a matrix
212    
213       \param ev - Output - trace of matrix       \param ev - Output - trace of matrix
214         \param axis_offset
215    
216    */    */
217    ESCRIPT_DLL_API    ESCRIPT_DLL_API
# Line 231  class DataConstant : public DataAbstract Line 223  class DataConstant : public DataAbstract
223       Transpose each data point of this Data object around the given axis.       Transpose each data point of this Data object around the given axis.
224    
225       \param ev - Output - transpose of matrix       \param ev - Output - transpose of matrix
226         \param axis_offset
227    */    */
228    ESCRIPT_DLL_API    ESCRIPT_DLL_API
229    virtual void    virtual void
# Line 242  class DataConstant : public DataAbstract Line 234  class DataConstant : public DataAbstract
234       swaps components axis0 and axis1       swaps components axis0 and axis1
235    
236       \param ev - Output - swapped components       \param ev - Output - swapped components
237         \param axis0
238         \param axis1
239    */    */
240    ESCRIPT_DLL_API    ESCRIPT_DLL_API
241    virtual void    virtual void
# Line 277  class DataConstant : public DataAbstract Line 270  class DataConstant : public DataAbstract
270    
271    
272    /**    /**
273        \brief invert square matricies
274        \param out - Where to store the results
275      */
276      ESCRIPT_DLL_API
277      virtual void
278      matrixInverse(DataAbstract* out) const;
279    
280      /**
281       \brief       \brief
282       Return a reference to the underlying DataVector.       Return a reference to the underlying DataVector.
283    */    */
284    ESCRIPT_DLL_API    ESCRIPT_DLL_API
285    DataTypes::ValueType&    DataTypes::ValueType&
286    getVector();    getVectorRW();
287    
288    
289    ESCRIPT_DLL_API    ESCRIPT_DLL_API
290    const DataTypes::ValueType&    const DataTypes::ValueType&
291    getVector() const;    getVectorRO() const;
   
292    
293   protected:   protected:
294    
# Line 298  class DataConstant : public DataAbstract Line 299  class DataConstant : public DataAbstract
299    
300  };  };
301    
 inline  
 DataTypes::ValueType&  
 DataConstant::getVector()  
 {  
   return m_data;  
 }  
   
 inline  
 const DataTypes::ValueType&  
 DataConstant::getVector() const  
 {  
   return m_data;  
 }  
   
   
302  } // end of namespace  } // end of namespace
303  #endif  #endif

Legend:
Removed from v.1811  
changed lines
  Added in v.2742

  ViewVC Help
Powered by ViewVC 1.1.26