Reference documentation for deal.II version GIT relicensing-35-gbe64a602e6 2024-03-01 21:20:01+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\}}\)
Loading...
Searching...
No Matches
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 - 2023 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
320 ArrayView(
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 :
509#ifdef DEBUG
511#else
513#endif
515{}
516
517
518
519template <typename ElementType, typename MemorySpaceType>
520inline void
521ArrayView<ElementType, MemorySpaceType>::reinit(value_type *starting_element,
522 const std::size_t n_elements)
523{
524#ifdef DEBUG
525 if (n_elements > 0)
526 this->starting_element = starting_element;
527 else
528 this->starting_element = nullptr;
529#else
530 this->starting_element = starting_element;
531#endif
532 this->n_elements = n_elements;
533}
534
535
536
537template <typename ElementType, typename MemorySpaceType>
539 : starting_element(&element)
540 , n_elements(1)
541{}
542
543
544
545template <typename ElementType, typename MemorySpaceType>
547 const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &view)
548 : starting_element(view.starting_element)
549 , n_elements(view.n_elements)
550{}
551
552
553#ifdef DEAL_II_HAVE_CXX20
554
555template <typename ElementType, typename MemorySpaceType>
556template <typename ContiguousContainer>
558 const ContiguousContainer &container)
559 requires(std::is_same_v<
560 std::remove_cv_t<ElementType>,
561 std::remove_cv_t<typename ContiguousContainer::value_type>> &&
562 std::is_const_v<ElementType> &&
564 : // use delegating constructor
565 ArrayView(container.data(), container.size())
566{}
567
568
569
570template <typename ElementType, typename MemorySpaceType>
571template <typename ContiguousContainer>
573 ContiguousContainer &container)
574 requires(std::is_same_v<
575 std::remove_cv_t<ElementType>,
576 std::remove_cv_t<typename ContiguousContainer::value_type>> &&
578 : // use delegating constructor
579 ArrayView(std::data(container), std::size(container))
580{}
581
582
583#else
584
585template <typename ElementType, typename MemorySpaceType>
586template <typename ContiguousContainer, typename, typename, typename>
588 const ContiguousContainer &container)
589 : // use delegating constructor
590 ArrayView(container.data(), container.size())
591{}
592
593
594
595template <typename ElementType, typename MemorySpaceType>
596template <typename ContiguousContainer, typename, typename, typename>
598 ContiguousContainer &container)
599 : // use delegating constructor
600 ArrayView(std::data(container), std::size(container))
601{}
602
603#endif
604
605
606
607template <typename ElementType, typename MemorySpaceType>
608template <std::size_t N>
610 ElementType (&array)[N])
611 : ArrayView(&array[0], N)
612{}
613
614
615template <typename ElementType, typename MemorySpaceType>
617 const std::initializer_list<std::remove_cv_t<value_type>> &initializer)
618 DEAL_II_CXX20_REQUIRES(std::is_const_v<ElementType>)
619 : // use delegating constructor
620 ArrayView(initializer.begin(), initializer.size())
621{}
622
623
624
625template <typename ElementType, typename MemorySpaceType>
626inline bool
628 const ArrayView<const value_type, MemorySpaceType> &other_view) const
629{
630 return (other_view.data() == starting_element) &&
631 (other_view.size() == n_elements);
632}
633
634
635
636template <typename ElementType, typename MemorySpaceType>
637inline bool
639 const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &other_view)
640 const
641{
642 return (other_view.data() == starting_element) &&
643 (other_view.size() == n_elements);
644}
645
646
647
648template <typename ElementType, typename MemorySpaceType>
649inline bool
651 const ArrayView<const value_type, MemorySpaceType> &other_view) const
652{
653 return !(*this == other_view);
654}
655
656
657
658template <typename ElementType, typename MemorySpaceType>
662{
663 if (n_elements == 0)
664 return nullptr;
665 else
666 return starting_element;
667}
668
669
670
671template <typename ElementType, typename MemorySpaceType>
672inline bool
674 const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &other_view)
675 const
676{
677 return !(*this == other_view);
678}
679
680
681
682template <typename ElementType, typename MemorySpaceType>
683inline std::size_t
685{
686 return n_elements;
687}
688
689
690
691template <typename ElementType, typename MemorySpaceType>
692inline bool
694{
695 return n_elements == 0;
696}
697
698
699
700template <typename ElementType, typename MemorySpaceType>
703{
704 return starting_element;
705}
706
707
708
709template <typename ElementType, typename MemorySpaceType>
712{
713 return starting_element + n_elements;
714}
715
716
717
718template <typename ElementType, typename MemorySpaceType>
721{
722 return starting_element;
723}
724
725
726
727template <typename ElementType, typename MemorySpaceType>
730{
731 return starting_element + n_elements;
732}
733
734
735
736template <typename ElementType, typename MemorySpaceType>
739{
740 AssertIndexRange(i, n_elements);
741
742 return *(starting_element + i);
743}
744
745
746
752template <typename ElementType, std::size_t stride = 1>
754{
755public:
760 using value_type = ElementType;
761
782
787 std::size_t
788 size() const;
789
793 bool
794 empty() const;
795
800 value_type *
801 data() const noexcept;
802
815 value_type &
816 operator[](const std::size_t i) const;
817
818protected:
824
829};
830
831
832
833template <typename ElementType, std::size_t stride>
834typename StridedArrayView<ElementType, stride>::value_type &
835StridedArrayView<ElementType, stride>::operator[](const std::size_t i) const
836{
837 AssertIndexRange(i, this->n_elements);
838
839 return *(this->starting_element + stride * i);
840}
841
842
843
844template <typename ElementType, std::size_t stride>
847{
848 if (this->n_elements == 0)
849 return nullptr;
850 else
851 return this->starting_element;
852}
853
854
855
856template <typename ElementType, std::size_t stride>
857bool
859{
860 return this->n_elements == 0;
861}
862
863
864
865template <typename ElementType, std::size_t stride>
866std::size_t
868{
869 return this->n_elements;
870}
871
872
873
874template <typename ElementType, std::size_t stride>
881
882
883
884#ifndef DOXYGEN
885namespace internal
886{
887 namespace ArrayViewHelper
888 {
894 template <class Iterator>
895 bool
896 is_contiguous(const Iterator &first, const Iterator &last)
897 {
898 const auto n = std::distance(first, last);
899 for (std::decay_t<decltype(n)> i = 0; i < n; ++i)
900 if (std::addressof(*(std::next(first, i))) !=
901 std::next(std::addressof(*first), i))
902 return false;
903 return true;
904 }
905
906
917 template <class T>
918 constexpr bool
919 is_contiguous(T *, T *)
920 {
921 return true;
922 }
923 } // namespace ArrayViewHelper
924} // namespace internal
925#endif
926
927
928
945template <typename Iterator, typename MemorySpaceType = MemorySpace::Host>
946ArrayView<typename std::remove_reference<
947 typename std::iterator_traits<Iterator>::reference>::type,
948 MemorySpaceType>
949make_array_view(const Iterator begin, const Iterator end)
950{
951 static_assert(
952 std::is_same_v<typename std::iterator_traits<Iterator>::iterator_category,
953 typename std::random_access_iterator_tag>
954#ifdef DEAL_II_HAVE_CXX20
955 ||
956 std::is_same_v<typename std::iterator_traits<Iterator>::iterator_category,
957 typename std::contiguous_iterator_tag>
958#endif
959 ,
960 "The provided iterator needs to be a random access iterator.");
961 Assert(begin <= end,
963 "The beginning of the array view needs to be before the end."));
964 Assert(internal::ArrayViewHelper::is_contiguous(begin, end),
965 ExcMessage("The provided range isn't contiguous in memory!"));
966 // the reference type, not the value type, knows the constness of the iterator
967 return ArrayView<typename std::remove_reference<
968 typename std::iterator_traits<Iterator>::reference>::type,
969 MemorySpaceType>(std::addressof(*begin), end - begin);
970}
971
972
973
983template <typename ElementType, typename MemorySpaceType = MemorySpace::Host>
985make_array_view(ElementType *const begin, ElementType *const end)
986{
987 Assert(begin <= end,
989 "The beginning of the array view needs to be before the end."));
990 return ArrayView<ElementType, MemorySpaceType>(begin, end - begin);
991}
992
993
994
1005template <typename Number, typename MemorySpaceType>
1008{
1009 return make_array_view(array_view.cbegin(), array_view.cend());
1010}
1011
1012
1013
1024template <typename Number, typename MemorySpaceType>
1027{
1028 return make_array_view(array_view.begin(), array_view.end());
1029}
1030
1031
1032
1054template <int rank, int dim, typename Number>
1057{
1058 return make_array_view(tensor.begin_raw(), tensor.end_raw());
1059}
1060
1061
1062
1084template <int rank, int dim, typename Number>
1087{
1088 return make_array_view(tensor.begin_raw(), tensor.end_raw());
1089}
1090
1091
1092
1114template <int rank, int dim, typename Number>
1117{
1118 return make_array_view(tensor.begin_raw(), tensor.end_raw());
1119}
1120
1121
1122
1145template <int rank, int dim, typename Number>
1148{
1149 return make_array_view(tensor.begin_raw(), tensor.end_raw());
1150}
1151
1152
1153
1167template <typename ElementType, int N>
1169make_array_view(ElementType (&array)[N])
1170{
1171 return ArrayView<ElementType>(array, N);
1172}
1173
1174
1175
1190template <typename ElementType>
1193{
1194 return ArrayView<ElementType>(vector.begin(), vector.size());
1195}
1196
1197
1198
1213template <typename ElementType>
1216{
1217 return ArrayView<const ElementType>(vector.begin(), vector.size());
1218}
1219
1220
1221
1236template <typename ElementType>
1238make_array_view(std::vector<ElementType> &vector)
1239{
1240 return ArrayView<ElementType>(vector.data(), vector.size());
1241}
1242
1243
1244
1259template <typename ElementType>
1261make_array_view(const std::vector<ElementType> &vector)
1262{
1263 return ArrayView<const ElementType>(vector.data(), vector.size());
1264}
1265
1266
1267
1287template <typename ElementType>
1289make_array_view(std::vector<ElementType> &vector,
1290 const std::size_t starting_index,
1291 const std::size_t size_of_view)
1292{
1293 Assert(starting_index + size_of_view <= vector.size(),
1294 ExcMessage("The starting index and size of the view you want to "
1295 "create would lead to a view that extends beyond the end "
1296 "of the given vector."));
1297 return ArrayView<ElementType>(&vector[starting_index], size_of_view);
1298}
1299
1300
1301
1321template <typename ElementType>
1323make_array_view(const std::vector<ElementType> &vector,
1324 const std::size_t starting_index,
1325 const std::size_t size_of_view)
1326{
1327 Assert(starting_index + size_of_view <= vector.size(),
1328 ExcMessage("The starting index and size of the view you want to "
1329 "create would lead to a view that extends beyond the end "
1330 "of the given vector."));
1331 return ArrayView<const ElementType>(&vector[starting_index], size_of_view);
1332}
1333
1334
1335
1343template <typename ElementType>
1346{
1347 return ArrayView<ElementType>(vector.data(), vector.size());
1348}
1349
1350
1351
1359template <typename ElementType>
1362{
1363 return ArrayView<const ElementType>(vector.data(), vector.size());
1364}
1365
1366
1367
1375template <typename ElementType>
1378 const std::size_t starting_index,
1379 const std::size_t size_of_view)
1380{
1381 Assert(starting_index + size_of_view <= vector.size(),
1382 ExcMessage("The starting index and size of the view you want to "
1383 "create would lead to a view that extends beyond the end "
1384 "of the given vector."));
1385 return ArrayView<ElementType>(&vector[starting_index], size_of_view);
1386}
1387
1388
1389
1397template <typename ElementType>
1400 const std::size_t starting_index,
1401 const std::size_t size_of_view)
1402{
1403 Assert(starting_index + size_of_view <= vector.size(),
1404 ExcMessage("The starting index and size of the view you want to "
1405 "create would lead to a view that extends beyond the end "
1406 "of the given vector."));
1407 return ArrayView<const ElementType>(&vector[starting_index], size_of_view);
1408}
1409
1410
1411
1426template <typename ElementType, std::size_t N>
1428make_array_view(std::array<ElementType, N> &array)
1429{
1430 return ArrayView<ElementType>(array);
1431}
1432
1433
1434
1449template <typename ElementType, std::size_t N>
1451make_array_view(const std::array<ElementType, N> &array)
1452{
1453 return ArrayView<const ElementType>(array);
1454}
1455
1456
1457
1474template <typename ElementType>
1477 const typename Table<2, ElementType>::size_type row)
1478{
1479 AssertIndexRange(row, table.size()[0]);
1480 return ArrayView<ElementType>(&table[row][0], table.size()[1]);
1481}
1482
1483
1484
1501template <typename ElementType>
1504{
1505 return ArrayView<ElementType>(&table[0][0], table.n_elements());
1506}
1507
1508
1509
1526template <typename ElementType>
1529{
1530 return ArrayView<const ElementType>(&table[0][0], table.n_elements());
1531}
1532
1533
1551template <typename ElementType>
1554{
1555 return ArrayView<ElementType>(&matrix(0, 0), matrix.n_elements());
1556}
1557
1558
1559
1576template <typename ElementType>
1579{
1580 return ArrayView<const ElementType>(&matrix(0, 0), matrix.n_elements());
1581}
1582
1583
1584
1601template <typename ElementType>
1604 const typename Table<2, ElementType>::size_type row)
1605{
1606 AssertIndexRange(row, table.size()[0]);
1607 return ArrayView<const ElementType>(&table[row][0], table.size()[1]);
1608}
1609
1610
1611
1631template <typename ElementType>
1634 const typename Table<2, ElementType>::size_type row,
1635 const typename Table<2, ElementType>::size_type starting_column,
1636 const std::size_t size_of_view)
1637{
1638 AssertIndexRange(row, table.size()[0]);
1639 AssertIndexRange(starting_column, table.size()[1]);
1640 Assert(starting_column + size_of_view <= table.size()[1],
1641 ExcMessage("The starting index and size of the view you want to "
1642 "create would lead to a view that extends beyond the end "
1643 "of a column of the given table."));
1644 return ArrayView<ElementType>(&table[row][starting_column], size_of_view);
1645}
1646
1647
1648
1668template <typename ElementType>
1671 const typename Table<2, ElementType>::size_type row,
1672 const typename Table<2, ElementType>::size_type starting_column,
1673 const std::size_t size_of_view)
1674{
1675 AssertIndexRange(row, table.size()[0]);
1676 AssertIndexRange(starting_column, table.size()[1]);
1677 Assert(starting_column + size_of_view <= table.size()[1],
1678 ExcMessage("The starting index and size of the view you want to "
1679 "create would lead to a view that extends beyond the end "
1680 "of a column of the given table."));
1681 return ArrayView<const ElementType>(&table[row][starting_column],
1682 size_of_view);
1683}
1684
1685
1686
1687/*
1688 * Create a view that doesn't allow the container it points to to be modified.
1689 * This is useful if the object passed in is not `const` already and a function
1690 * requires a view to constant memory in its signature.
1691 *
1692 * This function returns an object of type `ArrayView<const T>` where `T` is the
1693 * element type of the container.
1694 *
1695 * @relatesalso ArrayView
1696 */
1697template <typename Container>
1698inline auto
1699make_const_array_view(const Container &container)
1700 -> decltype(make_array_view(container))
1701{
1702 return make_array_view(container);
1703}
1704
1705
1707
1708#endif
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
Definition array_view.h:949
auto make_const_array_view(const Container &container) -> decltype(make_array_view(container))
pointer data()
size_type size() const
ArrayView(ContiguousContainer &container)
Definition array_view.h:597
ArrayView< const ElementType > make_array_view(const Vector< ElementType > &vector)
ArrayView(value_type &element)
Definition array_view.h:538
iterator begin() const
Definition array_view.h:702
bool operator!=(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &other_view) const
Definition array_view.h:673
ArrayView< Number, MemorySpaceType > make_array_view(ArrayView< Number, MemorySpaceType > &array_view)
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
Definition array_view.h:949
ArrayView(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &view)
Definition array_view.h:546
value_type * iterator
Definition array_view.h:99
ArrayView< Number > make_array_view(SymmetricTensor< rank, dim, Number > &tensor)
value_type & operator[](const std::size_t i) const
Definition array_view.h:738
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:693
ArrayView< const Number > make_array_view(const Tensor< rank, dim, Number > &tensor)
bool operator==(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &other_view) const
Definition array_view.h:638
ArrayView< const Number > make_array_view(const SymmetricTensor< rank, dim, Number > &tensor)
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:985
const_iterator cend() const
Definition array_view.h:729
ArrayView(const ContiguousContainer &container)
Definition array_view.h:587
iterator end() const
Definition array_view.h:711
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:627
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:650
const_iterator cbegin() const
Definition array_view.h:720
ArrayView(value_type(&array)[N])
Definition array_view.h:609
ArrayView< Number > make_array_view(Tensor< rank, dim, Number > &tensor)
value_type * data() const noexcept
Definition array_view.h:661
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)
ArrayView(const std::initializer_list< std::remove_cv_t< value_type > > &initializer_list) DEAL_II_CXX20_REQUIRES(std void reinit(value_type *starting_element, const std::size_t n_elements)
Definition array_view.h:344
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:684
ElementType value_type
Definition array_view.h:94
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< ElementType > make_array_view(AlignedVector< ElementType > &vector)
std::size_t n_elements
Definition array_view.h:828
StridedArrayView(value_type *starting_element, const std::size_t n_elements)
Definition array_view.h:875
ElementType value_type
Definition array_view.h:760
value_type * starting_element
Definition array_view.h:823
value_type * data() const noexcept
Definition array_view.h:846
std::size_t size() const
Definition array_view.h:867
bool empty() const
Definition array_view.h:858
Number * begin_raw()
Number * end_raw()
Number * begin_raw()
Number * end_raw()
virtual size_type size() const override
iterator begin()
#define DEAL_II_DEPRECATED
Definition config.h:207
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:177
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
Point< 2 > first
Definition grid_out.cc:4613
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMessage(std::string arg1)
STL namespace.
#define DEAL_II_HOST_DEVICE
Definition numbers.h:34