Rename extents parameters

This commit is contained in:
Glen Fernandes 2024-05-13 08:05:33 -04:00
parent 0c5348bef7
commit 894c172d10
6 changed files with 51 additions and 51 deletions

View File

@ -158,7 +158,7 @@ public:
template <class ExtentList>
explicit multi_array(
ExtentList const& extents,
ExtentList const& _extents,
const Allocator& alloc = Allocator()
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
, typename mpl::if_<
@ -166,7 +166,7 @@ public:
int&,int>::type* = 0
#endif
) :
super_type((T*)initial_base_,extents),
super_type((T*)initial_base_,_extents),
alloc_base(boost::empty_init_t(),alloc) {
boost::function_requires<
detail::multi_array::CollectionConcept<ExtentList> >();
@ -175,9 +175,9 @@ public:
template <class ExtentList>
explicit multi_array(ExtentList const& extents,
explicit multi_array(ExtentList const& _extents,
const general_storage_order<NumDims>& so) :
super_type((T*)initial_base_,extents,so),
super_type((T*)initial_base_,_extents,so),
alloc_base(boost::empty_init_t()) {
boost::function_requires<
detail::multi_array::CollectionConcept<ExtentList> >();
@ -185,10 +185,10 @@ public:
}
template <class ExtentList>
explicit multi_array(ExtentList const& extents,
explicit multi_array(ExtentList const& _extents,
const general_storage_order<NumDims>& so,
Allocator const& alloc) :
super_type((T*)initial_base_,extents,so),
super_type((T*)initial_base_,_extents,so),
alloc_base(boost::empty_init_t(),alloc) {
boost::function_requires<
detail::multi_array::CollectionConcept<ExtentList> >();
@ -433,7 +433,7 @@ public:
template <typename ExtentList>
multi_array& resize(const ExtentList& extents) {
multi_array& resize(const ExtentList& _extents) {
boost::function_requires<
detail::multi_array::CollectionConcept<ExtentList> >();
@ -442,7 +442,7 @@ public:
for (int i=0; i != NumDims; ++i) {
typedef typename gen_type::range range_type;
ranges.ranges_[i] = range_type(0,extents[i]);
ranges.ranges_[i] = range_type(0,_extents[i]);
}
return this->resize(ranges);

View File

@ -128,15 +128,15 @@ protected:
// used by array operator[] and iterators to get reference types.
template <typename Reference, typename TPtr>
Reference access(boost::type<Reference>,index idx,TPtr base,
const size_type* extents,
const size_type* _extents,
const index* strides,
const index* index_bases) const {
BOOST_ASSERT(idx - index_bases[0] >= 0);
BOOST_ASSERT(size_type(idx - index_bases[0]) < extents[0]);
BOOST_ASSERT(size_type(idx - index_bases[0]) < _extents[0]);
// return a sub_array<T,NDims-1> proxy object
TPtr newbase = base + idx * strides[0];
return Reference(newbase,extents+1,strides+1,index_bases+1);
return Reference(newbase,_extents+1,strides+1,index_bases+1);
}
@ -168,14 +168,14 @@ protected:
// used by array operator[] and iterators to get reference types.
template <typename Reference, typename TPtr>
Reference access(boost::type<Reference>,index idx,TPtr base,
const size_type* extents,
const size_type* _extents,
const index* strides,
const index* index_bases) const {
ignore_unused_variable_warning(index_bases);
ignore_unused_variable_warning(extents);
ignore_unused_variable_warning(_extents);
BOOST_ASSERT(idx - index_bases[0] >= 0);
BOOST_ASSERT(size_type(idx - index_bases[0]) < extents[0]);
BOOST_ASSERT(size_type(idx - index_bases[0]) < _extents[0]);
return *(base + idx * strides[0]);
}
@ -299,17 +299,17 @@ protected:
Reference access_element(boost::type<Reference>,
const IndexList& indices,
TPtr base,
const size_type* extents,
const size_type* _extents,
const index* strides,
const index* index_bases) const {
boost::function_requires<
CollectionConcept<IndexList> >();
ignore_unused_variable_warning(index_bases);
ignore_unused_variable_warning(extents);
ignore_unused_variable_warning(_extents);
#if !defined(NDEBUG) && !defined(BOOST_DISABLE_ASSERTS)
for (size_type i = 0; i != NumDims; ++i) {
BOOST_ASSERT(indices[i] - index_bases[i] >= 0);
BOOST_ASSERT(size_type(indices[i] - index_bases[i]) < extents[i]);
BOOST_ASSERT(size_type(indices[i] - index_bases[i]) < _extents[i]);
}
#endif
@ -408,7 +408,7 @@ protected:
generate_array_view(boost::type<ArrayRef>,
const boost::detail::multi_array::
index_gen<NumDims,NDims>& indices,
const size_type* extents,
const size_type* _extents,
const index* strides,
const index* index_bases,
TPtr base) const {
@ -422,7 +422,7 @@ protected:
// Use array specs and input specs to produce real specs.
const index default_start = index_bases[n];
const index default_finish = default_start+extents[n];
const index default_finish = default_start+_extents[n];
const index_range& current_range = indices.ranges_[n];
index start = current_range.get_start(default_start);
index finish = current_range.get_finish(default_finish);
@ -453,8 +453,8 @@ protected:
// exactly in the set of legal indices
// with a special case for empty arrays
BOOST_ASSERT(index_bases[n] <= start &&
((start <= index_bases[n]+index(extents[n])) ||
(start == index_bases[n] && extents[n] == 0)));
((start <= index_bases[n]+index(_extents[n])) ||
(start == index_bases[n] && _extents[n] == 0)));
#ifndef BOOST_DISABLE_ASSERTS
// finish marks the open side of the range, so it can go one past
@ -462,7 +462,7 @@ protected:
// if stride is negative).
index bound_adjustment = stride < 0 ? 1 : 0;
BOOST_ASSERT(((index_bases[n] - bound_adjustment) <= finish) &&
(finish <= (index_bases[n] + index(extents[n]) - bound_adjustment)));
(finish <= (index_bases[n] + index(_extents[n]) - bound_adjustment)));
ignore_unused_variable_warning(bound_adjustment);
#endif // BOOST_DISABLE_ASSERTS

View File

@ -94,10 +94,10 @@ public:
array_iterator() {}
array_iterator(index idx, TPtr base, const size_type* extents,
array_iterator(index idx, TPtr base, const size_type* _extents,
const index* strides,
const index* index_base) :
idx_(idx), base_(base), extents_(extents),
idx_(idx), base_(base), extents_(_extents),
strides_(strides), index_base_(index_base) { }
template <typename OPtr, typename ORef, typename Cat>

View File

@ -87,24 +87,24 @@ public:
num_elements_(other.num_elements_) { }
template <typename ExtentList>
explicit const_multi_array_ref(TPtr base, const ExtentList& extents) :
explicit const_multi_array_ref(TPtr base, const ExtentList& _extents) :
base_(base), storage_(c_storage_order()) {
boost::function_requires<
CollectionConcept<ExtentList> >();
index_base_list_.assign(0);
init_multi_array_ref(extents.begin());
init_multi_array_ref(_extents.begin());
}
template <typename ExtentList>
explicit const_multi_array_ref(TPtr base, const ExtentList& extents,
explicit const_multi_array_ref(TPtr base, const ExtentList& _extents,
const general_storage_order<NumDims>& so) :
base_(base), storage_(so) {
boost::function_requires<
CollectionConcept<ExtentList> >();
index_base_list_.assign(0);
init_multi_array_ref(extents.begin());
init_multi_array_ref(_extents.begin());
}
explicit const_multi_array_ref(TPtr base,
@ -162,14 +162,14 @@ public:
}
template <typename SizeList>
void reshape(const SizeList& extents) {
void reshape(const SizeList& _extents) {
boost::function_requires<
CollectionConcept<SizeList> >();
BOOST_ASSERT(num_elements_ ==
std::accumulate(extents.begin(),extents.end(),
std::accumulate(_extents.begin(),_extents.end(),
size_type(1),std::multiplies<size_type>()));
std::copy(extents.begin(),extents.end(),extent_list_.begin());
std::copy(_extents.begin(),_extents.end(),extent_list_.begin());
this->compute_strides(stride_list_,extent_list_,storage_);
origin_offset_ =
@ -325,7 +325,7 @@ public:
const_multi_array_ref(TPtr base,
const storage_order_type& so,
const index * index_bases,
const size_type* extents) :
const size_type* _extents) :
base_(base), storage_(so), origin_offset_(0), directional_offset_(0)
{
// If index_bases or extents is null, then initialize the corresponding
@ -336,8 +336,8 @@ public:
} else {
std::fill_n(index_base_list_.begin(),NumDims,0);
}
if(extents) {
init_multi_array_ref(extents);
if(_extents) {
init_multi_array_ref(_extents);
} else {
boost::array<index,NumDims> extent_list;
extent_list.assign(0);
@ -371,12 +371,12 @@ private:
boost::mem_fun_ref(&extent_range::start));
// calculate the extents
extent_list extents;
extent_list _extents;
std::transform(ranges.ranges_.begin(),ranges.ranges_.end(),
extents.begin(),
_extents.begin(),
boost::mem_fun_ref(&extent_range::size));
init_multi_array_ref(extents.begin());
init_multi_array_ref(_extents.begin());
}
@ -442,16 +442,16 @@ public:
};
template <class ExtentList>
explicit multi_array_ref(T* base, const ExtentList& extents) :
super_type(base,extents) {
explicit multi_array_ref(T* base, const ExtentList& _extents) :
super_type(base,_extents) {
boost::function_requires<
CollectionConcept<ExtentList> >();
}
template <class ExtentList>
explicit multi_array_ref(T* base, const ExtentList& extents,
explicit multi_array_ref(T* base, const ExtentList& _extents,
const general_storage_order<NumDims>& so) :
super_type(base,extents,so) {
super_type(base,_extents,so) {
boost::function_requires<
CollectionConcept<ExtentList> >();
}
@ -612,8 +612,8 @@ protected:
explicit multi_array_ref(T* base,
const storage_order_type& so,
const index* index_bases,
const size_type* extents) :
super_type(base,so,index_bases,extents) { }
const size_type* _extents) :
super_type(base,so,index_bases,_extents) { }
};

View File

@ -176,10 +176,10 @@ public: // Should be protected
#endif
const_sub_array (TPtr base,
const size_type* extents,
const size_type* _extents,
const index* strides,
const index* index_base) :
base_(base), extents_(extents), strides_(strides),
base_(base), extents_(_extents), strides_(strides),
index_base_(index_base) {
}
@ -356,10 +356,10 @@ public: // should be private
#endif
sub_array (T* base,
const size_type* extents,
const size_type* _extents,
const index* strides,
const index* index_base) :
super_type(base,extents,strides,index_base) {
super_type(base,_extents,strides,index_base) {
}
};

View File

@ -227,7 +227,7 @@ public: // should be protected
// to create strides
template <typename ExtentList, typename Index>
explicit const_multi_array_view(TPtr base,
const ExtentList& extents,
const ExtentList& _extents,
const boost::array<Index,NumDims>& strides):
base_(base), origin_offset_(0) {
@ -235,7 +235,7 @@ public: // should be protected
// Get the extents and strides
boost::detail::multi_array::
copy_n(extents.begin(),NumDims,extent_list_.begin());
copy_n(_extents.begin(),NumDims,extent_list_.begin());
boost::detail::multi_array::
copy_n(strides.begin(),NumDims,stride_list_.begin());
@ -429,9 +429,9 @@ public: // should be private
// generate array views
template <typename ExtentList, typename Index>
explicit multi_array_view(T* base,
const ExtentList& extents,
const ExtentList& _extents,
const boost::array<Index,NumDims>& strides) :
super_type(base,extents,strides) { }
super_type(base,_extents,strides) { }
};