Post by Andreas KlöcknerPost by Neal BeckerPost by Andreas KlöcknerWhat was the breakage? Can you try/have you tried the version that's in
git now?
Andreas
Can't seem to reproduce it. The current version compiles all my code.
Excellent. :)
Post by Neal BeckerThe
// typename boost::mpl::if_<boost::is_const<T>,
// const T,
// T
// >::type,
doesn't seem to be needed, just replace with T.
Already done.
Andreas
How's this?
-------------- next part --------------
diff --git a/src/cpp/pyublas/numpy.hpp b/src/cpp/pyublas/numpy.hpp
index 590a809..578a7cd 100644
--- a/src/cpp/pyublas/numpy.hpp
+++ b/src/cpp/pyublas/numpy.hpp
@@ -833,10 +833,11 @@ namespace pyublas
class numpy_strided_vec_iterator
: public boost::iterator_facade<
numpy_strided_vec_iterator<T>,
- typename boost::mpl::if_<boost::is_const<T>,
- const T,
- T
- >::type,
+ T,
+ // typename boost::mpl::if_<boost::is_const<T>,
+ // const T,
+ // T
+ // >::type,
boost::numeric::ublas::dense_random_access_iterator_tag>
{
public:
@@ -847,21 +848,13 @@ namespace pyublas
typedef typename self_t::difference_type difference_type;
- numpy_strided_vec_iterator()
- : it(0)
+ numpy_strided_vec_iterator()
+ : stride (0), it(0)
{ }
- numpy_strided_vec_iterator(T *it)
- : it(it)
- { }
- /*
- numpy_strided_vec_iterator(
- numpy_strided_vector<typename self_t::value_type> &_vec)
- : stride (_vec.stride()),
- it (_vec.stride() >= 0 ?
- _vec.m_vector.array().begin() : _vec.m_vector.array().end()-1)
- { }
- */
+ numpy_strided_vec_iterator(T *it, typename numpy_strided_vector<T>::stride_type _stride)
+ : stride (_stride), it(it)
+ {}
// private:
@@ -969,33 +962,33 @@ namespace pyublas
iterator begin()
{
if (stride() >= 0)
- return iterator(this->m_vector.array().begin());
+ return iterator(this->m_vector.array().begin(), stride());
else
- return iterator(this->m_vector.array().end()-1);
+ return iterator(this->m_vector.array().end()-1, stride());
}
iterator end()
{
if (stride() >= 0)
- return iterator(this->m_vector.array().end());
+ return iterator(this->m_vector.array().end(), stride());
else
- return iterator(this->m_vector.array().end() - 1 - this->size());
+ return iterator(this->m_vector.array().end() - 1 - this->size(), stride());
}
const_iterator begin() const
{
if (stride() >= 0)
- return const_iterator(this->m_vector.array().begin());
+ return const_iterator(this->m_vector.array().begin(), stride());
else
- return const_iterator(this->m_vector.array().end()-1);
+ return const_iterator(this->m_vector.array().end()-1, stride());
}
const_iterator end() const
{
if (stride() >= 0)
- return const_iterator(this->m_vector.array().end());
+ return const_iterator(this->m_vector.array().end(), stride());
else
- return const_iterator(this->m_vector.array().end() - 1 - this->size());
+ return const_iterator(this->m_vector.array().end() - 1 - this->size(), stride());
}
};