16 #ifndef dealii__array_view_h 17 #define dealii__array_view_h 19 #include <deal.II/base/config.h> 20 #include <deal.II/base/exceptions.h> 21 #include <deal.II/base/table.h> 23 #include <boost/type_traits/remove_cv.hpp> 27 DEAL_II_NAMESPACE_OPEN
70 template <
typename ElementType>
123 std::size_t
size()
const;
148 friend class ArrayView<const ElementType>;
156 template <
typename ElementType>
166 template <
typename ElementType>
177 template <
typename ElementType>
187 template <
typename ElementType>
196 template <
typename ElementType>
221 template <
typename ElementType>
245 template <
typename ElementType>
274 template <
typename ElementType>
278 const std::size_t starting_index,
279 const std::size_t size_of_view)
281 Assert (starting_index + size_of_view <= vector.size(),
282 ExcMessage (
"The starting index and size of the view you want to " 283 "create would lead to a view that extends beyond the end " 284 "of the given vector."));
309 template <
typename ElementType>
313 const std::size_t starting_index,
314 const std::size_t size_of_view)
316 Assert (starting_index + size_of_view <= vector.size(),
317 ExcMessage (
"The starting index and size of the view you want to " 318 "create would lead to a view that extends beyond the end " 319 "of the given vector."));
341 template <
typename ElementType>
369 template <
typename ElementType>
400 template <
typename ElementType>
406 const std::size_t size_of_view)
410 Assert (starting_column + size_of_view <= table.
size()[1],
411 ExcMessage (
"The starting index and size of the view you want to " 412 "create would lead to a view that extends beyond the end " 413 "of a column of the given table."));
438 template <
typename ElementType>
444 const std::size_t size_of_view)
448 Assert (starting_column + size_of_view <= table.
size()[1],
449 ExcMessage (
"The starting index and size of the view you want to " 450 "create would lead to a view that extends beyond the end " 451 "of a column of the given table."));
457 DEAL_II_NAMESPACE_CLOSE
ArrayView< ElementType > make_array_view(std::vector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
const std::size_t n_elements
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
ArrayView< const ElementType > make_array_view(const Table< 2, ElementType > &table, const typename Table< 2, ElementType >::size_type row, const typename Table< 2, ElementType >::size_type starting_column, const std::size_t size_of_view)
value_type & operator[](const std::size_t i) const
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)
ArrayView< ElementType > make_array_view(Table< 2, ElementType > &table, const typename Table< 2, ElementType >::size_type row)
ArrayView< const ElementType > make_array_view(const std::vector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
ArrayView< ElementType > make_array_view(std::vector< ElementType > &vector)
ArrayView< const ElementType > make_array_view(const Table< 2, ElementType > &table, const typename Table< 2, ElementType >::size_type row)
unsigned int size(const unsigned int i) const
ArrayView< ElementType > make_array_view(Table< 2, ElementType > &table, const typename Table< 2, ElementType >::size_type row, const typename Table< 2, ElementType >::size_type starting_column, const std::size_t size_of_view)
AlignedVector< T >::size_type size_type
ArrayView< const ElementType > make_array_view(const std::vector< ElementType > &vector)
value_type *const starting_element