#include "boost/multi_array/subarray.hpp"
#include "boost/multi_array/view.hpp"
#include "boost/multi_array/algorithm.hpp"
+#include "boost/type_traits/is_integral.hpp"
#include "boost/array.hpp"
#include "boost/concept_check.hpp"
#include "boost/functional.hpp"
}
template <class BaseList>
- void reindex(const BaseList& values) {
+#ifdef BOOST_NO_SFINAE
+ void
+#else
+ typename
+ disable_if<typename boost::is_integral<BaseList>::type,void >::type
+#endif // BOOST_NO_SFINAE
+ reindex(const BaseList& values) {
boost::function_requires<
detail::multi_array::CollectionConcept<BaseList> >();
- boost::copy_n(values.begin(),num_dimensions(),index_base_list_.begin());
+ boost::detail::multi_array::
+ copy_n(values.begin(),num_dimensions(),index_base_list_.begin());
origin_offset_ =
this->calculate_origin_offset(stride_list_,extent_list_,
storage_,index_base_list_);
boost::function_requires<
detail::multi_array::CollectionConcept<IndexList> >();
return super_type::access_element(boost::type<const element&>(),
- origin(),
- indices,strides());
+ indices,origin(),
+ shape(),strides(),index_bases());
}
// Only allow const element access
}
const_iterator end() const {
- return const_iterator(*index_bases()+*shape(),origin(),
+ return const_iterator(*index_bases()+(index)*shape(),origin(),
shape(),strides(),index_bases());
}
// If index_bases or extents is null, then initialize the corresponding
// private data to zeroed lists.
if(index_bases) {
- boost::copy_n(index_bases,NumDims,index_base_list_.begin());
+ boost::detail::multi_array::
+ copy_n(index_bases,NumDims,index_base_list_.begin());
} else {
std::fill_n(index_base_list_.begin(),NumDims,0);
}
void init_multi_array_ref(InputIterator extents_iter) {
boost::function_requires<InputIteratorConcept<InputIterator> >();
- boost::copy_n(extents_iter,num_dimensions(),extent_list_.begin());
+ boost::detail::multi_array::
+ copy_n(extents_iter,num_dimensions(),extent_list_.begin());
// Calculate the array size
num_elements_ = std::accumulate(extent_list_.begin(),extent_list_.end(),
- 1,std::multiplies<index>());
+ size_type(1),std::multiplies<size_type>());
this->compute_strides(stride_list_,extent_list_,storage_);
template <class IndexList>
element& operator()(const IndexList& indices) {
- boost::function_requires<
- detail::multi_array::CollectionConcept<IndexList> >();
- return super_type::access_element(boost::type<element&>(),
- origin(),
- indices,this->strides());
+ boost::function_requires<
+ detail::multi_array::CollectionConcept<IndexList> >();
+ return super_type::access_element(boost::type<element&>(),
+ indices,origin(),
+ this->shape(),this->strides(),
+ this->index_bases());
}
}
iterator end() {
- return iterator(*this->index_bases()+*this->shape(),origin(),
+ return iterator(*this->index_bases()+(index)*this->shape(),origin(),
this->shape(),this->strides(),
this->index_bases());
}