14 |
|
|
15 |
#if !defined escript_DataTagged_20040615_H |
#if !defined escript_DataTagged_20040615_H |
16 |
#define escript_DataTagged_20040615_H |
#define escript_DataTagged_20040615_H |
17 |
|
#include "system_dep.h" |
18 |
|
|
19 |
#include "DataAbstract.h" |
#include "DataAbstract.h" |
20 |
#include "DataArrayView.h" |
#include "DataArrayView.h" |
61 |
tag values are stored. |
tag values are stored. |
62 |
T |
T |
63 |
*/ |
*/ |
64 |
|
ESCRIPT_DLL_API |
65 |
DataTagged(); |
DataTagged(); |
66 |
|
|
67 |
/** |
/** |
82 |
\param what - Input - A description of what this data represents. |
\param what - Input - A description of what this data represents. |
83 |
T |
T |
84 |
*/ |
*/ |
85 |
|
ESCRIPT_DLL_API |
86 |
DataTagged(const TagListType& tagKeys, |
DataTagged(const TagListType& tagKeys, |
87 |
const ValueListType& values, |
const ValueListType& values, |
88 |
const DataArrayView& defaultValue, |
const DataArrayView& defaultValue, |
100 |
\param data - The data values for each tag. |
\param data - The data values for each tag. |
101 |
NB: no unit testing yet |
NB: no unit testing yet |
102 |
*/ |
*/ |
103 |
|
ESCRIPT_DLL_API |
104 |
DataTagged(const FunctionSpace& what, |
DataTagged(const FunctionSpace& what, |
105 |
const DataArrayView::ShapeType &shape, |
const DataArrayView::ShapeType &shape, |
106 |
const int tags[], |
const int tags[], |
108 |
|
|
109 |
/** |
/** |
110 |
\brief |
\brief |
111 |
|
Alternative Constructor for DataTagged. |
112 |
|
|
113 |
|
Description: |
114 |
|
Alternative Constructor for DataTagged. |
115 |
|
\param what - Input - A description of what this data object represents. |
116 |
|
\param shape - Input - The shape of each data-point. |
117 |
|
\param tags - Input - An vector of tags, one for each sample number. |
118 |
|
\param data - The data values for each tag. |
119 |
|
NB: no unit testing yet |
120 |
|
*/ |
121 |
|
ESCRIPT_DLL_API |
122 |
|
DataTagged(const FunctionSpace& what, |
123 |
|
const DataArrayView::ShapeType &shape, |
124 |
|
const TagListType& tags, |
125 |
|
const ValueType& data); |
126 |
|
|
127 |
|
/** |
128 |
|
\brief |
129 |
Copy Constructor for DataTagged. |
Copy Constructor for DataTagged. |
130 |
Performs a deep copy from the given DataTagged object. |
Performs a deep copy from the given DataTagged object. |
131 |
T |
T |
132 |
*/ |
*/ |
133 |
|
ESCRIPT_DLL_API |
134 |
DataTagged(const DataTagged& other); |
DataTagged(const DataTagged& other); |
135 |
|
|
136 |
/** |
/** |
140 |
The default value will be the value of the DataConstant object. |
The default value will be the value of the DataConstant object. |
141 |
T |
T |
142 |
*/ |
*/ |
143 |
|
ESCRIPT_DLL_API |
144 |
DataTagged(const DataConstant& other); |
DataTagged(const DataConstant& other); |
145 |
|
|
146 |
/** |
/** |
155 |
** NB: need to do array bounds checking when accessing returned value! |
** NB: need to do array bounds checking when accessing returned value! |
156 |
T |
T |
157 |
*/ |
*/ |
158 |
|
ESCRIPT_DLL_API |
159 |
virtual |
virtual |
160 |
double* |
double* |
161 |
getSampleDataByTag(int tag); |
getSampleDataByTag(int tag); |
167 |
associated with each tag. |
associated with each tag. |
168 |
T |
T |
169 |
*/ |
*/ |
170 |
|
ESCRIPT_DLL_API |
171 |
virtual |
virtual |
172 |
std::string |
std::string |
173 |
toString() const; |
toString() const; |
178 |
according to the associated function space. |
according to the associated function space. |
179 |
T |
T |
180 |
*/ |
*/ |
181 |
|
ESCRIPT_DLL_API |
182 |
virtual |
virtual |
183 |
int |
int |
184 |
getTagNumber(int dpno); |
getTagNumber(int dpno); |
195 |
\param dataPointNo - Input - data-point number. |
\param dataPointNo - Input - data-point number. |
196 |
T |
T |
197 |
*/ |
*/ |
198 |
|
ESCRIPT_DLL_API |
199 |
virtual |
virtual |
200 |
ValueType::size_type |
ValueType::size_type |
201 |
getPointOffset(int sampleNo, |
getPointOffset(int sampleNo, |
217 |
will be generated. |
will be generated. |
218 |
T |
T |
219 |
*/ |
*/ |
220 |
|
ESCRIPT_DLL_API |
221 |
void |
void |
222 |
addTaggedValues(const TagListType& tagKeys, |
addTaggedValues(const TagListType& tagKeys, |
223 |
const ValueListType& values); |
const ValueListType& values); |
233 |
\param value - Input - Single DataArrayView value to be assigned to the tag. |
\param value - Input - Single DataArrayView value to be assigned to the tag. |
234 |
T |
T |
235 |
*/ |
*/ |
236 |
|
ESCRIPT_DLL_API |
237 |
void |
void |
238 |
addTaggedValue(int tagKey, |
addTaggedValue(int tagKey, |
239 |
const DataArrayView& value); |
const DataArrayView& value); |
254 |
will be generated. |
will be generated. |
255 |
T |
T |
256 |
*/ |
*/ |
257 |
|
ESCRIPT_DLL_API |
258 |
void |
void |
259 |
setTaggedValues(const TagListType& tagKeys, |
setTaggedValues(const TagListType& tagKeys, |
260 |
const ValueListType& values); |
const ValueListType& values); |
269 |
\param value - Input - Single DataArrayView value to be assigned to the tag. |
\param value - Input - Single DataArrayView value to be assigned to the tag. |
270 |
T |
T |
271 |
*/ |
*/ |
272 |
|
ESCRIPT_DLL_API |
273 |
virtual |
virtual |
274 |
void |
void |
275 |
setTaggedValue(int tagKey, |
setTaggedValue(int tagKey, |
284 |
\param tag - Input - Integer key. |
\param tag - Input - Integer key. |
285 |
T |
T |
286 |
*/ |
*/ |
287 |
|
ESCRIPT_DLL_API |
288 |
DataArrayView |
DataArrayView |
289 |
getDataPointByTag(int tag) const; |
getDataPointByTag(int tag) const; |
290 |
|
|
299 |
\param dataPointNo - Input. |
\param dataPointNo - Input. |
300 |
T |
T |
301 |
*/ |
*/ |
302 |
|
ESCRIPT_DLL_API |
303 |
virtual |
virtual |
304 |
DataArrayView |
DataArrayView |
305 |
getDataPoint(int sampleNo, |
getDataPoint(int sampleNo, |
313 |
Return a reference to the tag offset lookup table. |
Return a reference to the tag offset lookup table. |
314 |
T |
T |
315 |
*/ |
*/ |
316 |
|
ESCRIPT_DLL_API |
317 |
const DataMapType& |
const DataMapType& |
318 |
getTagLookup() const; |
getTagLookup() const; |
319 |
|
|
328 |
keys in the associated function space. |
keys in the associated function space. |
329 |
T |
T |
330 |
*/ |
*/ |
331 |
|
ESCRIPT_DLL_API |
332 |
bool |
bool |
333 |
isCurrentTag(int tag) const; |
isCurrentTag(int tag) const; |
334 |
|
|
341 |
is not explicitly recorded in this DataTagged object's tag map. |
is not explicitly recorded in this DataTagged object's tag map. |
342 |
T |
T |
343 |
*/ |
*/ |
344 |
|
ESCRIPT_DLL_API |
345 |
DataArrayView& |
DataArrayView& |
346 |
getDefaultValue(); |
getDefaultValue(); |
347 |
|
|
348 |
|
ESCRIPT_DLL_API |
349 |
const DataArrayView& |
const DataArrayView& |
350 |
getDefaultValue() const; |
getDefaultValue() const; |
351 |
|
|
357 |
Return the total number of doubles stored for this DataTagged object. |
Return the total number of doubles stored for this DataTagged object. |
358 |
T |
T |
359 |
*/ |
*/ |
360 |
|
ESCRIPT_DLL_API |
361 |
virtual |
virtual |
362 |
ValueType::size_type |
ValueType::size_type |
363 |
getLength() const; |
getLength() const; |
372 |
The caller is reponsible for managing the returned object. |
The caller is reponsible for managing the returned object. |
373 |
T |
T |
374 |
*/ |
*/ |
375 |
|
ESCRIPT_DLL_API |
376 |
virtual |
virtual |
377 |
DataAbstract* |
DataAbstract* |
378 |
getSlice(const DataArrayView::RegionType& region) const; |
getSlice(const DataArrayView::RegionType& region) const; |
388 |
\param region - Input - Region to slice. |
\param region - Input - Region to slice. |
389 |
T |
T |
390 |
*/ |
*/ |
391 |
|
ESCRIPT_DLL_API |
392 |
DataTagged(const DataTagged& other, |
DataTagged(const DataTagged& other, |
393 |
const DataArrayView::RegionType& region); |
const DataArrayView::RegionType& region); |
394 |
|
|
402 |
\param region - Input - Region to copy into (NB: must have same shape as other!). |
\param region - Input - Region to copy into (NB: must have same shape as other!). |
403 |
T |
T |
404 |
*/ |
*/ |
405 |
|
ESCRIPT_DLL_API |
406 |
virtual |
virtual |
407 |
void |
void |
408 |
setSlice(const DataAbstract* other, |
setSlice(const DataAbstract* other, |
420 |
of the new data-points. |
of the new data-points. |
421 |
T |
T |
422 |
*/ |
*/ |
423 |
|
ESCRIPT_DLL_API |
424 |
void |
void |
425 |
reshapeDataPoint(const DataArrayView::ShapeType& shape); |
reshapeDataPoint(const DataArrayView::ShapeType& shape); |
426 |
|
|
432 |
|
|
433 |
The return value indicates success (0) or otherwise (1). |
The return value indicates success (0) or otherwise (1). |
434 |
*/ |
*/ |
435 |
|
ESCRIPT_DLL_API |
436 |
int |
int |
437 |
archiveData(std::ofstream& archiveFile, |
archiveData(std::ofstream& archiveFile, |
438 |
const DataArrayView::ValueType::size_type noValues) const; |
const DataArrayView::ValueType::size_type noValues) const; |
444 |
|
|
445 |
The return value indicates success (0) or otherwise (1). |
The return value indicates success (0) or otherwise (1). |
446 |
*/ |
*/ |
447 |
|
ESCRIPT_DLL_API |
448 |
int |
int |
449 |
extractData(std::ifstream& archiveFile, |
extractData(std::ifstream& archiveFile, |
450 |
const DataArrayView::ValueType::size_type noValues); |
const DataArrayView::ValueType::size_type noValues); |
456 |
\param ev - Output - eigenvalues in increasing order at each data point |
\param ev - Output - eigenvalues in increasing order at each data point |
457 |
|
|
458 |
*/ |
*/ |
459 |
|
ESCRIPT_DLL_API |
460 |
virtual void |
virtual void |
461 |
eigenvalues(DataAbstract* ev); |
eigenvalues(DataAbstract* ev); |
462 |
|
|
471 |
|
|
472 |
*/ |
*/ |
473 |
|
|
474 |
|
ESCRIPT_DLL_API |
475 |
virtual void |
virtual void |
476 |
eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13); |
eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13); |
477 |
|
|