/[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 496 by jgs, Tue Feb 7 01:27:14 2006 UTC revision 1946 by jfenwick, Wed Oct 29 05:48:53 2008 UTC
# Line 1  Line 1 
 // $Id$  
1    
2  /*  /*******************************************************
3   ******************************************************************************  *
4   *                                                                            *  * Copyright (c) 2003-2008 by University of Queensland
5   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *  * Earth Systems Science Computational Center (ESSCC)
6   *                                                                            *  * http://www.uq.edu.au/esscc
7   * This software is the property of ACcESS. No part of this code              *  *
8   * may be copied in any form or by any means without the expressed written    *  * Primary Business: Queensland, Australia
9   * consent of ACcESS.  Copying, use or modification of this software          *  * Licensed under the Open Software License version 3.0
10   * by any unauthorised person is illegal unless that person has a software    *  * http://www.opensource.org/licenses/osl-3.0.php
11   * license agreement with ACcESS.                                             *  *
12   *                                                                            *  *******************************************************/
13   ******************************************************************************  
 */  
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 "DataTypes.h"
21    
22  #include <vector>  #include <vector>
23  #include <map>  #include <map>
# Line 45  class DataTagged : public DataAbstract { Line 44  class DataTagged : public DataAbstract {
44    //    //
45    // Types for the lists of tags and values.    // Types for the lists of tags and values.
46    typedef std::vector<int>           TagListType;    typedef std::vector<int>           TagListType;
47    typedef std::vector<DataArrayView> ValueListType;  //  typedef std::vector<DataArrayView> ValueListType;
48    typedef DataArrayView::ValueType   ValueType;    typedef DataTypes::ValueType   ValueType;
49      typedef std::vector<ValueType::ElementType> ValueBatchType;
50    
51    //    //
52    // Map from a tag to an offset into the data array.    // Map from a tag to an offset into the data array.
# 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
64    */    */
65      ESCRIPT_DLL_API
66    DataTagged();    DataTagged();
67    
68    /**    /**
69       \brief       \brief
      Constructor for DataTagged.  
   
      Description:  
      Constructor for DataTagged.  
      \param tagKeys - Input - A vector of integer keys.  
      \param values - Input - A vector of DataArrayViews. If this is empty  
                      all tag values will be assigned a value of zero. If  
                      it contains one value all tag values will be assigned the  
              same value. Otherwise if there is a mismatch between  
              the number of keys and the number of values an exception  
              will be generated.  
      \param defaultValue - Input - Value returned if a requested tag doesn't exist.  
      \param what - Input - A description of what this data represents.  
   */  
   DataTagged(const TagListType& tagKeys,  
              const ValueListType& values,  
          const DataArrayView& defaultValue,  
          const FunctionSpace& what);  
   
   /**  
      \brief  
70       Alternative Constructor for DataTagged.       Alternative Constructor for DataTagged.
71    
72       Description:       Description:
73       Alternative Constructor for DataTagged.       Alternative Constructor for DataTagged.
74       \param what - Input - A description of what this data object represents.       \param what - Input - A description of what this data object represents.
75       \param shape - Input - The shape of each data-point.       \param shape - Input - The shape of each data-point.
76       \param tags - Input - An array of tags, one for each sample number.       \param tags - Input - An array of tags, one for each sample number (starts at tag[1]).
77       \param data - The data values for each tag.       \param data - The data values for each tag.
78        NB: no unit testing yet
79    */    */
80      ESCRIPT_DLL_API
81    DataTagged(const FunctionSpace& what,    DataTagged(const FunctionSpace& what,
82               const DataArrayView::ShapeType &shape,               const DataTypes::ShapeType &shape,
83               const int tags[],               const int tags[],
84               const ValueType &data);               const ValueType& data);
85    
86    /**   /**
87       \brief       \brief
88       Slice Constructor for DataTagged.       Alternative Constructor for DataTagged.
89    
90       Description:       Description:
91       Slice Constructor for DataTagged.       Alternative Constructor for DataTagged.
92       Copies a slice from another DataTagged object.       \param what - Input - A description of what this data object represents.
93       \param other - Input - DataTagged object to copy from.       \param shape - Input - The shape of each data-point.
94       \param region - Input - Region to copy.       \param tags - Input - An vector of tags, one for each sample number.
95    */       \param data - The data values for each tag.
96    DataTagged(const DataTagged& other,  TODO Make sure to document the relationship between tags and data, ie: data also contains the default value
97           const DataArrayView::RegionType& region);   */
98      ESCRIPT_DLL_API
99      DataTagged(const FunctionSpace& what,
100                 const DataTypes::ShapeType &shape,
101                 const TagListType& tags,
102                 const ValueType& data);
103    
104    /**    /**
105       \brief       \brief
106       Copy Constructor for DataTagged.       Copy Constructor for DataTagged.
107       Performs a deep copy from the given DataTagged object.       Performs a deep copy from the given DataTagged object.
108        T
109    */    */
110      ESCRIPT_DLL_API
111    DataTagged(const DataTagged& other);    DataTagged(const DataTagged& other);
112    
113    /**    /**
114       \brief       \brief
115       Copy Constructor for DataTagged.       Copy Constructor for DataTagged.
116       Construct a tagged data from a DataConstant object.       Construct a DataTagged object from a DataConstant object.
117       The default value will be that held by the DataConstant object.       The default value will be the value of the DataConstant object.
118        T
119    */    */
120      ESCRIPT_DLL_API
121    DataTagged(const DataConstant& other);    DataTagged(const DataConstant& other);
122    
123    /**    /**
124       \brief       \brief
125         Copies the tags from a DataTagged into a new Data Tagged and assigns them the default value. ** Not unit tested **
126    
127         This is different from a deep copy because we are not copying shape or other information, just tags.
128         \param what - Input - FunctionSpace for the new DataTagged
129         \param shape - Input - Shape for points in the new DataTagged
130         \param defaultvalue - Input - Default value for new DataTagged
131         \param tagsource - Input - A DataTagged object which supplies the tags.
132      */
133      ESCRIPT_DLL_API
134      DataTagged(const FunctionSpace& what,
135                 const DataTypes::ShapeType& shape,
136             const DataTypes::ValueType& defaultvalue,
137                 const DataTagged* tagsource=0);
138    
139      /**
140         \brief
141         Destructor
142      */
143      ESCRIPT_DLL_API
144      inline virtual
145      ~DataTagged() {};
146    
147      /**
148         \brief Return a deep copy of the current object.
149      */
150      ESCRIPT_DLL_API
151      virtual
152      DataAbstract*
153      deepCopy();
154    
155    
156      /**
157         \brief
158       getSampleDataByTag       getSampleDataByTag
159    
160       Description:       Description:
# Line 137  class DataTagged : public DataAbstract { Line 162  class DataTagged : public DataAbstract {
162       sample will be visible via the returned pointer.       sample will be visible via the returned pointer.
163    
164       ** This provides an interface into the data suitable for legacy C code.       ** This provides an interface into the data suitable for legacy C code.
165         ** NB: need to do array bounds checking when accessing returned value!
166        T
167    */    */
168      ESCRIPT_DLL_API
169    virtual    virtual
170    double*    double*
171    getSampleDataByTag(int tag);    getSampleDataByTag(int tag);
# Line 147  class DataTagged : public DataAbstract { Line 175  class DataTagged : public DataAbstract {
175       Write the data as a string.       Write the data as a string.
176       Writes out each tag, including the default, and the data-point which is       Writes out each tag, including the default, and the data-point which is
177       associated with each tag.       associated with each tag.
178        T
179    */    */
180      ESCRIPT_DLL_API
181    virtual    virtual
182    std::string    std::string
183    toString() const;    toString() const;
184     /**
185         \brief
186         dumps the object into a netCDF file
187      */
188      ESCRIPT_DLL_API
189      virtual
190      void
191      dump(const std::string fileName) const;
192    
193     /**
194         \brief
195        sets all values to zero
196      */
197      ESCRIPT_DLL_API
198      virtual
199      void
200      setToZero();
201    
202    /**    /**
203       \brief       \brief
204       Return the tag number associated with the given data-point number       Return the tag number associated with the given data-point number
205       according to the associated function space.       according to the associated function space.
206        T
207    */    */
208      ESCRIPT_DLL_API
209    virtual    virtual
210    int    int
211    getTagNumber(int dpno);    getTagNumber(int dpno);
# Line 171  class DataTagged : public DataAbstract { Line 220  class DataTagged : public DataAbstract {
220    
221       \param sampleNo - Input - sample number.       \param sampleNo - Input - sample number.
222       \param dataPointNo - Input - data-point number.       \param dataPointNo - Input - data-point number.
223     */      T
224      */
225      ESCRIPT_DLL_API
226    virtual    virtual
227    ValueType::size_type    ValueType::size_type
228    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
229                   int dataPointNo) const;                   int dataPointNo) const;
230    
231    /**  
232    
233     /**
234       \brief       \brief
235       addTaggedValues       addTaggedValues
236    
237       Description:       Description:
238       Add the given tags and values to this DataTagged object, by repeatedly       Add the given tags and values to this DataTagged object.
239       using addTaggedValue for each given tag/value pair.       \param tagKeys - Input - A vector of integer tags.
240       \param tagKeys - Input - A vector of integer keys.       \param values - Input - A vector of doubles. If this is empty, the default value for
241       \param values - Input - A vector of DataArrayViews. If this is empty                       this DataTagged will be used for all tags.
242                        then all given tags will be assigned a value of zero. If                       If it contains one value all tag values will be assigned
243                        it contains one value all tags will be assigned the same value.               this value. Otherwise consecutive tags will be assigned
244                        Otherwise if there is a mismatch between the number of tags and                       consecutive values.  If there is a mismatch between  the
245                        the number of values an exception will be generated.               number of keys and the number of values an exception
246                 will be generated.
247         \param vShape - shape of the datapoints in "values"
248        T
249     */
250      ESCRIPT_DLL_API
251      void
252      addTaggedValues(const TagListType& tagKeys,
253                                const ValueBatchType& values,
254                                const ShapeType& vShape);
255    
256    
257      /**
258       Description:
259       Add the given tags and values to this DataTagged object.
260       \param tagKeys - Input - A vector of integer tags.
261       \param values - Input - A DataVector containing the datapoints.
262                 If this is empty, the default value for
263                         this DataTagged will be used for all tags.
264                         If it contains one value all tag values will be assigned
265                 this value. Otherwise consecutive tags will be assigned
266                         consecutive values.  If there is a mismatch between  the
267                 number of keys and the number of values an exception
268                 will be generated.
269        \param vShape - shape of the datapoints in "values"
270    
271       TODO Makesure this is properly unit tested
272    */    */
273      ESCRIPT_DLL_API
274    void    void
275    addTaggedValues(const TagListType& tagKeys,    addTaggedValues(const TagListType& tagKeys,
276                    const ValueListType& values);                                const ValueType& values,
277                                const ShapeType& vShape);
278    
279    
280    
281    
282    /**    /**
283       \brief       \brief
# Line 202  class DataTagged : public DataAbstract { Line 286  class DataTagged : public DataAbstract {
286       Description:       Description:
287       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
288       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.
289       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer tag.
290       \param value - Input - Single DataArrayView value to be assigned to the tag.       \param pointshape - Shape of the value parameter
291         \param value - Input - Single DataArrayView value to be assigned to the tag.
292         \param dataOffset - Input - Offset of the beginning of the point in the value parameter
293    */    */
294      ESCRIPT_DLL_API
295    void    void
296    addTaggedValue(int tagKey,    addTaggedValue(int tagKey,
297                   const DataArrayView& value);           const DataTypes::ShapeType& pointshape,
298                     const ValueType& value,
299             int dataOffset=0);
300    
301    /**    /**
302       \brief       \brief
303       setTaggedValues       addTag - does not modify the default value for this object. ** Not unit tested **
304    
305       Description:       Description:
306       Set the given tags to the given values in this DataTagged object, by repeatedly       Add a single tag. The default value for this DataTagged will be associated with the tag.
307       using setTaggedValue for each given tag/value pair.       If this tag already has a value associated with it, then no change will be made.
308       \param tagKeys - Input - A vector of integer keys.       \param tagKey - Input - Integer tag.
309       \param values - Input - A vector of DataArrayViews. If this is empty      TODO: Make sure this is unit tested
                       then all given tags will be assigned a value of zero. If  
                       it contains one value all tag values will be assigned the same value.  
                       Otherwise if there is a mismatch between the number of keys and  
                       the number of values an exception will be generated.  
310    */    */
311      ESCRIPT_DLL_API
312    void    void
313    setTaggedValues(const TagListType& tagKeys,    addTag(int tagKey);
                   const ValueListType& values);  
