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

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

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

revision 2454 by gross, Tue Feb 17 07:39:16 2009 UTC revision 2455 by jfenwick, Wed Jun 3 03:29:07 2009 UTC
# Line 62  WrappedArray::getElt() const Line 62  WrappedArray::getElt() const
62    
63  inline double  inline double
64  WrappedArray::getElt(unsigned int i) const  WrappedArray::getElt(unsigned int i) const
65  {  {  // __float__ added to deal with numpy. If this causes problems we may have to register a custom converter
66      return boost::python::extract<double>(obj[i]);          return boost::python::extract<double>(obj[i].attr("__float__")());  
67  }  }
68    
69  inline  inline
70  double  double
71  WrappedArray::getElt(unsigned int i, unsigned int j) const  WrappedArray::getElt(unsigned int i, unsigned int j) const
72  {  {
73      return boost::python::extract<double>(obj[i][j]);      return boost::python::extract<double>(obj[i][j].attr("__float__")());
74  }  }
75    
76  inline  inline
77  double  double
78  WrappedArray::getElt(unsigned int i, unsigned int j, unsigned int k) const  WrappedArray::getElt(unsigned int i, unsigned int j, unsigned int k) const
79  {  {
80      return boost::python::extract<double>(obj[i][j][k]);      return boost::python::extract<double>(obj[i][j][k].attr("__float__")());
81  }  }
82    
83  inline  inline
84  double  double
85  WrappedArray::getElt(unsigned int i, unsigned int j, unsigned int k, unsigned int m) const  WrappedArray::getElt(unsigned int i, unsigned int j, unsigned int k, unsigned int m) const
86  {  {
87      return boost::python::extract<double>(obj[i][j][k][m]);      return boost::python::extract<double>(obj[i][j][k][m].attr("__float__")());
88  }  }
89    
90  }  }

Legend:
Removed from v.2454  
changed lines
  Added in v.2455

  ViewVC Help
Powered by ViewVC 1.1.26