Discussion:
[Pyublas] 2 patches
Neal Becker
2010-06-11 22:27:21 UTC
Permalink
I needed the default constructor to allow pyublas::numpy_strided_vector to be
used with boost::iterator_adapator

Don't recall what the first patch is for

diff --git a/src/cpp/pyublas/numpy.hpp b/src/cpp/pyublas/numpy.hpp
index 90acfee..ba2b393 100644
--- a/src/cpp/pyublas/numpy.hpp
+++ b/src/cpp/pyublas/numpy.hpp
@@ -171,6 +171,15 @@ namespace pyublas
get_typenum(T())));
}

+ numpy_array(int ndim_, const npy_intp *dims_, T* data)
+ {
+ m_numpy_array = boost::python::handle<>(
+ PyArray_SimpleNewFromData(
+ ndim_,
+ const_cast<npy_intp *>(dims_),
+ get_typenum(T()), data));
+ }
+
numpy_array(size_type n, const value_type &v)
{
if (n)
@@ -868,6 +877,8 @@ namespace pyublas
typedef typename self_t::difference_type difference_type;
typedef typename numpy_strided_vector<T>::stride_type stride_type;
:

+ numpy_strided_vec_iterator() {}
+
numpy_strided_vec_iterator(T *it, stride_type s)
: stride(s), it(it)
{ }
Andreas Kloeckner
2010-06-19 21:45:39 UTC
Permalink
Post by Neal Becker
I needed the default constructor to allow pyublas::numpy_strided_vector to be
used with boost::iterator_adapator
Don't recall what the first patch is for
Applied.

Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyublas/attachments/20100619/7deb9dea/attachment.pgp>
Loading...