Loading [MathJax]/extensions/TeX/AMSsymbols.js
 deal.II version GIT relicensing-3012-g95e643124d 2025-04-03 05:00:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
array_view.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2015 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_array_view_h
16#define dealii_array_view_h
17
18#include <deal.II/base/config.h>
19
24#include <deal.II/base/tensor.h>
25
26#include <boost/container/small_vector.hpp>
27
28#include <array>
29#include <type_traits>
30#include <vector>
31
33
34// Forward declaration
35template <class T>
36class AlignedVector;
37
38template <int N, typename T>
39class Table;
40
41template <typename number>
43
44
86template <typename ElementType, typename MemorySpaceType = MemorySpace::Host>
88{
89public:
94 using value_type = ElementType;
95
100
104 using const_iterator = const ElementType *;
105
110
134
145 const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &view);
146
151 explicit ArrayView(value_type &element);
152
153#ifdef DEAL_II_HAVE_CXX20
171 template <typename ContiguousContainer>
172 ArrayView(const ContiguousContainer &container)
173 requires(std::is_same_v<
174 std::remove_cv_t<ElementType>,
175 std::remove_cv_t<typename ContiguousContainer::value_type>> &&
176 std::is_const_v<ElementType> &&
178
196 template <typename ContiguousContainer>
197 ArrayView(ContiguousContainer &container)
198 requires(std::is_same_v<
199 std::remove_cv_t<ElementType>,
200 std::remove_cv_t<typename ContiguousContainer::value_type>> &&
202
203#else
204
205
223 template <typename ContiguousContainer,
224 typename = decltype(std::data(std::declval<ContiguousContainer>())),
225 typename = decltype(std::size(std::declval<ContiguousContainer>())),
226 typename = std::enable_if_t<
227 std::is_same_v<
228 std::remove_cv_t<ElementType>,
229 std::remove_cv_t<typename ContiguousContainer::value_type>> &&
230 std::is_const_v<ElementType>>>
231 ArrayView(const ContiguousContainer &container);
232
250 template <typename ContiguousContainer,
251 typename = decltype(std::data(std::declval<ContiguousContainer>())),
252 typename = decltype(std::size(std::declval<ContiguousContainer>())),
253 typename = std::enable_if_t<std::is_same_v<
254 std::remove_cv_t<ElementType>,
255 std::remove_cv_t<typename ContiguousContainer::value_type>>>>
256 ArrayView(ContiguousContainer &container);
257
258#endif
259
274 template <std::size_t N>
275 ArrayView(value_type (&array)[N]);
276
321 const std::initializer_list<std::remove_cv_t<value_type>> &initializer_list)
322 DEAL_II_CXX20_REQUIRES(std::is_const_v<ElementType>);
323
343 void
345
359 bool
361 const ArrayView<const value_type, MemorySpaceType> &other_view) const;
362
376 bool
377 operator==(const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType>
378 &other_view) const;
379
396 bool
398 const ArrayView<const value_type, MemorySpaceType> &other_view) const;
399
413 bool
414 operator!=(const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType>
415 &other_view) const;
416
421 std::size_t
422 size() const;
423
427 bool
428 empty() const;
429
435 data() const noexcept;
436
441 begin() const;
442
447 end() const;
448
453 cbegin() const;
454
459 cend() const;
460
473 value_type &
474 operator[](const std::size_t i) const;
475
476private:
482
487
488 friend class ArrayView<const ElementType, MemorySpaceType>;
489};
490
491
492
493//---------------------------------------------------------------------------
494
495
496template <typename ElementType, typename MemorySpaceType>
497inline ArrayView<ElementType, MemorySpaceType>::ArrayView()
498 : starting_element(nullptr)
499 , n_elements(0)
500{}
501
502
503
504template <typename ElementType, typename MemorySpaceType>
507 const std::size_t n_elements)
508 : // In debug mode, make sure that n_elements>0 and if it is not, set
509 // the pointer to a nullptr to trigger segfaults if anyone ever wanted
510 // to access elements of the array. In release mode, just take the
511 // pointer as given.
513 (n_elements > 0) ?
515 nullptr)
517{}
518
519
520
521template <typename ElementType, typename MemorySpaceType>
522inline void
524 const std::size_t n_elements)
525{
526 if constexpr (running_in_debug_mode())
527 {
528 if (n_elements > 0)
529 this->starting_element = starting_element;
530 else
531 this->starting_element = nullptr;
532 }
533 else
534 {
535 this->starting_element = starting_element;
536 }
537 this->n_elements = n_elements;
538}
539
540
541
542template <typename ElementType, typename MemorySpaceType>
544 : starting_element(&element)
545 , n_elements(1)
546{}
547
548
549
550template <typename ElementType, typename MemorySpaceType>
552 const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &view)
553 : starting_element(view.starting_element)
554 , n_elements(view.n_elements)
555{}
556
557
558#ifdef DEAL_II_HAVE_CXX20
559
560template <typename ElementType, typename MemorySpaceType>
561template <typename ContiguousContainer>
563 const ContiguousContainer &container)
564 requires(std::is_same_v<
565 std::remove_cv_t<ElementType>,
566 std::remove_cv_t<typename ContiguousContainer::value_type>> &&
567 std::is_const_v<ElementType> &&
569 : // use delegating constructor
570 ArrayView(container.data(), container.size())
571{}
572
573
574
575template <typename ElementType, typename MemorySpaceType>
576template <typename ContiguousContainer>
578 ContiguousContainer &container)
579 requires(std::is_same_v<
580 std::remove_cv_t<ElementType>,
581 std::remove_cv_t<typename ContiguousContainer::value_type>> &&
583 : // use delegating constructor
584 ArrayView(std::data(container), std::size(container))
585{}
586
587
588#else
589
590template <typename ElementType, typename MemorySpaceType>
591template <typename ContiguousContainer, typename, typename, typename>
593 const ContiguousContainer &container)
594 : // use delegating constructor
595 ArrayView(container.data(), container.size())
596{}
597
598
599
600template <typename ElementType, typename MemorySpaceType>
601template <typename ContiguousContainer, typename, typename, typename>
603 ContiguousContainer &container)
604 : // use delegating constructor
605 ArrayView(std::data(container), std::size(container))
606{}
607
608#endif
609
610
611
612template <typename ElementType, typename MemorySpaceType>
613template <std::size_t N>
615 ElementType (&array)[N])
616 : ArrayView(&array[0], N)
617{}
618
619
620template <typename ElementType, typename MemorySpaceType>
622 const std::initializer_list<std::remove_cv_t<value_type>> &initializer)
623 DEAL_II_CXX20_REQUIRES(std::is_const_v<ElementType>)
624 : // use delegating constructor
625 ArrayView(initializer.begin(), initializer.size())
626{}
627
628
629
630template <typename ElementType, typename MemorySpaceType>
631inline bool
633 const ArrayView<const value_type, MemorySpaceType> &other_view) const
634{
635 return (other_view.data() == starting_element) &&
636 (other_view.size() == n_elements);
637}
638
639
640
641template <typename ElementType, typename MemorySpaceType>
642inline bool
644 const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &other_view)
645 const
646{
647 return (other_view.data() == starting_element) &&
648 (other_view.size() == n_elements);
649}
650
651
652
653template <typename ElementType, typename MemorySpaceType>
654inline bool
656 const ArrayView<const value_type, MemorySpaceType> &other_view) const
657{
658 return !(*this == other_view);
659}
660
661
662
663template <typename ElementType, typename MemorySpaceType>
667{
668 if (n_elements == 0)
669 return nullptr;
670 else
671 return starting_element;
672}
673
674
675
676template <typename ElementType, typename MemorySpaceType>
677inline bool
679 const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &other_view)
680 const
681{
682 return !(*this == other_view);
683}
684
685
686
687template <typename ElementType, typename MemorySpaceType>
688inline std::size_t
690{
691 return n_elements;
692}
693
694
695
696template <typename ElementType, typename MemorySpaceType>
697inline bool
699{
700 return n_elements == 0;
701}
702
703
704
705template <typename ElementType, typename MemorySpaceType>
708{
709 return starting_element;
710}
711
712
713
714template <typename ElementType, typename MemorySpaceType>
717{
718 return starting_element + n_elements;
719}
720
721
722
723template <typename ElementType, typename MemorySpaceType>
726{
727 return starting_element;
728}
729
730
731
732template <typename ElementType, typename MemorySpaceType>
735{
736 return starting_element + n_elements;
737}
738
739
740
741template <typename ElementType, typename MemorySpaceType>
744{
745 AssertIndexRange(i, n_elements);
746
747 return *(starting_element + i);
748}
749
750
751
757template <typename ElementType, std::size_t stride = 1>
759{
760public:
765 using value_type = ElementType;
766
787
792 std::size_t
793 size() const;
794
798 bool
799 empty() const;
800
805 value_type *
806 data() const noexcept;
807
820 value_type &
821 operator[](const std::size_t i) const;
822
823protected:
829
834};
835
836
837
838template <typename ElementType, std::size_t stride>
839typename StridedArrayView<ElementType, stride>::value_type &
840StridedArrayView<ElementType, stride>::operator[](const std::size_t i) const
841{
842 AssertIndexRange(i, this->n_elements);
843
844 return *(this->starting_element + stride * i);
845}
846
847
848
849template <typename ElementType, std::size_t stride>
852{
853 if (this->n_elements == 0)
854 return nullptr;
855 else
856 return this->starting_element;
857}
858
859
860
861template <typename ElementType, std::size_t stride>
862bool
864{
865 return this->n_elements == 0;
866}
867
868
869
870template <typename ElementType, std::size_t stride>
871std::size_t
873{
874 return this->n_elements;
875}
876
877
878
879template <typename ElementType, std::size_t stride>
886
887
888
889#ifndef DOXYGEN
890namespace internal
891{
892 namespace ArrayViewHelper
893 {
899 template <class Iterator>
900 bool
901 is_contiguous(const Iterator &first, const Iterator &last)
902 {
903 const auto n = std::distance(first, last);
904 for (std::decay_t<decltype(n)> i = 0; i < n; ++i)
905 if (std::addressof(*(std::next(first, i))) !=
906 std::next(std::addressof(*first), i))
907 return false;
908 return true;
909 }
910
911
922 template <class T>
923 constexpr bool
924 is_contiguous(T *, T *)
925 {
926 return true;
927 }
928 } // namespace ArrayViewHelper
929} // namespace internal
930#endif
931
932
933
950template <typename Iterator, typename MemorySpaceType = MemorySpace::Host>
952 std::remove_reference_t<typename std::iterator_traits<Iterator>::reference>,
953 MemorySpaceType>
954make_array_view(const Iterator begin, const Iterator end)
955{
956 static_assert(
957 std::is_same_v<typename std::iterator_traits<Iterator>::iterator_category,
958 typename std::random_access_iterator_tag>
959#ifdef DEAL_II_HAVE_CXX20
960 ||
961 std::is_same_v<typename std::iterator_traits<Iterator>::iterator_category,
962 typename std::contiguous_iterator_tag>
963#endif
964 ,
965 "The provided iterator needs to be a random access iterator.");
966 Assert(begin <= end,
968 "The beginning of the array view needs to be before the end."));
969 Assert(internal::ArrayViewHelper::is_contiguous(begin, end),
970 ExcMessage("The provided range isn't contiguous in memory!"));
971 // the reference type, not the value type, knows the constness of the iterator
972 return ArrayView<
973 std::remove_reference_t<typename std::iterator_traits<Iterator>::reference>,
974 MemorySpaceType>(std::addressof(*begin), end - begin);
975}
976
977
978
988template <typename ElementType, typename MemorySpaceType = MemorySpace::Host>
990make_array_view(ElementType *const begin, ElementType *const end)
991{
992 Assert(begin <= end,
994 "The beginning of the array view needs to be before the end."));
995 return ArrayView<ElementType, MemorySpaceType>(begin, end - begin);
996}
997
998
999
1010template <typename Number, typename MemorySpaceType>
1013{
1014 return make_array_view(array_view.cbegin(), array_view.cend());
1015}
1016
1017
1018
1029template <typename Number, typename MemorySpaceType>
1032{
1033 return make_array_view(array_view.begin(), array_view.end());
1034}
1035
1036
1037
1051template <typename ElementType, int N>
1053make_array_view(ElementType (&array)[N])
1054{
1055 return ArrayView<ElementType>(array, N);
1056}
1057
1058
1059
1074template <typename ElementType>
1077{
1078 return ArrayView<ElementType>(vector.begin(), vector.size());
1079}
1080
1081
1082
1097template <typename ElementType>
1100{
1101 return ArrayView<const ElementType>(vector.begin(), vector.size());
1102}
1103
1104
1105
1120template <typename ElementType>
1122make_array_view(std::vector<ElementType> &vector)
1123{
1124 return ArrayView<ElementType>(vector.data(), vector.size());
1125}
1126
1127
1128
1143template <typename ElementType>
1145make_array_view(const std::vector<ElementType> &vector)
1146{
1147 return ArrayView<const ElementType>(vector.data(), vector.size());
1148}
1149
1150
1151
1171template <typename ElementType>
1173make_array_view(std::vector<ElementType> &vector,
1174 const std::size_t starting_index,
1175 const std::size_t size_of_view)
1176{
1177 Assert(starting_index + size_of_view <= vector.size(),
1178 ExcMessage("The starting index and size of the view you want to "
1179 "create would lead to a view that extends beyond the end "
1180 "of the given vector."));
1181 return ArrayView<ElementType>(&vector[starting_index], size_of_view);
1182}
1183
1184
1185
1205template <typename ElementType>
1207make_array_view(const std::vector<ElementType> &vector,
1208 const std::size_t starting_index,
1209 const std::size_t size_of_view)
1210{
1211 Assert(starting_index + size_of_view <= vector.size(),
1212 ExcMessage("The starting index and size of the view you want to "
1213 "create would lead to a view that extends beyond the end "
1214 "of the given vector."));
1215 return ArrayView<const ElementType>(&vector[starting_index], size_of_view);
1216}
1217
1218
1219
1227template <typename ElementType>
1230{
1231 return ArrayView<ElementType>(vector.data(), vector.size());
1232}
1233
1234
1235
1243template <typename ElementType>
1246{
1247 return ArrayView<const ElementType>(vector.data(), vector.size());
1248}
1249
1250
1251
1259template <typename ElementType>
1262 const std::size_t starting_index,
1263 const std::size_t size_of_view)
1264{
1265 Assert(starting_index + size_of_view <= vector.size(),
1266 ExcMessage("The starting index and size of the view you want to "
1267 "create would lead to a view that extends beyond the end "
1268 "of the given vector."));
1269 return ArrayView<ElementType>(&vector[starting_index], size_of_view);
1270}
1271
1272
1273
1281template <typename ElementType>
1284 const std::size_t starting_index,
1285 const std::size_t size_of_view)
1286{
1287 Assert(starting_index + size_of_view <= vector.size(),
1288 ExcMessage("The starting index and size of the view you want to "
1289 "create would lead to a view that extends beyond the end "
1290 "of the given vector."));
1291 return ArrayView<const ElementType>(&vector[starting_index], size_of_view);
1292}
1293
1294
1295
1310template <typename ElementType, std::size_t N>
1312make_array_view(std::array<ElementType, N> &array)
1313{
1314 return ArrayView<ElementType>(array);
1315}
1316
1317
1318
1333template <typename ElementType, std::size_t N>
1335make_array_view(const std::array<ElementType, N> &array)
1336{
1337 return ArrayView<const ElementType>(array);
1338}
1339
1340
1341
1358template <typename ElementType>
1361 const typename Table<2, ElementType>::size_type row)
1362{
1363 AssertIndexRange(row, table.size()[0]);
1364 return ArrayView<ElementType>(&table[row][0], table.size()[1]);
1365}
1366
1367
1368
1385template <typename ElementType>
1388{
1389 return ArrayView<ElementType>(&table[0][0], table.n_elements());
1390}
1391
1392
1393
1410template <typename ElementType>
1413{
1414 return ArrayView<const ElementType>(&table[0][0], table.n_elements());
1415}
1416
1417
1435template <typename ElementType>
1438{
1439 return ArrayView<ElementType>(&matrix(0, 0), matrix.n_elements());
1440}
1441
1442
1443
1460template <typename ElementType>
1463{
1464 return ArrayView<const ElementType>(&matrix(0, 0), matrix.n_elements());
1465}
1466
1467
1468
1485template <typename ElementType>
1488 const typename Table<2, ElementType>::size_type row)
1489{
1490 AssertIndexRange(row, table.size()[0]);
1491 return ArrayView<const ElementType>(&table[row][0], table.size()[1]);
1492}
1493
1494
1495
1515template <typename ElementType>
1518 const typename Table<2, ElementType>::size_type row,
1519 const typename Table<2, ElementType>::size_type starting_column,
1520 const std::size_t size_of_view)
1521{
1522 AssertIndexRange(row, table.size()[0]);
1523 AssertIndexRange(starting_column, table.size()[1]);
1524 Assert(starting_column + size_of_view <= table.size()[1],
1525 ExcMessage("The starting index and size of the view you want to "
1526 "create would lead to a view that extends beyond the end "
1527 "of a column of the given table."));
1528 return ArrayView<ElementType>(&table[row][starting_column], size_of_view);
1529}
1530
1531
1532
1552template <typename ElementType>
1555 const typename Table<2, ElementType>::size_type row,
1556 const typename Table<2, ElementType>::size_type starting_column,
1557 const std::size_t size_of_view)
1558{
1559 AssertIndexRange(row, table.size()[0]);
1560 AssertIndexRange(starting_column, table.size()[1]);
1561 Assert(starting_column + size_of_view <= table.size()[1],
1562 ExcMessage("The starting index and size of the view you want to "
1563 "create would lead to a view that extends beyond the end "
1564 "of a column of the given table."));
1565 return ArrayView<const ElementType>(&table[row][starting_column],
1566 size_of_view);
1567}
1568
1569
1570
1571/*
1572 * Create a view that doesn't allow the container it points to to be modified.
1573 * This is useful if the object passed in is not `const` already and a function
1574 * requires a view to constant memory in its signature.
1575 *
1576 * This function returns an object of type `ArrayView<const T>` where `T` is the
1577 * element type of the container.
1578 *
1579 * @relatesalso ArrayView
1580 */
1581template <typename Container>
1582inline auto
1583make_const_array_view(const Container &container)
1584 -> decltype(make_array_view(container))
1585{
1586 return make_array_view(container);
1587}
1588
1589
1591
1592#endif
auto make_const_array_view(const Container &container) -> decltype(make_array_view(container))
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
Definition array_view.h:954
pointer data()
size_type size() const
ArrayView(ContiguousContainer &container)
Definition array_view.h:602
ArrayView< const ElementType > make_array_view(const Vector< ElementType > &vector)
ArrayView(value_type &element)
Definition array_view.h:543
iterator begin() const
Definition array_view.h:707
bool operator!=(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &other_view) const
Definition array_view.h:678
ArrayView< Number, MemorySpaceType > make_array_view(ArrayView< Number, MemorySpaceType > &array_view)
ArrayView(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &view)
Definition array_view.h:551
value_type * iterator
Definition array_view.h:99
value_type & operator[](const std::size_t i) const
Definition array_view.h:743
ArrayView< const ElementType > make_array_view(const LAPACKFullMatrix< ElementType > &matrix)
ArrayView< ElementType > make_array_view(std::array< ElementType, N > &array)
bool empty() const
Definition array_view.h:698
bool operator==(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &other_view) const
Definition array_view.h:643
ArrayView< ElementType > make_array_view(LAPACKFullMatrix< ElementType > &matrix)
ArrayView< ElementType > make_array_view(ElementType(&array)[N])
ArrayView< ElementType, MemorySpaceType > make_array_view(ElementType *const begin, ElementType *const end)
Definition array_view.h:990
const_iterator cend() const
Definition array_view.h:734
ArrayView(const ContiguousContainer &container)
Definition array_view.h:592
iterator end() const
Definition array_view.h:716
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< const ElementType > make_array_view(const Table< 2, ElementType > &table)
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)
ArrayView< ElementType > make_array_view(std::vector< ElementType > &vector)
bool operator==(const ArrayView< const value_type, MemorySpaceType > &other_view) const
Definition array_view.h:632
ArrayView< ElementType > make_array_view(std::vector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
bool operator!=(const ArrayView< const value_type, MemorySpaceType > &other_view) const
Definition array_view.h:655
const_iterator cbegin() const
Definition array_view.h:725
ArrayView(value_type(&array)[N])
Definition array_view.h:614
value_type * data() const noexcept
Definition array_view.h:666
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)
void reinit(value_type *starting_element, const std::size_t n_elements)
Definition array_view.h:523
ArrayView< ElementType > make_array_view(Table< 2, ElementType > &table)
value_type * starting_element
Definition array_view.h:481
std::size_t size() const
Definition array_view.h:689
ElementType value_type
Definition array_view.h:94
ArrayView(const std::initializer_list< std::remove_cv_t< value_type > > &initializer_list)
Definition array_view.h:621
ArrayView(value_type *starting_element, const std::size_t n_elements)
Definition array_view.h:505
std::size_t n_elements
Definition array_view.h:486
ArrayView< const Number, MemorySpaceType > make_array_view(const ArrayView< Number, MemorySpaceType > &array_view)
ArrayView< const ElementType > make_array_view(const Table< 2, ElementType > &table, const typename Table< 2, ElementType >::size_type row)
ArrayView< const ElementType > make_array_view(const AlignedVector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
ArrayView< const ElementType > make_array_view(const AlignedVector< ElementType > &vector)
const ElementType * const_iterator
Definition array_view.h:104
ArrayView< ElementType > make_array_view(Vector< ElementType > &vector)
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)
ArrayView< ElementType > make_array_view(AlignedVector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
ArrayView< const ElementType > make_array_view(const std::array< ElementType, N > &array)
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
Definition array_view.h:954
ArrayView< ElementType > make_array_view(AlignedVector< ElementType > &vector)
std::size_t n_elements
Definition array_view.h:833
StridedArrayView(value_type *starting_element, const std::size_t n_elements)
Definition array_view.h:880
ElementType value_type
Definition array_view.h:765
value_type * starting_element
Definition array_view.h:828
value_type * data() const noexcept
Definition array_view.h:851
std::size_t size() const
Definition array_view.h:872
bool empty() const
Definition array_view.h:863
virtual size_type size() const override
iterator begin()
constexpr LibraryBuildMode library_build_mode
Definition config.h:63
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:35
constexpr bool running_in_debug_mode()
Definition config.h:73
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:242
#define DEAL_II_HOST_DEVICE
Definition config.h:166
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:36
LibraryBuildMode
Definition config.h:51
Point< 2 > first
Definition grid_out.cc:4632
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMessage(std::string arg1)
std::vector< index_type > data
Definition mpi.cc:746
std::size_t size
Definition mpi.cc:745
STL namespace.