Reference documentation for deal.II version GIT c14369f203 2023-10-01 07:40:02+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\}}\)
array_view.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2004 - 2023 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_array_view_h
17 #define dealii_array_view_h
18 
19 #include <deal.II/base/config.h>
20 
24 #include <deal.II/base/tensor.h>
25 
26 #include <array>
27 #include <type_traits>
28 #include <vector>
29 
31 
32 // Forward declaration
33 template <class T>
34 class AlignedVector;
35 
36 template <int N, typename T>
37 class Table;
38 
39 template <typename number>
40 class LAPACKFullMatrix;
41 
42 
84 template <typename ElementType, typename MemorySpaceType = MemorySpace::Host>
85 class ArrayView
86 {
87 public:
93 
97  using iterator = value_type *;
98 
102  using const_iterator = const ElementType *;
103 
108 
129 
140  const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &view);
141 
146  explicit ArrayView(value_type &element);
147 
162  ArrayView(const std::vector<std::remove_cv_t<value_type>> &vector);
163 
178  ArrayView(std::vector<std::remove_cv_t<value_type>> &vector);
179 
194  template <std::size_t N>
195  ArrayView(value_type (&array)[N]);
196 
205  template <std::size_t N>
206  ArrayView(const std::array<std::remove_cv_t<value_type>, N> &vector);
207 
216  template <std::size_t N>
217  ArrayView(std::array<std::remove_cv_t<value_type>, N> &vector);
218 
238  void
240 
254  bool
256  const ArrayView<const value_type, MemorySpaceType> &other_view) const;
257 
271  bool
272  operator==(const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType>
273  &other_view) const;
274 
291  bool
293  const ArrayView<const value_type, MemorySpaceType> &other_view) const;
294 
308  bool
309  operator!=(const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType>
310  &other_view) const;
311 
316  std::size_t
317  size() const;
318 
322  bool
323  empty() const;
324 
330  data() const noexcept;
331 
335  iterator
336  begin() const;
337 
341  iterator
342  end() const;
343 
348  cbegin() const;
349 
354  cend() const;
355 
368  value_type &
369  operator[](const std::size_t i) const;
370 
371 private:
377 
381  std::size_t n_elements;
382 
383  friend class ArrayView<const ElementType, MemorySpaceType>;
384 };
385 
386 
387 
388 //---------------------------------------------------------------------------
389 
390 
391 template <typename ElementType, typename MemorySpaceType>
392 inline ArrayView<ElementType, MemorySpaceType>::ArrayView()
393  : starting_element(nullptr)
394  , n_elements(0)
395 {}
396 
397 
398 
399 template <typename ElementType, typename MemorySpaceType>
402  const std::size_t n_elements)
405 {}
406 
407 
408 
409 template <typename ElementType, typename MemorySpaceType>
410 inline void
412  const std::size_t n_elements)
413 {
414  this->starting_element = starting_element;
415  this->n_elements = n_elements;
416 }
417 
418 
419 
420 template <typename ElementType, typename MemorySpaceType>
422  : starting_element(&element)
423  , n_elements(1)
424 {}
425 
426 
427 
428 template <typename ElementType, typename MemorySpaceType>
430  const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &view)
431  : starting_element(view.starting_element)
432  , n_elements(view.n_elements)
433 {}
434 
435 
436 
437 template <typename ElementType, typename MemorySpaceType>
439  const std::vector<std::remove_cv_t<value_type>> &vector)
440  : // use delegating constructor
441  ArrayView(vector.data(), vector.size())
442 {
443  // the following static_assert is not strictly necessary because,
444  // if we got a const std::vector reference argument but ElementType
445  // is not itself const, then the call to the forwarding constructor
446  // above will already have failed: vector.data() will have returned
447  // a const pointer, but we need a non-const pointer.
448  //
449  // nevertheless, leave the static_assert in since it provides a
450  // more descriptive error message that will simply come after the first
451  // error produced above
452  static_assert(std::is_const_v<value_type> == true,
453  "This constructor may only be called if the ArrayView "
454  "object has a const value_type. In other words, you can "
455  "only create an ArrayView to const values from a const "
456  "std::vector.");
457 }
458 
459 
460 
461 template <typename ElementType, typename MemorySpaceType>
463  std::vector<std::remove_cv_t<value_type>> &vector)
464  : // use delegating constructor
465  ArrayView(vector.data(), vector.size())
466 {}
467 
468 
469 
470 template <typename ElementType, typename MemorySpaceType>
471 template <std::size_t N>
473  const std::array<std::remove_cv_t<value_type>, N> &vector)
474  : // use delegating constructor
475  ArrayView(vector.data(), vector.size())
476 {
477  // the following static_assert is not strictly necessary because,
478  // if we got a const std::array reference argument but ElementType
479  // is not itself const, then the call to the forwarding constructor
480  // above will already have failed: vector.data() will have returned
481  // a const pointer, but we need a non-const pointer.
482  //
483  // nevertheless, leave the static_assert in since it provides a
484  // more descriptive error message that will simply come after the first
485  // error produced above
486  static_assert(std::is_const_v<value_type> == true,
487  "This constructor may only be called if the ArrayView "
488  "object has a const value_type. In other words, you can "
489  "only create an ArrayView to const values from a const "
490  "std::array.");
491 }
492 
493 
494 
495 template <typename ElementType, typename MemorySpaceType>
496 template <std::size_t N>
498  ElementType (&array)[N])
499  : ArrayView(&array[0], N)
500 {}
501 
502 
503 
504 template <typename ElementType, typename MemorySpaceType>
505 template <std::size_t N>
507  std::array<std::remove_cv_t<value_type>, N> &vector)
508  : // use delegating constructor
509  ArrayView(vector.data(), vector.size())
510 {}
511 
512 
513 
514 template <typename ElementType, typename MemorySpaceType>
515 inline bool
517  const ArrayView<const value_type, MemorySpaceType> &other_view) const
518 {
519  return (other_view.data() == starting_element) &&
520  (other_view.size() == n_elements);
521 }
522 
523 
524 
525 template <typename ElementType, typename MemorySpaceType>
526 inline bool
528  const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &other_view)
529  const
530 {
531  return (other_view.data() == starting_element) &&
532  (other_view.size() == n_elements);
533 }
534 
535 
536 
537 template <typename ElementType, typename MemorySpaceType>
538 inline bool
540  const ArrayView<const value_type, MemorySpaceType> &other_view) const
541 {
542  return !(*this == other_view);
543 }
544 
545 
546 
547 template <typename ElementType, typename MemorySpaceType>
548 inline DEAL_II_HOST_DEVICE
551 {
552  if (n_elements == 0)
553  return nullptr;
554  else
555  return starting_element;
556 }
557 
558 
559 
560 template <typename ElementType, typename MemorySpaceType>
561 inline bool
563  const ArrayView<std::remove_cv_t<value_type>, MemorySpaceType> &other_view)
564  const
565 {
566  return !(*this == other_view);
567 }
568 
569 
570 
571 template <typename ElementType, typename MemorySpaceType>
572 inline std::size_t
574 {
575  return n_elements;
576 }
577 
578 
579 
580 template <typename ElementType, typename MemorySpaceType>
581 inline bool
583 {
584  return n_elements == 0;
585 }
586 
587 
588 
589 template <typename ElementType, typename MemorySpaceType>
592 {
593  return starting_element;
594 }
595 
596 
597 
598 template <typename ElementType, typename MemorySpaceType>
601 {
602  return starting_element + n_elements;
603 }
604 
605 
606 
607 template <typename ElementType, typename MemorySpaceType>
610 {
611  return starting_element;
612 }
613 
614 
615 
616 template <typename ElementType, typename MemorySpaceType>
619 {
620  return starting_element + n_elements;
621 }
622 
623 
624 
625 template <typename ElementType, typename MemorySpaceType>
628 {
629  AssertIndexRange(i, n_elements);
630 
631  return *(starting_element + i);
632 }
633 
634 
635 
641 template <typename ElementType, std::size_t stride = 1>
643 {
644 public:
650 
671 
676  std::size_t
677  size() const;
678 
682  bool
683  empty() const;
684 
689  value_type *
690  data() const noexcept;
691 
704  value_type &
705  operator[](const std::size_t i) const;
706 
707 protected:
713 
717  std::size_t n_elements;
718 };
719 
720 
721 
722 template <typename ElementType, std::size_t stride>
723 typename StridedArrayView<ElementType, stride>::value_type &
724 StridedArrayView<ElementType, stride>::operator[](const std::size_t i) const
725 {
726  AssertIndexRange(i, this->n_elements);
727 
728  return *(this->starting_element + stride * i);
729 }
730 
731 
732 
733 template <typename ElementType, std::size_t stride>
736 {
737  if (this->n_elements == 0)
738  return nullptr;
739  else
740  return this->starting_element;
741 }
742 
743 
744 
745 template <typename ElementType, std::size_t stride>
746 bool
748 {
749  return this->n_elements == 0;
750 }
751 
752 
753 
754 template <typename ElementType, std::size_t stride>
755 std::size_t
757 {
758  return this->n_elements;
759 }
760 
761 
762 
763 template <typename ElementType, std::size_t stride>
766  const std::size_t n_elements)
769 {}
770 
771 
772 
773 #ifndef DOXYGEN
774 namespace internal
775 {
776  namespace ArrayViewHelper
777  {
783  template <class Iterator>
784  bool
785  is_contiguous(const Iterator &first, const Iterator &last)
786  {
787  const auto n = std::distance(first, last);
788  for (std::decay_t<decltype(n)> i = 0; i < n; ++i)
789  if (std::addressof(*(std::next(first, i))) !=
790  std::next(std::addressof(*first), i))
791  return false;
792  return true;
793  }
794 
795 
806  template <class T>
807  constexpr bool
808  is_contiguous(T *, T *)
809  {
810  return true;
811  }
812  } // namespace ArrayViewHelper
813 } // namespace internal
814 #endif
815 
816 
817 
834 template <typename Iterator, typename MemorySpaceType = MemorySpace::Host>
835 ArrayView<typename std::remove_reference<
836  typename std::iterator_traits<Iterator>::reference>::type,
837  MemorySpaceType>
838 make_array_view(const Iterator begin, const Iterator end)
839 {
840  static_assert(
841  std::is_same_v<typename std::iterator_traits<Iterator>::iterator_category,
842  typename std::random_access_iterator_tag>
843 #ifdef DEAL_II_HAVE_CXX20
844  ||
845  std::is_same_v<typename std::iterator_traits<Iterator>::iterator_category,
846  typename std::contiguous_iterator_tag>
847 #endif
848  ,
849  "The provided iterator needs to be a random access iterator.");
850  Assert(begin <= end,
851  ExcMessage(
852  "The beginning of the array view needs to be before the end."));
853  Assert(internal::ArrayViewHelper::is_contiguous(begin, end),
854  ExcMessage("The provided range isn't contiguous in memory!"));
855  // the reference type, not the value type, knows the constness of the iterator
856  return ArrayView<typename std::remove_reference<
857  typename std::iterator_traits<Iterator>::reference>::type,
858  MemorySpaceType>(std::addressof(*begin), end - begin);
859 }
860 
861 
862 
872 template <typename ElementType, typename MemorySpaceType = MemorySpace::Host>
875 {
876  Assert(begin <= end,
877  ExcMessage(
878  "The beginning of the array view needs to be before the end."));
880 }
881 
882 
883 
894 template <typename Number, typename MemorySpaceType>
897 {
898  return make_array_view(array_view.cbegin(), array_view.cend());
899 }
900 
901 
902 
913 template <typename Number, typename MemorySpaceType>
916 {
917  return make_array_view(array_view.begin(), array_view.end());
918 }
919 
920 
921 
943 template <int rank, int dim, typename Number>
946 {
947  return make_array_view(tensor.begin_raw(), tensor.end_raw());
948 }
949 
950 
951 
973 template <int rank, int dim, typename Number>
976 {
977  return make_array_view(tensor.begin_raw(), tensor.end_raw());
978 }
979 
980 
981 
1003 template <int rank, int dim, typename Number>
1006 {
1007  return make_array_view(tensor.begin_raw(), tensor.end_raw());
1008 }
1009 
1010 
1011 
1034 template <int rank, int dim, typename Number>
1037 {
1038  return make_array_view(tensor.begin_raw(), tensor.end_raw());
1039 }
1040 
1041 
1042 
1056 template <typename ElementType, int N>
1059 {
1060  return ArrayView<ElementType>(array, N);
1061 }
1062 
1063 
1064 
1079 template <typename ElementType>
1082 {
1083  return ArrayView<ElementType>(vector.begin(), vector.size());
1084 }
1085 
1086 
1087 
1102 template <typename ElementType>
1105 {
1106  return ArrayView<const ElementType>(vector.begin(), vector.size());
1107 }
1108 
1109 
1110 
1125 template <typename ElementType>
1127 make_array_view(std::vector<ElementType> &vector)
1128 {
1129  return ArrayView<ElementType>(vector.data(), vector.size());
1130 }
1131 
1132 
1133 
1148 template <typename ElementType>
1150 make_array_view(const std::vector<ElementType> &vector)
1151 {
1152  return ArrayView<const ElementType>(vector.data(), vector.size());
1153 }
1154 
1155 
1156 
1176 template <typename ElementType>
1178 make_array_view(std::vector<ElementType> &vector,
1179  const std::size_t starting_index,
1180  const std::size_t size_of_view)
1181 {
1182  Assert(starting_index + size_of_view <= vector.size(),
1183  ExcMessage("The starting index and size of the view you want to "
1184  "create would lead to a view that extends beyond the end "
1185  "of the given vector."));
1186  return ArrayView<ElementType>(&vector[starting_index], size_of_view);
1187 }
1188 
1189 
1190 
1210 template <typename ElementType>
1212 make_array_view(const std::vector<ElementType> &vector,
1213  const std::size_t starting_index,
1214  const std::size_t size_of_view)
1215 {
1216  Assert(starting_index + size_of_view <= vector.size(),
1217  ExcMessage("The starting index and size of the view you want to "
1218  "create would lead to a view that extends beyond the end "
1219  "of the given vector."));
1220  return ArrayView<const ElementType>(&vector[starting_index], size_of_view);
1221 }
1222 
1223 
1224 
1232 template <typename ElementType>
1235 {
1236  return ArrayView<ElementType>(vector.data(), vector.size());
1237 }
1238 
1239 
1240 
1248 template <typename ElementType>
1251 {
1252  return ArrayView<const ElementType>(vector.data(), vector.size());
1253 }
1254 
1255 
1256 
1264 template <typename ElementType>
1267  const std::size_t starting_index,
1268  const std::size_t size_of_view)
1269 {
1270  Assert(starting_index + size_of_view <= vector.size(),
1271  ExcMessage("The starting index and size of the view you want to "
1272  "create would lead to a view that extends beyond the end "
1273  "of the given vector."));
1274  return ArrayView<ElementType>(&vector[starting_index], size_of_view);
1275 }
1276 
1277 
1278 
1286 template <typename ElementType>
1289  const std::size_t starting_index,
1290  const std::size_t size_of_view)
1291 {
1292  Assert(starting_index + size_of_view <= vector.size(),
1293  ExcMessage("The starting index and size of the view you want to "
1294  "create would lead to a view that extends beyond the end "
1295  "of the given vector."));
1296  return ArrayView<const ElementType>(&vector[starting_index], size_of_view);
1297 }
1298 
1299 
1300 
1315 template <typename ElementType, std::size_t N>
1317 make_array_view(std::array<ElementType, N> &array)
1318 {
1319  return ArrayView<ElementType>(array);
1320 }
1321 
1322 
1323 
1338 template <typename ElementType, std::size_t N>
1340 make_array_view(const std::array<ElementType, N> &array)
1341 {
1342  return ArrayView<const ElementType>(array);
1343 }
1344 
1345 
1346 
1363 template <typename ElementType>
1366  const typename Table<2, ElementType>::size_type row)
1367 {
1368  AssertIndexRange(row, table.size()[0]);
1369  return ArrayView<ElementType>(&table[row][0], table.size()[1]);
1370 }
1371 
1372 
1373 
1390 template <typename ElementType>
1393 {
1394  return ArrayView<ElementType>(&table[0][0], table.n_elements());
1395 }
1396 
1397 
1398 
1415 template <typename ElementType>
1418 {
1419  return ArrayView<const ElementType>(&table[0][0], table.n_elements());
1420 }
1421 
1422 
1440 template <typename ElementType>
1443 {
1444  return ArrayView<ElementType>(&matrix(0, 0), matrix.n_elements());
1445 }
1446 
1447 
1448 
1465 template <typename ElementType>
1468 {
1469  return ArrayView<const ElementType>(&matrix(0, 0), matrix.n_elements());
1470 }
1471 
1472 
1473 
1490 template <typename ElementType>
1493  const typename Table<2, ElementType>::size_type row)
1494 {
1495  AssertIndexRange(row, table.size()[0]);
1496  return ArrayView<const ElementType>(&table[row][0], table.size()[1]);
1497 }
1498 
1499 
1500 
1520 template <typename ElementType>
1523  const typename Table<2, ElementType>::size_type row,
1524  const typename Table<2, ElementType>::size_type starting_column,
1525  const std::size_t size_of_view)
1526 {
1527  AssertIndexRange(row, table.size()[0]);
1528  AssertIndexRange(starting_column, table.size()[1]);
1529  Assert(starting_column + size_of_view <= table.size()[1],
1530  ExcMessage("The starting index and size of the view you want to "
1531  "create would lead to a view that extends beyond the end "
1532  "of a column of the given table."));
1533  return ArrayView<ElementType>(&table[row][starting_column], size_of_view);
1534 }
1535 
1536 
1537 
1557 template <typename ElementType>
1560  const typename Table<2, ElementType>::size_type row,
1561  const typename Table<2, ElementType>::size_type starting_column,
1562  const std::size_t size_of_view)
1563 {
1564  AssertIndexRange(row, table.size()[0]);
1565  AssertIndexRange(starting_column, table.size()[1]);
1566  Assert(starting_column + size_of_view <= table.size()[1],
1567  ExcMessage("The starting index and size of the view you want to "
1568  "create would lead to a view that extends beyond the end "
1569  "of a column of the given table."));
1570  return ArrayView<const ElementType>(&table[row][starting_column],
1571  size_of_view);
1572 }
1573 
1574 
1575 
1576 /*
1577  * Create a view that doesn't allow the container it points to to be modified.
1578  * This is useful if the object passed in is not `const` already and a function
1579  * requires a view to constant memory in its signature.
1580  *
1581  * This function returns an object of type `ArrayView<const T>` where `T` is the
1582  * element type of the container.
1583  *
1584  * @relatesalso ArrayView
1585  */
1586 template <typename Container>
1587 inline auto
1588 make_const_array_view(const Container &container)
1589  -> decltype(make_array_view(container))
1590 {
1591  return make_array_view(container);
1592 }
1593 
1594 
1596 
1597 #endif
auto make_const_array_view(const Container &container) -> decltype(make_array_view(container))
Definition: array_view.h:1588
pointer data()
size_type size() const
ArrayView< const ElementType > make_array_view(const Vector< ElementType > &vector)
Definition: array_view.h:1104
ArrayView(value_type &element)
Definition: array_view.h:421
iterator begin() const
Definition: array_view.h:591
bool operator!=(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &other_view) const
Definition: array_view.h:562
ArrayView< Number, MemorySpaceType > make_array_view(ArrayView< Number, MemorySpaceType > &array_view)
Definition: array_view.h:915
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:838
ArrayView(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &view)
Definition: array_view.h:429
value_type * iterator
Definition: array_view.h:97
ArrayView< Number > make_array_view(SymmetricTensor< rank, dim, Number > &tensor)
Definition: array_view.h:1036
value_type & operator[](const std::size_t i) const
Definition: array_view.h:627
ArrayView(const std::array< std::remove_cv_t< value_type >, N > &vector)
Definition: array_view.h:472
ArrayView< const ElementType > make_array_view(const LAPACKFullMatrix< ElementType > &matrix)
Definition: array_view.h:1467
ArrayView< ElementType > make_array_view(std::array< ElementType, N > &array)
Definition: array_view.h:1317
bool empty() const
Definition: array_view.h:582
ArrayView< const Number > make_array_view(const Tensor< rank, dim, Number > &tensor)
Definition: array_view.h:945
bool operator==(const ArrayView< std::remove_cv_t< value_type >, MemorySpaceType > &other_view) const
Definition: array_view.h:527
ArrayView< const Number > make_array_view(const SymmetricTensor< rank, dim, Number > &tensor)
Definition: array_view.h:1005
ArrayView< ElementType > make_array_view(LAPACKFullMatrix< ElementType > &matrix)
Definition: array_view.h:1442
ArrayView< ElementType > make_array_view(ElementType(&array)[N])
Definition: array_view.h:1058
ArrayView< ElementType, MemorySpaceType > make_array_view(ElementType *const begin, ElementType *const end)
Definition: array_view.h:874
const_iterator cend() const
Definition: array_view.h:618
iterator end() const
Definition: array_view.h:600
ArrayView< const ElementType > make_array_view(const std::vector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
Definition: array_view.h:1212
ArrayView(std::array< std::remove_cv_t< value_type >, N > &vector)
Definition: array_view.h:506
ArrayView< const ElementType > make_array_view(const Table< 2, ElementType > &table)
Definition: array_view.h:1417
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)
Definition: array_view.h:1559
ArrayView< ElementType > make_array_view(std::vector< ElementType > &vector)
Definition: array_view.h:1127
bool operator==(const ArrayView< const value_type, MemorySpaceType > &other_view) const
Definition: array_view.h:516
ArrayView< ElementType > make_array_view(std::vector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
Definition: array_view.h:1178
bool operator!=(const ArrayView< const value_type, MemorySpaceType > &other_view) const
Definition: array_view.h:539
const_iterator cbegin() const
Definition: array_view.h:609
ArrayView(value_type(&array)[N])
Definition: array_view.h:497
ArrayView< Number > make_array_view(Tensor< rank, dim, Number > &tensor)
Definition: array_view.h:975
value_type * data() const noexcept
Definition: array_view.h:550
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)
Definition: array_view.h:1522
void reinit(value_type *starting_element, const std::size_t n_elements)
Definition: array_view.h:411
ArrayView< ElementType > make_array_view(Table< 2, ElementType > &table)
Definition: array_view.h:1392
value_type * starting_element
Definition: array_view.h:376
ArrayView(const std::vector< std::remove_cv_t< value_type >> &vector)
Definition: array_view.h:438
std::size_t size() const
Definition: array_view.h:573
ElementType value_type
Definition: array_view.h:92
ArrayView(value_type *starting_element, const std::size_t n_elements)
Definition: array_view.h:400
std::size_t n_elements
Definition: array_view.h:381
ArrayView< const Number, MemorySpaceType > make_array_view(const ArrayView< Number, MemorySpaceType > &array_view)
Definition: array_view.h:896
ArrayView< const ElementType > make_array_view(const Table< 2, ElementType > &table, const typename Table< 2, ElementType >::size_type row)
Definition: array_view.h:1492
ArrayView< const ElementType > make_array_view(const AlignedVector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
Definition: array_view.h:1288
ArrayView< const ElementType > make_array_view(const AlignedVector< ElementType > &vector)
Definition: array_view.h:1250
const ElementType * const_iterator
Definition: array_view.h:102
ArrayView< ElementType > make_array_view(Vector< ElementType > &vector)
Definition: array_view.h:1081
ArrayView< ElementType > make_array_view(Table< 2, ElementType > &table, const typename Table< 2, ElementType >::size_type row)
Definition: array_view.h:1365
ArrayView(std::vector< std::remove_cv_t< value_type >> &vector)
Definition: array_view.h:462
ArrayView< const ElementType > make_array_view(const std::vector< ElementType > &vector)
Definition: array_view.h:1150
ArrayView< ElementType > make_array_view(AlignedVector< ElementType > &vector, const std::size_t starting_index, const std::size_t size_of_view)
Definition: array_view.h:1266
ArrayView< const ElementType > make_array_view(const std::array< ElementType, N > &array)
Definition: array_view.h:1340
ArrayView< ElementType > make_array_view(AlignedVector< ElementType > &vector)
Definition: array_view.h:1234
std::size_t n_elements
Definition: array_view.h:717
StridedArrayView(value_type *starting_element, const std::size_t n_elements)
Definition: array_view.h:764
ElementType value_type
Definition: array_view.h:649
value_type * starting_element
Definition: array_view.h:712
value_type * data() const noexcept
Definition: array_view.h:735
std::size_t size() const
Definition: array_view.h:756
bool empty() const
Definition: array_view.h:747
Number * begin_raw()
Number * end_raw()
Definition: tensor.h:516
Number * end_raw()
Number * begin_raw()
Definition: vector.h:110
virtual size_type size() const override
iterator begin()
#define DEAL_II_DEPRECATED
Definition: config.h:178
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:477
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:478
Point< 2 > first
Definition: grid_out.cc:4614
#define Assert(cond, exc)
Definition: exceptions.h:1616
#define AssertIndexRange(index, range)
Definition: exceptions.h:1857
static ::ExceptionBase & ExcMessage(std::string arg1)
@ matrix
Contents is actually a matrix.
static const char T
static const char N
VectorType::value_type * begin(VectorType &V)
VectorType::value_type * end(VectorType &V)
#define DEAL_II_HOST_DEVICE
Definition: numbers.h:35