314    
315    /**    /**
316       \brief       \brief
317       setTaggedValue       setTaggedValue
318    
319       Description:       Description:
320       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.
321       associated with it, addTaggedValue will be used to add this tag/value pair.       \param tagKey - Input - Integer tag.
322       \param tagKey - Input - Integer key.       \param pointshape - the shape of the value parameter
323       \param value - Input - Single DataArrayView value to be assigned to the tag.       \param value - Input - Vector storing the datapoint to be assigned to the tag.
324         \param dataOffset - beginning of the datapoint within "value".
325        T
326    */    */
327    virtual    ESCRIPT_DLL_API
328    void    void
329    setTaggedValue(int tagKey,    setTaggedValue(int tagKey,
330                   const DataArrayView& value);           const DataTypes::ShapeType& pointshape,
331                     const ValueType& value,
332             int dataOffset=0);
333    
334    /**    /**
335       \brief       \brief
336       getDataPointByTag       getDataByTag
337    
338       Description:       Return a pointer to the beginning of the datapoint with the specified tag.
339       Return a view into the data-point associated with the given tag.       TODO Eventually these should be inlined.
340       \param tag - Input - Integer key.       \param tag - Input - Integer key.
341         \param i - position in the underlying datastructure
342        T
343      */
344      ESCRIPT_DLL_API
345      DataTypes::ValueType::const_reference
346      getDataByTag(int tag, DataTypes::ValueType::size_type i) const;
347    
348      ESCRIPT_DLL_API
349      DataTypes::ValueType::reference
350      getDataByTag(int tag, DataTypes::ValueType::size_type i);
351    
352    
353      /**
354          \brief
355          getOffsetForTag
356    
357          \param tag
358          \return the offset of the beginning of the datapoint corresponding to tag.
359    
360          Note: If the tag is not valid, the offset of the default value is returned instead.
361    */    */
362    DataArrayView    ESCRIPT_DLL_API
363    getDataPointByTag(int tag) const;    DataTypes::ValueType::size_type
364      getOffsetForTag(int tag) const;
365    
366    
367    /**    /**
368       \brief       \brief
369       getDataPoint       Return a reference to the underlying DataVector.
370      */
371    
372      ESCRIPT_DLL_API
373      DataTypes::ValueType&
374      getVector();
375    
376      ESCRIPT_DLL_API
377      const DataTypes::ValueType&
378      getVector() const;
379    
380    
381    
382      /**
383         \brief
384         getData
385    
386       Description:       Description:
387       Return a view into the data-point specified by the given sample       Return pointer to the data
388       and data-point numbers.      T
      \param sampleNo - Input.  
      \param dataPointNo - Input.  
389    */    */
390    virtual  //   ESCRIPT_DLL_API
391    DataArrayView  //   const DataTypes::ValueType::ElementType*
392    getDataPoint(int sampleNo,  //   getData() const;
                int dataPointNo);  
