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

Annotation of /trunk/escript/src/DataEmpty.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3981 - (hide annotations)
Fri Sep 21 02:47:54 2012 UTC (7 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 4028 byte(s)
First pass of updating copyright notices
1 jgs 121
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 jfenwick 3911 * Copyright (c) 2003-2012 by University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
7     * Primary Business: Queensland, Australia
8     * Licensed under the Open Software License version 3.0
9     * http://www.opensource.org/licenses/osl-3.0.php
10     *
11 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     * Development since 2012 by School of Earth Sciences
13     *
14     *****************************************************************************/
15 ksteube 1312
16 ksteube 1811
17 jgs 102 #if !defined escript_DataEmpty_20040726_H
18 jgs 82 #define escript_DataEmpty_20040726_H
19 woo409 757 #include "system_dep.h"
20 jgs 82
21 jfenwick 2005 #include "DataReady.h"
22 jgs 82
23     namespace escript {
24    
25     /**
26     \brief
27 jgs 102 Implements the DataAbstract interface for an empty Data object.
28 jgs 82
29     Description:
30 jgs 102 Implements the DataAbstract interface for an empty Data object.
31 jgs 82 */
32 jgs 121
33 jfenwick 2005 class DataEmpty : public DataReady {
34     typedef DataReady parent;
35 jgs 82 public:
36    
37     /**
38     \brief
39 jgs 102 Default constructor for DataEmpty.
40 jgs 82
41     Description:
42 jgs 102 Default constructor for DataEmpty.
43 jgs 82
44     */
45 woo409 757 ESCRIPT_DLL_API
46 jgs 82 DataEmpty();
47 jgs 102
48 jgs 82 /**
49     \brief
50 jgs 102 Destructor for DataEmpty.
51 jgs 82 */
52 woo409 757 ESCRIPT_DLL_API
53 jgs 102 virtual
54     ~DataEmpty();
55    
56 jgs 82 /**
57     \brief
58 jgs 102 Return a textual representation of the Data object.
59 jgs 82 */
60 woo409 757 ESCRIPT_DLL_API
61 jgs 102 virtual
62     std::string
63     toString() const;
64    
65 jgs 82 /**
66 jfenwick 1799 \brief Return a deep copy of the current object.
67     */
68     ESCRIPT_DLL_API
69     virtual
70     DataAbstract*
71     deepCopy();
72    
73    
74     /**
75 jgs 82 \brief
76 jgs 121 Return the offset for the given sample.
77     NB: This will throw an exception as obviously an empty Data object contains no
78     samples. An implementation is required by parent DataAbstract class.
79 jgs 102 \param sampleNo - Input - Sample number.
80     \param dataPointNo - Input - data-point number.
81 jgs 82 */
82 woo409 757 ESCRIPT_DLL_API
83 jgs 102 virtual
84 jfenwick 1796 DataTypes::ValueType::size_type
85 jgs 102 getPointOffset(int sampleNo,
86     int dataPointNo) const;
87    
88 jfenwick 2005 ESCRIPT_DLL_API
89     virtual
90     DataTypes::ValueType::size_type
91     getPointOffset(int sampleNo,
92     int dataPointNo);
93    
94 jgs 102 /**
95 jgs 82 \brief
96 jgs 102 Return the number of doubles stored for the Data object.
97 jgs 121 As this is an empty Data object, this method will always return 0.
98 jgs 82 */
99 woo409 757 ESCRIPT_DLL_API
100 jgs 102 virtual
101     ValueType::size_type
102     getLength() const;
103    
104 jgs 82 /**
105     \brief
106 jgs 102 Factory method that returns a newly created DataEmpty sliced from the
107     current Data object according to the specified region.
108 jgs 121 NB: This will throw an exception as obviously an empty Data object contains no
109     data to slice from. An implementation is required by parent DataAbstract class.
110 jgs 82 */
111 woo409 757 ESCRIPT_DLL_API
112 jgs 102 virtual
113     DataAbstract*
114 jfenwick 1796 getSlice(const DataTypes::RegionType& region) const;
115 jgs 102
116     /**
117 jgs 82 \brief
118 jgs 102 Set the current Data object according to the specified slice from the
119     given input value.
120 jgs 121 NB: This will throw an exception as obviously an empty Data object contains no
121     data to slice to. An implementation is required by parent DataAbstract class.
122 jgs 82 \param value Input - Data to copy from
123     \param region Input - Region to copy.
124     */
125 woo409 757 ESCRIPT_DLL_API
126 jgs 102 virtual
127     void
128     setSlice(const DataAbstract* value,
129 jfenwick 1796 const DataTypes::RegionType& region);
130 jgs 102
131 jfenwick 2742 /**
132     \brief invert square matricies
133     \param out - Where to store the results
134 jfenwick 2792 \return errorcode (0 indicates success)
135 jfenwick 2742 */
136     ESCRIPT_DLL_API
137 jfenwick 2792 int
138 jfenwick 2742 matrixInverse(DataAbstract* out) const;
139 jfenwick 1803
140     void
141     dump(const std::string fileName) const;
142    
143 jfenwick 2766 ESCRIPT_DLL_API
144     bool
145     hasNaN() const
146     {
147     return false;
148     }
149 jgs 82 protected:
150    
151 jfenwick 1796 /**
152     \brief Provide access to underlying storage. Internal use only!
153     */
154     ESCRIPT_DLL_API
155     virtual DataTypes::ValueType&
156 jfenwick 2271 getVectorRW();
157 jfenwick 1796
158 jfenwick 2271
159 jfenwick 1796 ESCRIPT_DLL_API
160     virtual const DataTypes::ValueType&
161 jfenwick 2271 getVectorRO() const;
162 jfenwick 1796
163 jfenwick 2271
164 jgs 82 private:
165 jgs 102
166 jfenwick 1796 // /**
167     /* \brief
168 jgs 121 Throw a standard exception. This function is called if an attempt
169 jfenwick 1796 is made to use functions of DataEmpty that are not valid.*/
170     // */
171     // void
172     // throwStandardException(const std::string& functionName) const;
173 jgs 121
174 jgs 82 };
175    
176     } // end of namespace
177 jgs 121
178 jgs 82 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26