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

Diff of /trunk/escript/src/DataTagged.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 508 by jgs, Thu Feb 9 06:13:07 2006 UTC revision 509 by jgs, Fri Feb 10 03:24:44 2006 UTC
# Line 58  class DataTagged : public DataAbstract { Line 58  class DataTagged : public DataAbstract {
58    
59       Description:       Description:
60       Default constructor for DataTagged. Creates a DataTagged object for which       Default constructor for DataTagged. Creates a DataTagged object for which
61       the only data-point is a scalar data-point with value 0.0. All tags       the default data-point is a scalar data-point with value 0.0, and no other
62       will map to this single data-point.       tag values are stored.
63      T      T
64    */    */
65    DataTagged();    DataTagged();
# Line 70  class DataTagged : public DataAbstract { Line 70  class DataTagged : public DataAbstract {
70    
71       Description:       Description:
72       Constructor for DataTagged.       Constructor for DataTagged.
73       \param tagKeys - Input - A vector of integer keys.       \param tagKeys - Input - A vector of integer tags.
74       \param values - Input - A vector of DataArrayViews. If this is empty       \param values - Input - A vector of DataArrayViews. If this is empty
75                       all tag values will be assigned a value of zero. If                       all tag values will be assigned a scalar data-point of value
76                       it contains one value all tag values will be assigned the                       0. If it contains one value all tag values will be assigned
77               same value. Otherwise if there is a mismatch between               this value. Otherwise consecutive tags will be assigned
78               the number of keys and the number of values an exception                       consecutive values.  If there is a mismatch between  the
79                 number of keys and the number of values an exception
80               will be generated.               will be generated.
81       \param defaultValue - Input - Value returned if a requested tag doesn't exist.       \param defaultValue - Input - Value returned if a requested tag doesn't exist.
82       \param what - Input - A description of what this data represents.       \param what - Input - A description of what this data represents.
# Line 126  class DataTagged : public DataAbstract { Line 127  class DataTagged : public DataAbstract {
127    /**    /**
128       \brief       \brief
129       Copy Constructor for DataTagged.       Copy Constructor for DataTagged.
130       Construct a tagged data from a DataConstant object.       Construct a DataTagged object from a DataConstant object.
131       The default value will be that held by the DataConstant object.       The default value will be the value of the DataConstant object.
132      T      T
133    */    */
134    DataTagged(const DataConstant& other);    DataTagged(const DataConstant& other);
# Line 191  class DataTagged : public DataAbstract { Line 192  class DataTagged : public DataAbstract {
192       addTaggedValues       addTaggedValues
193    
194       Description:       Description:
195       Add the given tags and values to this DataTagged object, by repeatedly       Add the given tags and values to this DataTagged object.
      using addTaggedValue for each given tag/value pair.  
196       \param tagKeys - Input - A vector of integer tags.       \param tagKeys - Input - A vector of integer tags.
197       \param values - Input - A vector of DataArrayViews. If this is empty       \param values - Input - A vector of DataArrayViews. If this is empty
198                        then all given tags will be assigned a value of zero. If                       all tag values will be assigned a scalar data-point of value
199                        it contains one value all tags will be assigned the same value.                       0. If it contains one value all tag values will be assigned
200                        Otherwise if there is a mismatch between the number of tags and               this value. Otherwise consecutive tags will be assigned
201                        the number of values an exception will be generated.                       consecutive values.  If there is a mismatch between  the
202                 number of keys and the number of values an exception
203                 will be generated.
204      T      T
205    */    */
206    void    void
# Line 212  class DataTagged : public DataAbstract { Line 214  class DataTagged : public DataAbstract {
214       Description:       Description:
215       Add a single tag and value to this DataTagged object. If this tag already has       Add a single tag and value to this DataTagged object. If this tag already has
216       a value associated with it, setTaggedValue will be used to update this value.       a value associated with it, setTaggedValue will be used to update this value.
217       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer tag.
218       \param value - Input - Single DataArrayView value to be assigned to the tag.       \param value - Input - Single DataArrayView value to be assigned to the tag.
219      T      T
220    */    */
# Line 225  class DataTagged : public DataAbstract { Line 227  class DataTagged : public DataAbstract {
227       setTaggedValues       setTaggedValues
228    
229       Description:       Description:
230       Set the given tags to the given values in this DataTagged object, by repeatedly       Set the given tags to the given values in this DataTagged object.
231       using setTaggedValue for each given tag/value pair.       \param tagKeys - Input - A vector of integer tag.
      \param tagKeys - Input - A vector of integer keys.  