393    
394    /**    /**
395       \brief       \brief
# Line 274  class DataTagged : public DataAbstract { Line 397  class DataTagged : public DataAbstract {
397    
398       Description:       Description:
399       Return a reference to the tag offset lookup table.       Return a reference to the tag offset lookup table.
400        T
401    */    */
402      ESCRIPT_DLL_API
403    const DataMapType&    const DataMapType&
404    getTagLookup() const;    getTagLookup() const;
405    
# Line 285  class DataTagged : public DataAbstract { Line 410  class DataTagged : public DataAbstract {
410       Description:       Description:
411       Return true if the given tag exists within the DataTagged tag map.       Return true if the given tag exists within the DataTagged tag map.
412    
413       NOTE: The DataTagged tag map does not necessarily coincide with the tag       *** NB: The DataTagged tag map does not necessarily coincide with the tag
414       keys in the associated function space.       keys in the associated function space.
415     */      T
416      */
417      ESCRIPT_DLL_API
418    bool    bool
419    isCurrentTag(int tag) const;    isCurrentTag(int tag) const;
420    
# Line 298  class DataTagged : public DataAbstract { Line 425  class DataTagged : public DataAbstract {
425       Description:       Description:
426       Return the default value. This value is associated with any tag which       Return the default value. This value is associated with any tag which
427       is not explicitly recorded in this DataTagged object's tag map.       is not explicitly recorded in this DataTagged object's tag map.
428         \param i - position in the underlying datastructure
429        T
430    */    */
431    DataArrayView&    ESCRIPT_DLL_API
432    getDefaultValue();    DataTypes::ValueType::reference
433      getDefaultValue(DataTypes::ValueType::size_type i);
434    
435      ESCRIPT_DLL_API
436      DataTypes::ValueType::const_reference
437      getDefaultValue(DataTypes::ValueType::size_type i) const;
438    
439    
440    
   const DataArrayView&  
   getDefaultValue() const;  
