/[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 1796 by jfenwick, Wed Sep 17 01:45:46 2008 UTC revision 2742 by jfenwick, Thu Nov 12 06:03:37 2009 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2009 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  #if !defined escript_DataConstant_20040323_H  #if !defined escript_DataConstant_20040323_H
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 32  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 47  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 57  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 98  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 105  class DataConstant : public DataAbstract Line 101  class DataConstant : public DataAbstract
101    ESCRIPT_DLL_API    ESCRIPT_DLL_API
102    std::string    std::string
103    toString() const;    toString() const;
104    
105      /**
106         \brief Return a deep copy of the current object.
107      */
108      ESCRIPT_DLL_API
109      virtual
110      DataAbstract*
111      deepCopy();
112    
113    
114   /**   /**
115       \brief       \brief
116       dumps the object into a netCDF file       dumps the object into a netCDF file
# Line 138  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 211  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 222  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 233  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 268  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 289  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.1796  
changed lines
  Added in v.2742

  ViewVC Help
Powered by ViewVC 1.1.26