/[escript]/branches/trilinos_from_5897/escriptcore/src/DataConstant.h
ViewVC logotype

Diff of /branches/trilinos_from_5897/escriptcore/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 2548 by jfenwick, Mon Jul 20 06:20:06 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    
22  #include <boost/python/numeric.hpp>  #include <boost/python/numeric.hpp>
23    
# Line 31  namespace escript { Line 32  namespace escript {
32     DataConstant stores a single data point which represents the entire     DataConstant stores a single data point which represents the entire
33     function space.     function space.
34  */  */
35  class DataConstant : public DataAbstract  {  class DataConstant : public DataReady  {
36    typedef DataReady parent;
37   public:   public:
38    
39    /**    /**
# Line 46  class DataConstant : public DataAbstract Line 47  class DataConstant : public DataAbstract
47       \param what - Input - A description of what this data object represents.       \param what - Input - A description of what this data object represents.
48    */    */
49    ESCRIPT_DLL_API    ESCRIPT_DLL_API
50    DataConstant(const boost::python::numeric::array& value,    DataConstant(const WrappedArray& value,
51                 const FunctionSpace& what);                 const FunctionSpace& what);
52    
53    
54    /**    /**
55       \brief       \brief
56       Copy constructor. Performs a deep copy.       Copy constructor. Performs a deep copy.
# Line 56  class DataConstant : public DataAbstract Line 58  class DataConstant : public DataAbstract
58    ESCRIPT_DLL_API    ESCRIPT_DLL_API
59    DataConstant(const DataConstant& other);    DataConstant(const DataConstant& other);
60    
 //  /**  
 /*     \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);  
61    
62    /**    /**
63       \brief       \brief
# Line 97  class DataConstant : public DataAbstract Line 87  class DataConstant : public DataAbstract
87                 const DataTypes::ShapeType &shape,                 const DataTypes::ShapeType &shape,
88                 const DataTypes::ValueType &data);                 const DataTypes::ValueType &data);
89    
90    
91      ESCRIPT_DLL_API
92      bool
93      isConstant() const
94      {
95        return true;
96      };
97    
98    
99    /**    /**
100       \brief       \brief
101       Write the data as a string.       Write the data as a string.
# Line 147  class DataConstant : public DataAbstract Line 146  class DataConstant : public DataAbstract
146    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
147                   int dataPointNo) const;                   int dataPointNo) const;
148    
149  //  /**    ESCRIPT_DLL_API
150  /*     \brief    virtual
151       Return a view into the data for the data point specified.    DataTypes::ValueType::size_type
152       \param sampleNo - Input - sample number.    getPointOffset(int sampleNo,
153       \param dataPointNo - Input - data point number for the sample.*/                   int dataPointNo);
 //  */  
 //   ESCRIPT_DLL_API  
 //   virtual  
 //   DataArrayView  
 //   getDataPoint(int sampleNo,  
 //                int dataPointNo);  
154    
155    /**    /**
156       \brief       \brief
# Line 220  class DataConstant : public DataAbstract Line 213  class DataConstant : public DataAbstract
213       Computes the trace of a matrix       Computes the trace of a matrix
214    
215       \param ev - Output - trace of matrix       \param ev - Output - trace of matrix
216         \param axis_offset
217    
218    */    */
219    ESCRIPT_DLL_API    ESCRIPT_DLL_API
# Line 231  class DataConstant : public DataAbstract Line 225  class DataConstant : public DataAbstract
225       Transpose each data point of this Data object around the given axis.       Transpose each data point of this Data object around the given axis.
226    
227       \param ev - Output - transpose of matrix       \param ev - Output - transpose of matrix
228         \param axis_offset
229    */    */
230    ESCRIPT_DLL_API    ESCRIPT_DLL_API
231    virtual void    virtual void
# Line 242  class DataConstant : public DataAbstract Line 236  class DataConstant : public DataAbstract
236       swaps components axis0 and axis1       swaps components axis0 and axis1
237    
238       \param ev - Output - swapped components       \param ev - Output - swapped components
239         \param axis0
240         \param axis1
241    */    */
242    ESCRIPT_DLL_API    ESCRIPT_DLL_API
243    virtual void    virtual void
# Line 282  class DataConstant : public DataAbstract Line 277  class DataConstant : public DataAbstract
277    */    */
278    ESCRIPT_DLL_API    ESCRIPT_DLL_API
279    DataTypes::ValueType&    DataTypes::ValueType&
280    getVector();    getVectorRW();
281    
282    
283    ESCRIPT_DLL_API    ESCRIPT_DLL_API
284    const DataTypes::ValueType&    const DataTypes::ValueType&
285    getVector() const;    getVectorRO() const;
   
286    
287   protected:   protected:
288    
# Line 298  class DataConstant : public DataAbstract Line 293  class DataConstant : public DataAbstract
293    
294  };  };
295    
 inline  
 DataTypes::ValueType&  
 DataConstant::getVector()  
 {  
   return m_data;  
 }  
   
 inline  
 const DataTypes::ValueType&  
 DataConstant::getVector() const  
 {  
   return m_data;  
 }  
   
   
296  } // end of namespace  } // end of namespace
297  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26