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

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

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

revision 2742 by jfenwick, Thu Nov 12 06:03:37 2009 UTC revision 2766 by jfenwick, Mon Nov 23 05:10:53 2009 UTC
# Line 42  DataTagged::DataTagged() Line 42  DataTagged::DataTagged()
42    
43    // create a scalar default value    // create a scalar default value
44    m_data.resize(1,0.,1);    m_data.resize(1,0.,1);
 /*  DataArrayView temp(m_data,DataTypes::ShapeType());  
   setPointDataView(temp);*/  
45  }  }
46    
 // DataTagged::DataTagged(const TagListType& tagKeys,  
 //             const ValueListType& values,  
 //             const DataArrayView& defaultValue,  
 //             const FunctionSpace& what)  
 //   : DataAbstract(what)  
 // {  
 //   // constructor  
 //  
 //   // initialise the array of data values  
 //   // the default value is always the first item in the values list  
 //   int len = defaultValue.noValues();  
 //   m_data.resize(len,0.,len);  
 //   for (int i=0; i<defaultValue.noValues(); i++) {  
 //     m_data[i]=defaultValue.getData(i);  
 //   }  
 //  
 //   // create the data view  
 //   DataArrayView temp(m_data,defaultValue.getShape());  
 //   setPointDataView(temp);  
 //  
 //   // add remaining tags and values  
 //   addTaggedValues(tagKeys,values);  
 // }  
   
47  DataTagged::DataTagged(const FunctionSpace& what,  DataTagged::DataTagged(const FunctionSpace& what,
48                         const DataTypes::ShapeType &shape,                         const DataTypes::ShapeType &shape,
49                         const int tags[],                         const int tags[],
# Line 87  DataTagged::DataTagged(const FunctionSpa Line 61  DataTagged::DataTagged(const FunctionSpa
61    // copy the data    // copy the data
62    m_data=data;    m_data=data;
63    
   // create the view of the data  
 //   DataArrayView tempView(m_data,shape);  
 //   setPointDataView(tempView);  
   
64    // we can't rely on the tag array to give us the number of tags so    // we can't rely on the tag array to give us the number of tags so
65    // use the data we have been passed    // use the data we have been passed
66    int valsize=DataTypes::noValues(shape);    int valsize=DataTypes::noValues(shape);
# Line 496  DataTagged::getSampleDataByTag(int tag) Line 466  DataTagged::getSampleDataByTag(int tag)
466    }    }
467  }  }
468    
469    
470    bool
471    DataTagged::hasNaN() const
472    {
473        for (ValueType::size_type i=0;i<m_data.size();++i)
474        {
475            if (nancheck(m_data[i]))    // can't assume we have new standard NaN checking
476            {
477                return true;
478            }
479        }
480        return false;
481    }
482    
483  string  string
484  DataTagged::toString() const  DataTagged::toString() const
485  {  {

Legend:
Removed from v.2742  
changed lines
  Added in v.2766

  ViewVC Help
Powered by ViewVC 1.1.26