16 #ifndef dealii_table_h 17 #define dealii_table_h 19 #include <deal.II/base/config.h> 20 #include <deal.II/base/exceptions.h> 21 #include <deal.II/base/subscriptor.h> 22 #include <deal.II/base/table_indices.h> 23 #include <deal.II/base/memory_consumption.h> 24 #include <deal.II/base/aligned_vector.h> 25 #include <deal.II/base/linear_index_iterator.h> 30 DEAL_II_NAMESPACE_OPEN
34 template <
int N,
typename T>
class Table;
36 template <
typename T>
class Table<1,T>;
37 template <
typename T>
class Table<2,T>;
38 template <
typename T>
class Table<3,T>;
39 template <
typename T>
class Table<4,T>;
40 template <
typename T>
class Table<5,T>;
41 template <
typename T>
class Table<6,T>;
64 namespace TableBaseAccessors
73 template <
int N,
typename T,
bool Constness>
82 template <
int N,
typename T>
struct Types<N,T,true>
84 typedef const T value_type;
87 typedef typename AlignedVector<T>::const_iterator iterator;
88 typedef typename AlignedVector<T>::const_iterator const_iterator;
90 typedef typename AlignedVector<T>::const_reference reference;
91 typedef typename AlignedVector<T>::const_reference const_reference;
99 template <
int N,
typename T>
struct Types<N,T,false>
101 typedef T value_type;
104 typedef typename AlignedVector<T>::iterator iterator;
105 typedef typename AlignedVector<T>::const_iterator const_iterator;
107 typedef typename AlignedVector<T>::reference reference;
108 typedef typename AlignedVector<T>::const_reference const_reference;
150 template <
int N,
typename T,
bool C,
unsigned int P>
154 typedef typename Types<N,T,C>::TableType TableType;
156 typedef typename Types<N,T,C>::iterator iterator;
157 typedef typename Types<N,T,C>::const_iterator const_iterator;
160 typedef ptrdiff_t difference_type;
167 Accessor (
const TableType &table,
168 const iterator data);
173 Accessor () =
delete;
184 Accessor (
const Accessor &a);
189 Accessor<N,T,
C,P-1> operator [] (
const size_type i)
const;
196 <<
"Index " << N-P+1 <<
"has a value of " 197 << arg1 <<
" but needs to be in the range [" 198 << arg2 <<
"," << arg3 <<
"[.");
205 const TableType &table;
212 template <
int N1,
typename T1>
friend class ::Table;
213 template <
int N1,
typename T1,
bool C1,
unsigned int P1>
214 friend class Accessor;
215 # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG 216 friend class ::Table<N,T>;
217 friend class Accessor<N,T,
C,P+1>;
232 template <
int N,
typename T,
bool C>
233 class Accessor<N,T,
C,1>
241 typedef typename Types<N,T,C>::value_type value_type;
243 typedef typename Types<N,T,C>::iterator iterator;
244 typedef typename Types<N,T,C>::const_iterator const_iterator;
246 typedef typename Types<N,T,C>::reference reference;
247 typedef typename Types<N,T,C>::const_reference const_reference;
250 typedef ptrdiff_t difference_type;
255 typedef typename Types<N,T,C>::TableType TableType;
270 Accessor (
const TableType &table,
271 const iterator data);
276 Accessor () =
delete;
286 Accessor (
const Accessor &a);
292 reference operator [] (
const size_type)
const;
303 iterator begin ()
const;
308 iterator end ()
const;
316 const TableType &table;
323 template <
int N1,
typename T1>
friend class ::Table;
324 template <
int N1,
typename T1,
bool C1,
unsigned int P1>
325 friend class Accessor;
326 # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG 327 friend class ::Table<2,T>;
328 friend class Accessor<N,T,
C,2>;
404 template <
int N,
typename T>
408 typedef T value_type;
432 template <
typename InputIterator>
434 InputIterator entries,
435 const bool C_style_indexing =
true);
446 template <
typename T2>
476 template <
typename T2>
505 const bool omit_default_initialization =
false);
565 template <
typename InputIterator>
566 void fill (InputIterator entries,
567 const bool C_style_indexing =
true);
572 void fill (
const T &value);
577 typename AlignedVector<T>::reference
587 typename AlignedVector<T>::const_reference
614 template <
class Archive>
615 void serialize (Archive &ar,
const unsigned int version);
642 typename AlignedVector<T>::const_reference
el (
const TableIndices<N> &indices)
const;
675 template <
int N,
typename T>
693 template <
typename T>
749 template <
typename InputIterator>
751 InputIterator entries,
752 const bool C_style_indexing =
true);
758 typename AlignedVector<T>::const_reference
765 typename AlignedVector<T>::reference
772 typename AlignedVector<T>::const_reference
779 typename AlignedVector<T>::reference
786 typename AlignedVector<T>::reference
793 typename AlignedVector<T>::const_reference
812 template <
typename T>
870 template <
typename InputIterator>
873 InputIterator entries,
874 const bool C_style_indexing =
true);
883 const bool omit_default_initialization =
false);
893 ::internal::TableBaseAccessors::Accessor<2,T,true,1>
902 ::internal::TableBaseAccessors::Accessor<2,T,false,1>
911 typename AlignedVector<T>::const_reference
922 typename AlignedVector<T>::reference
930 typename AlignedVector<T>::reference
937 typename AlignedVector<T>::const_reference
964 typename AlignedVector<T>::reference
el (
const size_type i,
981 typename AlignedVector<T>::const_reference
el (
const size_type i,
997 template <
typename T>
1058 template <
typename InputIterator>
1062 InputIterator entries,
1063 const bool C_style_indexing =
true);
1072 ::internal::TableBaseAccessors::Accessor<3,T,true,2>
1082 ::internal::TableBaseAccessors::Accessor<3,T,false,2>
1131 template <
typename T>
1160 ::internal::TableBaseAccessors::Accessor<4,T,true,3>
1170 ::internal::TableBaseAccessors::Accessor<4,T,false,3>
1200 typename AlignedVector<T>::reference
1207 typename AlignedVector<T>::const_reference
1223 template <
typename T>
1254 ::internal::TableBaseAccessors::Accessor<5,T,true,4>
1264 ::internal::TableBaseAccessors::Accessor<5,T,false,4>
1295 typename AlignedVector<T>::reference
1302 typename AlignedVector<T>::const_reference
1318 template <
typename T>
1349 ::internal::TableBaseAccessors::Accessor<6,T,true,5>
1359 ::internal::TableBaseAccessors::Accessor<6,T,false,5>
1392 typename AlignedVector<T>::reference
1399 typename AlignedVector<T>::const_reference
1414 template <
typename T>
1446 ::internal::TableBaseAccessors::Accessor<7,T,true,6>
1456 ::internal::TableBaseAccessors::Accessor<7,T,false,6>
1491 typename AlignedVector<T>::reference
1498 typename AlignedVector<T>::const_reference
1511 template <
typename T,
bool Constness>
1518 template <
typename T,
bool Constness>
1525 template <
typename T,
bool Constness>
1532 typedef typename std::conditional<Constness, const TransposeTable<T>*,
TransposeTable<T>*>::type
1561 const T &
value()
const;
1603 template <
typename T>
1617 template <
typename T>
1654 template <
typename T,
bool Constness>
1666 typedef typename std::conditional<Constness, const TransposeTable<T>*,
TransposeTable<T>*>::type
1695 const std::ptrdiff_t linear_index);
1713 template <
typename T>
1766 const bool omit_default_initialization =
false);
1870 template <
int N,
typename T>
1878 template <
int N,
typename T>
1879 template <
typename InputIterator>
1882 InputIterator entries,
1883 const bool C_style_indexing)
1886 fill (entries, C_style_indexing);
1892 template <
int N,
typename T>
1903 template <
int N,
typename T>
1904 template <
typename T2>
1909 std::copy (src.
values.begin(), src.
values.end(), values.begin());
1914 template <
int N,
typename T>
1918 values (std::move(src.
values)),
1926 template <
int N,
typename T>
1927 template <
class Archive>
1934 ar &values &table_size;
1941 namespace TableBaseAccessors
1943 template <
int N,
typename T,
bool C,
unsigned int P>
1945 Accessor<N,T,C,P>::Accessor (
const TableType &table,
1946 const iterator data)
1954 template <
int N,
typename T,
bool C,
unsigned int P>
1956 Accessor<N,T,C,P>::Accessor (
const Accessor &a)
1964 template <
int N,
typename T,
bool C,
unsigned int P>
1967 Accessor<N,T,C,P>::operator [] (
const size_type i)
const 1969 Assert (i < table.size()[N-P],
1976 return Accessor<N,T,
C,P-1> (table, data);
1982 size_type subobject_size = table.size()[N-1];
1983 for (
int p=P-1; p>1; --p)
1984 subobject_size *= table.size()[N-p];
1985 const iterator new_data = data + i*subobject_size;
1986 return Accessor<N,T,
C,P-1> (table, new_data);
1992 template <
int N,
typename T,
bool C>
1994 Accessor<N,T,C,1>::Accessor (
const TableType &table,
1995 const iterator data)
2003 template <
int N,
typename T,
bool C>
2005 Accessor<N,T,C,1>::Accessor (
const Accessor &a)
2013 template <
int N,
typename T,
bool C>
2015 typename Accessor<N,T,C,1>::reference
2016 Accessor<N,T,C,1>::operator [] (
const size_type i)
const 2024 template <
int N,
typename T,
bool C>
2026 typename Accessor<N,T,C,1>::size_type
2027 Accessor<N,T,C,1>::size ()
const 2029 return table.size()[N-1];
2034 template <
int N,
typename T,
bool C>
2036 typename Accessor<N,T,C,1>::iterator
2037 Accessor<N,T,C,1>::begin ()
const 2044 template <
int N,
typename T,
bool C>
2046 typename Accessor<N,T,C,1>::iterator
2047 Accessor<N,T,C,1>::end ()
const 2049 return data+table.size()[N-1];
2056 template <
int N,
typename T>
2063 reinit (m.
size(),
true);
2070 template <
int N,
typename T>
2071 template <
typename T2>
2076 reinit (m.
size(),
true);
2078 std::copy (m.
values.begin(), m.
values.begin() + n_elements(),
2086 template <
int N,
typename T>
2092 values = std::move(m.
values);
2101 template <
int N,
typename T>
2106 return (values == T2.
values);
2111 template <
int N,
typename T>
2117 if (n_elements() != 0)
2123 template <
int N,
typename T>
2128 if (n_elements() != 0)
2135 template <
int N,
typename T>
2139 const bool omit_default_initialization)
2141 table_size = new_sizes;
2143 const size_type new_size = n_elements();
2164 if (!omit_default_initialization)
2167 values.resize(new_size);
2170 values.resize_fast(new_size);
2175 values.resize_fast (new_size);
2180 template <
int N,
typename T>
2190 template <
int N,
typename T>
2196 return table_size[i];
2201 template <
int N,
typename T>
2207 for (
unsigned int n=0; n<N; ++n)
2214 template <
int N,
typename T>
2219 return (n_elements() == 0);
2226 namespace TableImplementation
2228 template <
typename InputIterator,
typename T>
2229 void fill_Fortran_style (InputIterator entries,
2233 for (size_type i=0; i<table.
size()[0]; ++i)
2238 template <
typename InputIterator,
typename T>
2239 void fill_Fortran_style (InputIterator entries,
2243 for (size_type j=0; j<table.
size()[1]; ++j)
2244 for (size_type i=0; i<table.
size()[0]; ++i)
2249 template <
typename InputIterator,
typename T>
2250 void fill_Fortran_style (InputIterator entries,
2254 for (size_type k=0; k<table.
size()[2]; ++k)
2255 for (size_type j=0; j<table.
size()[1]; ++j)
2256 for (size_type i=0; i<table.
size()[0]; ++i)
2261 template <
typename InputIterator,
typename T,
int N>
2262 void fill_Fortran_style (InputIterator,
2271 template <
int N,
typename T>
2272 template <
typename InputIterator>
2276 const bool C_style_indexing)
2278 Assert (n_elements() != 0,
2279 ExcMessage(
"Trying to fill an empty matrix."));
2281 if (C_style_indexing)
2282 for (
typename AlignedVector<T>::iterator p = values.begin();
2283 p != values.end(); ++p)
2286 internal::TableImplementation::fill_Fortran_style (entries, *
this);
2291 template <
int N,
typename T>
2302 template <
int N,
typename T>
2312 template <
int N,
typename T>
2327 return size_type(indices[0])*table_size[1] + indices[1];
2329 return ((
size_type(indices[0])*table_size[1] + indices[1])*table_size[2]
2333 unsigned int s = indices[0];
2334 for (
unsigned int n=1; n<N; ++n)
2335 s = s*table_size[n] + indices[n];
2343 template <
int N,
typename T>
2345 typename AlignedVector<T>::const_reference
2348 for (
unsigned int n=0; n<N; ++n)
2355 template <
int N,
typename T>
2357 typename AlignedVector<T>::reference
2360 for (
unsigned int n=0; n<N; ++n)
2367 template <
int N,
typename T>
2369 typename AlignedVector<T>::const_reference
2372 return values[position(indices)];
2377 template <
int N,
typename T>
2379 typename AlignedVector<T>::reference
2383 return values[position(indices)];
2388 template <
typename T>
2397 template <
typename T>
2398 template <
typename InputIterator>
2401 InputIterator entries,
2402 const bool C_style_indexing)
2411 template <
typename T>
2413 typename AlignedVector<T>::const_reference
2422 template <
typename T>
2424 typename AlignedVector<T>::reference
2433 template <
typename T>
2435 typename AlignedVector<T>::const_reference
2444 template <
typename T>
2446 typename AlignedVector<T>::reference
2455 template <
typename T>
2457 typename AlignedVector<T>::const_reference
2465 template <
typename T>
2467 typename AlignedVector<T>::reference
2478 template <
typename T>
2481 const size_type size2)
2488 template <
typename T>
2489 template <
typename InputIterator>
2492 const size_type size2,
2493 InputIterator entries,
2494 const bool C_style_indexing)
2503 template <
typename T>
2507 const size_type size2,
2508 const bool omit_default_initialization)
2515 template <
typename T>
2517 ::internal::TableBaseAccessors::Accessor<2,T,true,1>
2521 return ::internal::TableBaseAccessors::Accessor<2,T,true,1>(*
this,
2527 template <
typename T>
2529 ::internal::TableBaseAccessors::Accessor<2,T,false,1>
2533 return ::internal::TableBaseAccessors::Accessor<2,T,false,1>(*
this,
2539 template <
typename T>
2541 typename AlignedVector<T>::const_reference
2543 const size_type j)
const 2552 template <
typename T>
2554 typename AlignedVector<T>::reference
2565 template <
typename T>
2567 typename AlignedVector<T>::const_reference
2575 template <
typename T>
2577 typename AlignedVector<T>::reference
2585 template <
typename T>
2587 typename AlignedVector<T>::const_reference
2589 const size_type j)
const 2596 template <
typename T>
2598 typename AlignedVector<T>::reference
2607 template <
typename T>
2617 template <
typename T>
2630 template <
typename T,
bool Constness>
2635 linear_index(
std::numeric_limits<decltype(linear_index)>::
max())
2640 template <
typename T,
bool Constness>
2642 AccessorBase<T, Constness>::AccessorBase(
const container_pointer_type table)
2645 linear_index(container->values.size())
2650 template <
typename T,
bool Constness>
2652 AccessorBase<T, Constness>::AccessorBase(
const AccessorBase<T, false> &a)
2654 container(a.container),
2655 linear_index(a.linear_index)
2660 template <
typename T,
bool Constness>
2662 AccessorBase<T, Constness>::AccessorBase(
const container_pointer_type table,
2663 const std::ptrdiff_t index)
2668 Assert(0 <= linear_index && linear_index < container->
values.size() + 1,
2669 ExcMessage(
"The current iterator points outside of the table and is " 2670 "not the end iterator."));
2675 template <
typename T,
bool Constness>
2678 AccessorBase<T, Constness>::value()
const 2680 Assert(0 <= linear_index && linear_index < container->values.size(),
2681 ExcMessage(
"The current iterator points outside of the table."));
2682 return this->container->values[linear_index];
2687 template <
typename T,
bool Constness>
2689 typename AccessorBase<T, Constness>::size_type
2690 AccessorBase<T, Constness>::AccessorBase::row()
const 2692 Assert(!container->empty(),
ExcMessage(
"An empty table has no rows or columns."));
2693 const auto row_n = linear_index % container->n_rows();
2694 Assert(0 <= row_n && row_n < container->n_rows(),
2695 ExcMessage(
"The current iterator points outside the table."));
2701 template <
typename T,
bool Constness>
2703 typename AccessorBase<T, Constness>::size_type
2704 AccessorBase<T, Constness>::AccessorBase::column()
const 2706 Assert(!container->empty(),
ExcMessage(
"An empty table has no rows or columns."));
2707 const auto column_n = linear_index/container->n_rows();
2708 Assert(0 <= column_n && column_n < container->n_cols(),
2709 ExcMessage(
"The current iterator points outside the table."));
2714 template <
typename T>
2716 const Accessor<T, false> &
2717 Accessor<T, false>::operator = (
const T &t)
const 2719 Assert(0 <= this->linear_index && this->linear_index < this->container->values.size(),
2720 ExcMessage(
"The current iterator points outside of the table."));
2721 this->container->values[this->linear_index] = t;
2727 template <
typename T>
2729 const Accessor<T, false> &
2730 Accessor<T, false>::operator = (T &&t)
const 2732 Assert(0 <= this->linear_index && this->linear_index < this->container->values.size(),
2733 ExcMessage(
"The current iterator points outside of the table."));
2734 this->container->values[this->linear_index] = t;
2740 template <
typename T>
2743 Accessor<T, false>::value()
const 2745 Assert(0 <= this->linear_index && this->linear_index < this->container->values.size(),
2746 ExcMessage(
"The current iterator points outside of the table."));
2747 return this->container->values[this->linear_index];
2752 template <
typename T,
bool Constness>
2753 Iterator<T, Constness>::Iterator(
const Accessor<T, Constness> &a)
2760 template <
typename T,
bool Constness>
2761 Iterator<T, Constness>::Iterator(
const container_pointer_type table)
2763 LinearIndexIterator<Iterator<T, Constness>, Accessor<T, Constness>>(Accessor<T, Constness>(table))
2768 template <
typename T,
bool Constness>
2769 Iterator<T, Constness>::Iterator(
const Iterator<T, false> &i)
2777 template <
typename T,
bool Constness>
2778 Iterator<T, Constness>::Iterator(
const container_pointer_type table,
2779 const size_type row_n,
2780 const size_type col_n)
2782 Iterator(table, table->n_rows()*col_n + row_n)
2787 template <
typename T,
bool Constness>
2788 Iterator<T, Constness>::Iterator
2789 (
const container_pointer_type table,
2790 const std::ptrdiff_t linear_index)
2793 (Accessor<T, Constness>(table, linear_index))
2800 template <
typename T>
2803 const size_type size2)
2810 template <
typename T>
2814 const size_type size2,
2815 const bool omit_default_initialization)
2822 template <
typename T>
2826 const size_type j)
const 2830 return this->values[
size_type(j)*this->table_size[1]+i];
2835 template <
typename T>
2843 return this->values[
size_type(j)*this->table_size[1]+i];
2848 template <
typename T>
2852 const size_type j)
const 2854 return this->values[
size_type(j)*this->table_size[1]+i];
2859 template <
typename T>
2865 return this->values[
size_type(j)*this->table_size[1]+i];
2870 template <
typename T>
2875 return this->table_size[1];
2880 template <
typename T>
2885 return this->table_size[0];
2890 template <
typename T>
2900 template <
typename T>
2910 template <
typename T>
2920 template <
typename T>
2931 template <
typename T>
2934 const size_type size2,
2935 const size_type size3)
2942 template <
typename T>
2943 template <
typename InputIterator>
2946 const size_type size2,
2947 const size_type size3,
2948 InputIterator entries,
2949 const bool C_style_indexing)
2958 template <
typename T>
2960 ::internal::TableBaseAccessors::Accessor<3,T,true,2>
2966 return (::internal::TableBaseAccessors::Accessor<3,T,true,2>
2968 this->
values.begin() + i*subobject_size));
2973 template <
typename T>
2975 ::internal::TableBaseAccessors::Accessor<3,T,false,2>
2981 return (::internal::TableBaseAccessors::Accessor<3,T,false,2>
2983 this->
values.begin() + i*subobject_size));
2988 template <
typename T>
2990 typename AlignedVector<T>::const_reference
2993 const size_type k)
const 3004 template <
typename T>
3006 typename AlignedVector<T>::reference
3020 template <
typename T>
3022 typename AlignedVector<T>::const_reference
3030 template <
typename T>
3032 typename AlignedVector<T>::reference
3040 template <
typename T>
3043 const size_type size2,
3044 const size_type size3,
3045 const size_type size4)
3052 template <
typename T>
3054 ::internal::TableBaseAccessors::Accessor<4,T,true,3>
3061 return (::internal::TableBaseAccessors::Accessor<4,T,true,3>
3063 this->
values.begin() + i*subobject_size));
3068 template <
typename T>
3070 ::internal::TableBaseAccessors::Accessor<4,T,false,3>
3075 this->table_size[2] *
3076 this->table_size[3];
3077 return (::internal::TableBaseAccessors::Accessor<4,T,false,3>
3079 this->
values.begin() + i*subobject_size));
3084 template <
typename T>
3086 typename AlignedVector<T>::const_reference
3090 const size_type l)
const 3097 *this->table_size[2] + k)
3098 *this->table_size[3] +
l];
3103 template <
typename T>
3105 typename AlignedVector<T>::reference
3116 *this->table_size[2] + k)
3117 *this->table_size[3] +
l];
3122 template <
typename T>
3124 typename AlignedVector<T>::const_reference
3132 template <
typename T>
3134 typename AlignedVector<T>::reference
3142 template <
typename T>
3145 const size_type size2,
3146 const size_type size3,
3147 const size_type size4,
3148 const size_type size5)
3155 template <
typename T>
3157 ::internal::TableBaseAccessors::Accessor<5,T,true,4>
3162 this->table_size[2] *
3163 this->table_size[3] *
3164 this->table_size[4];
3165 return (::internal::TableBaseAccessors::Accessor<5,T,true,4>
3167 this->
values.begin() + i*subobject_size));
3172 template <
typename T>
3174 ::internal::TableBaseAccessors::Accessor<5,T,false,4>
3179 this->table_size[2] *
3180 this->table_size[3] *
3181 this->table_size[4];
3182 return (::internal::TableBaseAccessors::Accessor<5,T,false,4>
3184 this->
values.begin() + i*subobject_size));
3189 template <
typename T>
3191 typename AlignedVector<T>::const_reference
3196 const size_type m)
const 3204 *this->table_size[2] + k)
3205 *this->table_size[3] +
l)
3206 *this->table_size[4] + m];
3211 template <
typename T>
3213 typename AlignedVector<T>::reference
3226 *this->table_size[2] + k)
3227 *this->table_size[3] +
l)
3228 *this->table_size[4] + m];
3233 template <
typename T>
3235 typename AlignedVector<T>::const_reference
3243 template <
typename T>
3245 typename AlignedVector<T>::reference
3253 template <
typename T>
3256 const size_type size2,
3257 const size_type size3,
3258 const size_type size4,
3259 const size_type size5,
3260 const size_type size6)
3265 table_indices[0] = size1;
3266 table_indices[1] = size2;
3267 table_indices[2] = size3;
3268 table_indices[3] = size4;
3269 table_indices[4] = size5;
3270 table_indices[5] = size6;
3277 template <
typename T>
3279 ::internal::TableBaseAccessors::Accessor<6,T,true,5>
3284 this->table_size[2] *
3285 this->table_size[3] *
3286 this->table_size[4] *
3287 this->table_size[5];
3288 return (::internal::TableBaseAccessors::Accessor<6,T,true,5>
3290 this->
values.begin() + i*subobject_size));
3295 template <
typename T>
3297 ::internal::TableBaseAccessors::Accessor<6,T,false,5>
3302 this->table_size[2] *
3303 this->table_size[3] *
3304 this->table_size[4] *
3305 this->table_size[5];
3306 return (::internal::TableBaseAccessors::Accessor<6,T,false,5>
3308 this->
values.begin() + i*subobject_size));
3313 template <
typename T>
3315 typename AlignedVector<T>::const_reference
3321 const size_type n)
const 3330 *this->table_size[2] + k)
3331 *this->table_size[3] +
l)
3332 *this->table_size[4] + m)
3333 *this->table_size[5] + n];
3338 template <
typename T>
3340 typename AlignedVector<T>::reference
3355 *this->table_size[2] + k)
3356 *this->table_size[3] +
l)
3357 *this->table_size[4] + m)
3358 *this->table_size[5] + n];
3363 template <
typename T>
3365 typename AlignedVector<T>::const_reference
3373 template <
typename T>
3375 typename AlignedVector<T>::reference
3383 template <
typename T>
3386 const size_type size2,
3387 const size_type size3,
3388 const size_type size4,
3389 const size_type size5,
3390 const size_type size6,
3391 const size_type size7)
3396 table_indices[0] = size1;
3397 table_indices[1] = size2;
3398 table_indices[2] = size3;
3399 table_indices[3] = size4;
3400 table_indices[4] = size5;
3401 table_indices[5] = size6;
3402 table_indices[6] = size7;
3409 template <
typename T>
3411 ::internal::TableBaseAccessors::Accessor<7,T,true,6>
3416 this->table_size[2] *
3417 this->table_size[3] *
3418 this->table_size[4] *
3419 this->table_size[5] *
3420 this->table_size[6];
3421 return (::internal::TableBaseAccessors::Accessor<7,T,true,6>
3423 this->
values.begin() + i*subobject_size));
3428 template <
typename T>
3430 ::internal::TableBaseAccessors::Accessor<7,T,false,6>
3435 this->table_size[2] *
3436 this->table_size[3] *
3437 this->table_size[4] *
3438 this->table_size[5] *
3439 this->table_size[6];
3440 return (::internal::TableBaseAccessors::Accessor<7,T,false,6>
3442 this->
values.begin() + i*subobject_size));
3447 template <
typename T>
3449 typename AlignedVector<T>::const_reference
3456 const size_type o)
const 3466 *this->table_size[2] + k)
3467 *this->table_size[3] +
l)
3468 *this->table_size[4] + m)
3469 *this->table_size[5] + n)
3470 *this->table_size[6] + o];
3475 template <
typename T>
3477 typename AlignedVector<T>::reference
3494 *this->table_size[2] + k)
3495 *this->table_size[3] +
l)
3496 *this->table_size[4] + m)
3497 *this->table_size[5] + n)
3498 *this->table_size[6] + o];
3503 template <
typename T>
3505 typename AlignedVector<T>::const_reference
3513 template <
typename T>
3515 typename AlignedVector<T>::reference
3533 template <
int N,
typename T>
3540 DEAL_II_NAMESPACE_CLOSE
bool operator==(const TableBase< N, T > &T2) const
types::global_dof_index size_type
AlignedVector< T >::value_type value_type
TransposeTableIterators::Iterator< T, false > iterator
TableBase< 6, T >::size_type size_type
size_type position(const TableIndices< N > &indices) const
void serialize(Archive &ar, const unsigned int version)
void swap(TableBase< N, T > &v)
AlignedVector< T >::reference reference
TransposeTableIterators::Iterator< T, true > const_iterator
const TableIndices< N > & size() const
#define AssertIndexRange(index, range)
Accessor< T, Constness > accessor
std::conditional< Constness, const TransposeTable< T > *, TransposeTable< T > * >::type container_pointer_type
TableBase< N, T > & operator=(const TableBase< N, T > &src)
TableBase< 7, T >::size_type size_type
Iterator(const Accessor< T, Constness > &accessor)
TableBase< 4, T >::size_type size_type
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
size_type n_elements() const
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
std::conditional< Constness, const TransposeTable< T > *, TransposeTable< T > * >::type container_pointer_type
TransposeTable< T >::size_type size_type
TableBase< 2, T >::size_type size_type
container_pointer_type container
static ::ExceptionBase & ExcMessage(std::string arg1)
TableBase< 5, T >::size_type size_type
TableBase< 2, T >::size_type size_type
void swap(BlockIndices &u, BlockIndices &v)
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
#define Assert(cond, exc)
void reinit(const size_type size1, const size_type size2, const bool omit_default_initialization=false)
AlignedVector< T >::reference el(const TableIndices< N > &indices)
AlignedVector< T >::const_reference const_reference
void swap(Vector< Number > &u, Vector< Number > &v)
TransposeTable< T >::size_type size_type
size_type size(const unsigned int i) const
std::size_t memory_consumption() const
std::ptrdiff_t linear_index
TableBase< 3, T >::size_type size_type
reference el(const size_type i, const size_type j)
static ::ExceptionBase & ExcNotImplemented()
TableIndices< N > table_size
#define DeclException3(Exception3, type1, type2, type3, outsequence)
AlignedVector< T >::size_type size_type
const_reference operator()(const size_type i, const size_type j) const
TableBase< 1, T >::size_type size_type
AlignedVector< T >::reference operator()(const TableIndices< N > &indices)
AlignedVector< T > values
void fill(InputIterator entries, const bool C_style_indexing=true)
T max(const T &t, const MPI_Comm &mpi_communicator)
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)