232       \param values - Input - A vector of DataArrayViews. If this is empty       \param values - Input - A vector of DataArrayViews. If this is empty
233                        then all given tags will be assigned a value of zero. If                       all tag values will be assigned a scalar data-point of value
234                        it contains one value all tag values will be assigned the same value.                       0. If it contains one value all tag values will be assigned
235                        Otherwise if there is a mismatch between the number of keys and               this value. Otherwise consecutive tags will be assigned
236                        the number of values an exception will be generated.                       consecutive values.  If there is a mismatch between  the
237                 number of keys and the number of values an exception
238                 will be generated.
239      T      T
240    */    */
241    void    void
# Line 244  class DataTagged : public DataAbstract { Line 247  class DataTagged : public DataAbstract {
247       setTaggedValue       setTaggedValue
248    
249       Description:       Description:
250       Assign the given value to the given tag. If this tag does not already have a value       Assign the given value to the given tag.
251       associated with it, addTaggedValue will be used to add this tag/value pair.       \param tagKey - Input - Integer tag.
      \param tagKey - Input - Integer key.  
252       \param value - Input - Single DataArrayView value to be assigned to the tag.       \param value - Input - Single DataArrayView value to be assigned to the tag.
253      T      T
254    */    */
# Line 260  class DataTagged : public DataAbstract { Line 262  class DataTagged : public DataAbstract {
262       getDataPointByTag       getDataPointByTag
263    
264       Description:       Description:
265       Return a view into the data-point associated with the given tag.       Return data-point associated with the given tag as a DataArrayView.
266       \param tag - Input - Integer key.       \param tag - Input - Integer key.
267      T      T
268    */    */
# Line 272  class DataTagged : public DataAbstract { Line 274  class DataTagged : public DataAbstract {
274       getDataPoint       getDataPoint
275    
276       Description:       Description:
277       Return a view into the data-point specified by the given sample       Return the data-point specified by the given sample and data-point
278       and data-point numbers.       numbers as a DataArrayView.
279       \param sampleNo - Input.       \param sampleNo - Input.
280       \param dataPointNo - Input.       \param dataPointNo - Input.
281      T      T
# Line 301  class DataTagged : public DataAbstract { Line 303  class DataTagged : public DataAbstract {
303       Description:       Description:
304       Return true if the given tag exists within the DataTagged tag map.       Return true if the given tag exists within the DataTagged tag map.
305    
306       NOTE: The DataTagged tag map does not necessarily coincide with the tag       *** NB: The DataTagged tag map does not necessarily coincide with the tag
307       keys in the associated function space.       keys in the associated function space.
308      T      T
309    */    */
# Line 328  class DataTagged : public DataAbstract { Line 330  class DataTagged : public DataAbstract {
330       getLength       getLength
331    
332       Description:       Description:
333       Return the number of doubles stored for the Data.       Return the total number of doubles stored for this DataTagged object.
334      T      T
335    */    */
336    virtual    virtual
# Line 366  class DataTagged : public DataAbstract { Line 368  class DataTagged : public DataAbstract {
368       reshapeDataPoint       reshapeDataPoint
369    
370       Description:       Description:
371       Reshape the data point only if the data-point is currently rank 0.       Reshape each data-point in this object to the given shape, only
372       An exception is thrown if the data-point has rank other than 0.       if current data-points are scalars. An exception is thrown if
373       The original data point value is used for all values of the new       the current data-points have rank other than 0.
374       data point.       The original values of the data-points are used for all values
375         of the new data-points.
376        T
377    */    */
378    void    void
379    reshapeDataPoint(const DataArrayView::ShapeType& shape);    reshapeDataPoint(const DataArrayView::ShapeType& shape);
380    
381    /**    /**
382      \brief       \brief
383      Archive the underlying data values to the file referenced       Archive the underlying data values to the file referenced
384      by ofstream. A count of the number of values expected to be written       by ofstream. A count of the number of values expected to be written
385      is provided as a cross-check.       is provided as a cross-check.
386    
387      The return value indicates success (0) or otherwise (1).       The return value indicates success (0) or otherwise (1).
388    */    */
389    int    int
390    archiveData(std::ofstream& archiveFile,    archiveData(std::ofstream& archiveFile,
391                const DataArrayView::ValueType::size_type noValues) const;                const DataArrayView::ValueType::size_type noValues) const;
392    
393    /**    /**
394      \brief       \brief
395      Extract the number of values specified by noValues from the file       Extract the number of values specified by noValues from the file
396      referenced by ifstream to the underlying data structure.       referenced by ifstream to the underlying data structure.
397    
398      The return value indicates success (0) or otherwise (1).       The return value indicates success (0) or otherwise (1).
399    */    */
400    int    int
401    extractData(std::ifstream& archiveFile,    extractData(std::ifstream& archiveFile,

Legend:
Removed from v.508  
changed lines
  Added in v.509

  ViewVC Help
Powered by ViewVC 1.1.26