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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26