]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/multi_array/multi_array_ref.hpp
* src/MenuBackend.[Ch]: the specialMenu is now a real menu, not a
[lyx.git] / boost / boost / multi_array / multi_array_ref.hpp
index c8bbc568bdbfcaed2858967d283a0b2ba4009e9a..41b962a8ebe0b87fb7f81821f10b2664fb9aa7ab 100644 (file)
@@ -25,6 +25,7 @@
 #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"
@@ -137,10 +138,17 @@ public:
   }
 
   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_);
@@ -205,8 +213,8 @@ public:
     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
@@ -242,7 +250,7 @@ public:
   }
 
   const_iterator end() const {
-    return const_iterator(*index_bases()+*shape(),origin(),
+    return const_iterator(*index_bases()+(index)*shape(),origin(),
                           shape(),strides(),index_bases());
   }
 
@@ -327,7 +335,8 @@ public:
    // 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);
    }
@@ -385,11 +394,12 @@ public:
   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_);
 
@@ -500,11 +510,12 @@ public:
 
   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());
   }
 
 
@@ -542,7 +553,7 @@ public:
   }
 
   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());
   }