14 #ifndef ECL_CONTAINERS_STENCIL_STENCIL_HPP_ 15 #define ECL_CONTAINERS_STENCIL_STENCIL_HPP_ 26 #include "../initialiser.hpp" 71 template <
typename Array>
114 array(underlying_array),
139 array(underlying_array),
140 b_iter(array.begin()+start_index),
141 e_iter(array.begin()+start_index+n)
167 return Stencil<Array>(array,b_iter+start_index,b_iter+start_index+n);
184 b_iter = array.begin()+start_index;
185 e_iter = array.begin()+start_index+n;
242 if ( &array == &(s.array) )
250 for (
unsigned int i = 0; i < s.size(); ++i )
252 *(b_iter+i) = *(s.b_iter+i);
309 return reverse_iterator(end());
319 return const_reverse_iterator(end());
329 return reverse_iterator(begin());
339 return const_reverse_iterator(begin());
433 if ( b_iter+i <= array.begin() )
437 if ( b_iter+i >= array.end() )
457 if ( b_iter+i <= array.begin() )
461 if ( b_iter+i >= array.end() )
477 {
return e_iter-b_iter;}
497 template <
typename OutputStream,
typename ArrayType>
498 friend OutputStream& operator<<(OutputStream &ostream , const Stencil<ArrayType> &stencil);
509 template<
typename OutputStream,
typename ArrayType>
510 OutputStream& operator<<(OutputStream &ostream, const Stencil<ArrayType> &stencil)
516 for (std::size_t i = 0; i < stencil.size(); ++i)
518 ostream << stencil[i] <<
" ";
Fixed size container with a few bells and whistles.
const Type * const_iterator
Embedded control libraries.
reference back() ecl_assert_throw_decl(StandardException)
const_iterator end() const ecl_assert_throw_decl(StandardException)
std::reverse_iterator< iterator > reverse_iterator
Uses the array's reverse iterator type.
formatters::StencilFormatter< value_type, Array > Formatter
const_reference at(size_type i) const
Array::iterator iterator
Uses the array's iterator type.
std::reverse_iterator< const_iterator > const_reverse_iterator
Uses the array's constant reverse iterator type.
Stencil(Array &underlying_array, const unsigned int &start_index=0, const unsigned int &n=0) ecl_assert_throw_decl(StandardException)
Initialises with a reference to the underlying container and boundary constraints.
reference front() ecl_assert_throw_decl(StandardException)
void resettle(const unsigned int &start_index, const unsigned int &n) ecl_assert_throw_decl(StandardException)
Resettle the stencil on a different range over the same underlying array.
Array::reference reference
Uses the array's element reference type.
#define ecl_assert_throw(expression, exception)
std::size_t size_type
Uses the array's type used to denote the length of the array.
const_reference operator[](size_type i) const ecl_assert_throw_decl(StandardException)
const Type & const_reference
std::ptrdiff_t difference_type
Stencil< Array > & operator=(const Stencil< Array > &s) ecl_assert_throw_decl(StandardException)
This either resettles this stencil or copies across to it (depending on the rhs stencil).
Array::const_reference const_reference
Uses the array's element const reference type.
iterator end() ecl_assert_throw_decl(StandardException)
const_reference back() const ecl_assert_throw_decl(StandardException)
Convenience initialiser with bounds checking for fixed size containers.
const_reverse_iterator rbegin() const ecl_assert_throw_decl(StandardException)
#define ecl_assert_throw_decl(exception)
Stencil< Array > stencil(const unsigned int &start_index, const unsigned int &n) const ecl_assert_throw_decl(StandardException)
Generate a sub-stencil.
A safe windowing class that opens onto array-like containers.
#define ecl_compile_time_concept_check(Model)
Array::value_type value_type
Uses the array's element type.
OutputStream & operator<<(OutputStream &ostream, Format< std::string > &formatter) ecl_assert_throw_decl(StandardException)
iterator begin() ecl_assert_throw_decl(StandardException)
reference at(size_type i)
const_iterator begin() const ecl_assert_throw_decl(StandardException)
const_reference front() const ecl_assert_throw_decl(StandardException)
reverse_iterator rend() ecl_assert_throw_decl(StandardException)
reference operator[](size_type i) ecl_assert_throw_decl(StandardException)
Stencil(Array &underlying_array, iterator begin_iter, iterator end_iter) ecl_assert_throw_decl(StandardException)
Initialises with a reference to the underlying container and boundary constraints.
Array::const_iterator const_iterator
Uses the array's constant iterator type.
const_reverse_iterator rend() const ecl_assert_throw_decl(StandardException)
reverse_iterator rbegin() ecl_assert_throw_decl(StandardException)