441    
442    /**    /**
443       \brief       \brief
444       getLength       getLength
445    
446       Description:       Description:
447       Return the number of doubles stored for the Data.       Return the total number of doubles stored for this DataTagged object.
448        T
449    */    */
450      ESCRIPT_DLL_API
451    virtual    virtual
452    ValueType::size_type    ValueType::size_type
453    getLength() const;    getLength() const;
# Line 321  class DataTagged : public DataAbstract { Line 457  class DataTagged : public DataAbstract {
457       getSlice       getSlice
458    
459       Description:       Description:
460       Factory method that returns a newly created DataTagged object.       Factory method that returns a newly created DataTagged object generated
461       The caller is reponsible for managing the object created.       by taking the specified slice from this DataTagged object.
462         The caller is reponsible for managing the returned object.
463        T
464    */    */
465      ESCRIPT_DLL_API
466    virtual    virtual
467    DataAbstract*    DataAbstract*
468    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataTypes::RegionType& region) const;
469    
470      /**
471         \brief
472         Slice Constructor for DataTagged.
473    
474         Description:
475         Creates a DataTagged object which is the specified slice
476         from the given DataTagged object.
477         \param other - Input - DataTagged object to slice from.
478         \param region - Input - Region to slice.
479        T
480      */
481      ESCRIPT_DLL_API
482      DataTagged(const DataTagged& other,
483             const DataTypes::RegionType& region);
484    
485    /**    /**
486       \brief       \brief
487       setSlice       setSlice
488    
489       Description:       Description:
490       Copy the specified region from the given value into this object.       Copy the given Data object into the specified region in this object.
491       \param value - Input - Data to copy from.       \param other - Input - Data object to copy from.
492       \param region - Input - Region to copy.       \param region - Input - Region to copy into (NB: must have same shape as other!).
493        T
494    */    */
495      ESCRIPT_DLL_API
496    virtual    virtual
497    void    void
498    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* other,
499             const DataArrayView::RegionType& region);             const DataTypes::RegionType& region);
500    
501    
502    /**    /**
503       \brief       \brief
504       reshapeDataPoint       Computes a symmetric matrix (A + AT) / 2
505    
506         \param ev - Output - symmetric matrix
507    
      Description:  
      Reshape the data point only if the data-point is currently rank 0.  
      An exception is thrown if the data-point has rank other than 0.  
      The original data point value is used for all values of the new  
      data point.  
508    */    */
509    void    ESCRIPT_DLL_API
510    reshapeDataPoint(const DataArrayView::ShapeType& shape);    virtual void
511      symmetric(DataAbstract* ev);
512    
513    /**    /**
514      \brief       \brief
515      Archive the underlying data values to the file referenced       Computes a nonsymmetric matrix (A - AT) / 2
516      by ofstream. A count of the number of values expected to be written  
517      is provided as a cross-check.       \param ev - Output - nonsymmetric matrix
518    
     The return value indicates success (0) or otherwise (1).  
519    */    */
520    int    ESCRIPT_DLL_API
521    archiveData(std::ofstream& archiveFile,    virtual void
522                const DataArrayView::ValueType::size_type noValues) const;    nonsymmetric(DataAbstract* ev);
523    
524    /**    /**
525      \brief       \brief
526      Extract the number of values specified by noValues from the file       Computes the trace of a matrix
527      referenced by ifstream to the underlying data structure.  
528         \param ev - Output - the trace of a matrix
529    
530      */
531      ESCRIPT_DLL_API
532      virtual void
533      trace(DataAbstract* ev, int axis_offset);
534    
535      /**
536         \brief
537         swaps components axis0 and axis1
538    
539         \param ev - Output - swapped components
540    
541      */
542      ESCRIPT_DLL_API
543      virtual void
544      swapaxes(DataAbstract* ev, int axis0, int axis1);
545    
546      /**
547         \brief
548         Transpose each data point of this Data object around the given axis.
549    
550         \param ev - Output - the transpose of a matrix
551    
552      */
553      ESCRIPT_DLL_API
554      virtual void
555      transpose(DataAbstract* ev, int axis_offset);
556    
557      /**
558         \brief
559         solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
560    
561         \param ev - Output - eigenvalues in increasing order at each data point
562    
563      */
564      ESCRIPT_DLL_API
565      virtual void
566      eigenvalues(DataAbstract* ev);
567    
568      /**
569         \brief
570         solves the eigenvalue problem this*V=ev*V for the eigenvalues ev and eigenvectors V
571    
572         \param ev - Output - eigenvalues in increasing order at each data point
573         \param V - Output - corresponding eigenvectors. They are normalized such that their length is one
574                             and the first nonzero component is positive.
575         \param tol - Input - eigenvalue with relative distance tol are treated as equal.
576    
     The return value indicates success (0) or otherwise (1).  
577    */    */
578    int  
579    extractData(std::ifstream& archiveFile,    ESCRIPT_DLL_API
580                const DataArrayView::ValueType::size_type noValues);    virtual void
581      eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13);
582    
583    
584      /**
585         \brief  Returns the offset in the structure which stores the default value
586      */
587      ESCRIPT_DLL_API
588      DataTypes::ValueType::size_type
589      getDefaultOffset() const;
590    
591   protected:   protected:
592    
# Line 404  DataTagged::isCurrentTag(int tag) const Line 614  DataTagged::isCurrentTag(int tag) const
614    return (pos!=m_offsetLookup.end());    return (pos!=m_offsetLookup.end());
615  }  }
616    
617    // inline
618    // DataArrayView&
619    // DataTagged::getDefaultValue()
620    // {
621    //   // The default value is always the first value.
622    //   return getPointDataView();
623    // }
624    
625    // inline
626    // const DataArrayView&
627    // DataTagged::getDefaultValue() const
628    // {
629    //   // The default value is always the first value.
630    //   return getPointDataView();
631    // }
632    
633    
634    inline
635    DataTypes::ValueType::size_type
636    DataTagged::getDefaultOffset() const
637    {
638      return m_defaultValueOffset;  
639    }
640    
641  inline  inline
642  DataArrayView&  DataTypes::ValueType::reference
643  DataTagged::getDefaultValue()  DataTagged::getDefaultValue(DataTypes::ValueType::size_type i)
644  {  {
645    // The default value is always the first value.      return getVector()[i];
   return getPointDataView();  
646  }  }
647    
648  inline  inline
649  const DataArrayView&  DataTypes::ValueType::const_reference
650  DataTagged::getDefaultValue() const  DataTagged::getDefaultValue(DataTypes::ValueType::size_type i) const
651  {  {
652    // The default value is always the first value.      return getVector()[i];
   return getPointDataView();  
653  }  }
654    
655    
656    
657    
658    // inline
659    // const DataTypes::ValueType::ElementType*
660    // DataTagged::getData() const
661    // {
662    //    return &(m_data[0]);
663    // }
664    
665  inline  inline
666  const DataTagged::DataMapType&  const DataTagged::DataMapType&
667  DataTagged::getTagLookup() const  DataTagged::getTagLookup() const
# Line 428  DataTagged::getTagLookup() const Line 670  DataTagged::getTagLookup() const
670  }  }
671    
672  inline  inline
673  DataArrayView::ValueType::size_type  DataTypes::ValueType::size_type
674  DataTagged::getLength() const  DataTagged::getLength() const
675  {  {
676    return m_data.size();    return m_data.size();

Legend:
Removed from v.496  
changed lines
  Added in v.1946

  ViewVC Help
Powered by ViewVC 1.1.26