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> 29 DEAL_II_NAMESPACE_OPEN
33 template <
int N,
typename T>
class Table;
34 template <
typename T>
class Table<1,T>;
35 template <
typename T>
class Table<2,T>;
36 template <
typename T>
class Table<3,T>;
37 template <
typename T>
class Table<4,T>;
38 template <
typename T>
class Table<5,T>;
39 template <
typename T>
class Table<6,T>;
62 namespace TableBaseAccessors
71 template <
int N,
typename T,
bool Constness>
80 template <
int N,
typename T>
struct Types<N,T,true>
82 typedef const T value_type;
85 typedef typename AlignedVector<T>::const_iterator iterator;
86 typedef typename AlignedVector<T>::const_iterator const_iterator;
88 typedef typename AlignedVector<T>::const_reference reference;
89 typedef typename AlignedVector<T>::const_reference const_reference;
97 template <
int N,
typename T>
struct Types<N,T,false>
102 typedef typename AlignedVector<T>::iterator iterator;
103 typedef typename AlignedVector<T>::const_iterator const_iterator;
105 typedef typename AlignedVector<T>::reference reference;
106 typedef typename AlignedVector<T>::const_reference const_reference;
148 template <
int N,
typename T,
bool C,
unsigned int P>
152 typedef typename Types<N,T,C>::TableType TableType;
154 typedef typename Types<N,T,C>::iterator iterator;
155 typedef typename Types<N,T,C>::const_iterator const_iterator;
158 typedef ptrdiff_t difference_type;
165 Accessor (
const TableType &table,
166 const iterator data);
182 Accessor (
const Accessor &a);
187 Accessor<N,T,C,P-1> operator [] (
const unsigned int i)
const;
194 <<
"Index " << N-P+1 <<
"has a value of " 195 << arg1 <<
" but needs to be in the range [" 196 << arg2 <<
"," << arg3 <<
"[.");
203 const TableType &table;
210 template <
int N1,
typename T1>
friend class ::Table;
211 template <
int N1,
typename T1,
bool C1,
unsigned int P1>
212 friend class Accessor;
213 # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG 214 friend class ::Table<N,T>;
215 friend class Accessor<N,T,C,P+1>;
230 template <
int N,
typename T,
bool C>
231 class Accessor<N,T,C,1>
239 typedef typename Types<N,T,C>::value_type value_type;
241 typedef typename Types<N,T,C>::iterator iterator;
242 typedef typename Types<N,T,C>::const_iterator const_iterator;
244 typedef typename Types<N,T,C>::reference reference;
245 typedef typename Types<N,T,C>::const_reference const_reference;
248 typedef ptrdiff_t difference_type;
253 typedef typename Types<N,T,C>::TableType TableType;
268 Accessor (
const TableType &table,
269 const iterator data);
284 Accessor (
const Accessor &a);
290 reference operator [] (
const unsigned int)
const;
296 unsigned int size ()
const;
301 iterator begin ()
const;
306 iterator end ()
const;
314 const TableType &table;
321 template <
int N1,
typename T1>
friend class ::Table;
322 template <
int N1,
typename T1,
bool C1,
unsigned int P1>
323 friend class Accessor;
324 # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG 325 friend class ::Table<2,T>;
326 friend class Accessor<N,T,C,2>;
402 template <
int N,
typename T>
406 typedef T value_type;
430 template <
typename InputIterator>
432 InputIterator entries,
433 const bool C_style_indexing =
true);
444 template <
typename T2>
469 template<
typename T2>
481 void reset_values ();
492 const bool omit_default_initialization =
false);
497 unsigned int size (
const unsigned int i)
const;
508 size_type n_elements ()
const;
552 template <
typename InputIterator>
553 void fill (InputIterator entries,
554 const bool C_style_indexing =
true);
559 void fill (
const T &value);
564 typename AlignedVector<T>::reference
574 typename AlignedVector<T>::const_reference
594 std::size_t memory_consumption ()
const;
600 template <
class Archive>
601 void serialize (Archive &ar,
const unsigned int version);
616 typename AlignedVector<T>::reference el (
const TableIndices<N> &indices);
628 typename AlignedVector<T>::const_reference el (
const TableIndices<N> &indices)
const;
661 template <
int N,
typename T>
679 template <
typename T>
696 Table (
const unsigned int size);
735 template <
typename InputIterator>
736 Table (
const unsigned int size,
737 InputIterator entries,
738 const bool C_style_indexing =
true);
744 typename AlignedVector<T>::const_reference
745 operator [] (
const unsigned int i)
const;
751 typename AlignedVector<T>::reference
752 operator [] (
const unsigned int i);
758 typename AlignedVector<T>::const_reference
759 operator () (
const unsigned int i)
const;
765 typename AlignedVector<T>::reference
766 operator () (
const unsigned int i);
772 typename AlignedVector<T>::reference
779 typename AlignedVector<T>::const_reference
798 template <
typename T>
815 Table (
const unsigned int size1,
816 const unsigned int size2);
856 template <
typename InputIterator>
857 Table (
const unsigned int size1,
858 const unsigned int size2,
859 InputIterator entries,
860 const bool C_style_indexing =
true);
867 void reinit (
const unsigned int size1,
868 const unsigned int size2,
869 const bool omit_default_initialization =
false);
879 ::internal::TableBaseAccessors::Accessor<2,T,true,1>
880 operator [] (
const unsigned int i)
const;
888 ::internal::TableBaseAccessors::Accessor<2,T,false,1>
889 operator [] (
const unsigned int i);
897 typename AlignedVector<T>::const_reference
898 operator () (
const unsigned int i,
899 const unsigned int j)
const;
908 typename AlignedVector<T>::reference
909 operator () (
const unsigned int i,
910 const unsigned int j);
916 typename AlignedVector<T>::reference
923 typename AlignedVector<T>::const_reference
931 unsigned int n_rows ()
const;
937 unsigned int n_cols ()
const;
950 typename AlignedVector<T>::reference el (
const unsigned int i,
951 const unsigned int j);
967 typename AlignedVector<T>::const_reference el (
const unsigned int i,
968 const unsigned int j)
const;
983 template <
typename T>
1000 Table (
const unsigned int size1,
1001 const unsigned int size2,
1002 const unsigned int size3);
1044 template <
typename InputIterator>
1045 Table (
const unsigned int size1,
1046 const unsigned int size2,
1047 const unsigned int size3,
1048 InputIterator entries,
1049 const bool C_style_indexing =
true);
1058 ::internal::TableBaseAccessors::Accessor<3,T,true,2>
1059 operator [] (
const unsigned int i)
const;
1068 ::internal::TableBaseAccessors::Accessor<3,T,false,2>
1069 operator [] (
const unsigned int i);
1077 typename AlignedVector<T>::const_reference operator () (
const unsigned int i,
1078 const unsigned int j,
1079 const unsigned int k)
const;
1088 typename AlignedVector<T>::reference operator () (
const unsigned int i,
1089 const unsigned int j,
1090 const unsigned int k);
1096 typename AlignedVector<T>::reference operator () (
const TableIndices<3> &indices);
1102 typename AlignedVector<T>::const_reference operator () (
const TableIndices<3> &indices)
const;
1117 template <
typename T>
1134 Table (
const unsigned int size1,
1135 const unsigned int size2,
1136 const unsigned int size3,
1137 const unsigned int size4);
1146 ::internal::TableBaseAccessors::Accessor<4,T,true,3>
1147 operator [] (
const unsigned int i)
const;
1156 ::internal::TableBaseAccessors::Accessor<4,T,false,3>
1157 operator [] (
const unsigned int i);
1165 typename AlignedVector<T>::const_reference operator () (
const unsigned int i,
1166 const unsigned int j,
1167 const unsigned int k,
1168 const unsigned int l)
const;
1177 typename AlignedVector<T>::reference operator () (
const unsigned int i,
1178 const unsigned int j,
1179 const unsigned int k,
1180 const unsigned int l);
1186 typename AlignedVector<T>::reference
1193 typename AlignedVector<T>::const_reference
1209 template <
typename T>
1227 Table (
const unsigned int size1,
1228 const unsigned int size2,
1229 const unsigned int size3,
1230 const unsigned int size4,
1231 const unsigned int size5);
1240 ::internal::TableBaseAccessors::Accessor<5,T,true,4>
1241 operator [] (
const unsigned int i)
const;
1250 ::internal::TableBaseAccessors::Accessor<5,T,false,4>
1251 operator [] (
const unsigned int i);
1259 typename AlignedVector<T>::const_reference operator () (
const unsigned int i,
1260 const unsigned int j,
1261 const unsigned int k,
1262 const unsigned int l,
1263 const unsigned int m)
const;
1271 typename AlignedVector<T>::reference operator () (
const unsigned int i,
1272 const unsigned int j,
1273 const unsigned int k,
1274 const unsigned int l,
1275 const unsigned int m);
1281 typename AlignedVector<T>::reference
1288 typename AlignedVector<T>::const_reference
1304 template <
typename T>
1321 Table (
const unsigned int size1,
1322 const unsigned int size2,
1323 const unsigned int size3,
1324 const unsigned int size4,
1325 const unsigned int size5,
1326 const unsigned int size6);
1335 ::internal::TableBaseAccessors::Accessor<6,T,true,5>
1336 operator [] (
const unsigned int i)
const;
1345 ::internal::TableBaseAccessors::Accessor<6,T,false,5>
1346 operator [] (
const unsigned int i);
1354 typename AlignedVector<T>::const_reference operator () (
const unsigned int i,
1355 const unsigned int j,
1356 const unsigned int k,
1357 const unsigned int l,
1358 const unsigned int m,
1359 const unsigned int n)
const;
1367 typename AlignedVector<T>::reference operator () (
const unsigned int i,
1368 const unsigned int j,
1369 const unsigned int k,
1370 const unsigned int l,
1371 const unsigned int m,
1372 const unsigned int n);
1378 typename AlignedVector<T>::reference
1385 typename AlignedVector<T>::const_reference
1400 template <
typename T>
1417 Table (
const unsigned int size1,
1418 const unsigned int size2,
1419 const unsigned int size3,
1420 const unsigned int size4,
1421 const unsigned int size5,
1422 const unsigned int size6,
1423 const unsigned int size7);
1432 ::internal::TableBaseAccessors::Accessor<7,T,true,6>
1433 operator [] (
const unsigned int i)
const;
1442 ::internal::TableBaseAccessors::Accessor<7,T,false,6>
1443 operator [] (
const unsigned int i);
1451 typename AlignedVector<T>::const_reference operator () (
const unsigned int i,
1452 const unsigned int j,
1453 const unsigned int k,
1454 const unsigned int l,
1455 const unsigned int m,
1456 const unsigned int n,
1457 const unsigned int o)
const;
1465 typename AlignedVector<T>::reference operator () (
const unsigned int i,
1466 const unsigned int j,
1467 const unsigned int k,
1468 const unsigned int l,
1469 const unsigned int m,
1470 const unsigned int n,
1471 const unsigned int o);
1477 typename AlignedVector<T>::reference
1484 typename AlignedVector<T>::const_reference
1503 template <
typename T>
1521 const unsigned int size2);
1528 void reinit (
const unsigned int size1,
1529 const unsigned int size2,
1530 const bool omit_default_initialization =
false);
1538 typename AlignedVector<T>::const_reference operator () (
const unsigned int i,
1539 const unsigned int j)
const;
1547 typename AlignedVector<T>::reference operator () (
const unsigned int i,
1548 const unsigned int j);
1554 unsigned int n_rows ()
const;
1560 unsigned int n_cols ()
const;
1573 typename AlignedVector<T>::reference el (
const unsigned int i,
1574 const unsigned int j);
1590 typename AlignedVector<T>::const_reference el (
const unsigned int i,
1591 const unsigned int j)
const;
1601 template <
int N,
typename T>
1607 template <
int N,
typename T>
1615 template <
int N,
typename T>
1616 template <
typename InputIterator>
1619 InputIterator entries,
1620 const bool C_style_indexing)
1623 fill (entries, C_style_indexing);
1629 template <
int N,
typename T>
1640 template <
int N,
typename T>
1641 template <
typename T2>
1651 template <
int N,
typename T>
1652 template <
class Archive>
1666 namespace TableBaseAccessors
1668 template <
int N,
typename T,
bool C,
unsigned int P>
1670 Accessor<N,T,C,P>::Accessor (
const TableType &table,
1671 const iterator data)
1679 template <
int N,
typename T,
bool C,
unsigned int P>
1681 Accessor<N,T,C,P>::Accessor (
const Accessor &a)
1689 template <
int N,
typename T,
bool C,
unsigned int P>
1691 Accessor<N,T,C,P>::Accessor ()
1693 table (*static_cast<const TableType *>(0)),
1699 Assert (
false, ExcInternalError());
1704 template <
int N,
typename T,
bool C,
unsigned int P>
1707 Accessor<N,T,C,P>::operator [] (
const unsigned int i)
const 1709 Assert (i < table.size()[N-P],
1710 ExcIndexRange (i, 0, table.size()[N-P]));
1716 return Accessor<N,T,C,P-1> (table, data);
1722 size_type subobject_size = table.size()[N-1];
1723 for (
int p=P-1; p>1; --p)
1724 subobject_size *= table.size()[N-p];
1725 const iterator new_data = data + i*subobject_size;
1726 return Accessor<N,T,C,P-1> (table, new_data);
1732 template <
int N,
typename T,
bool C>
1734 Accessor<N,T,C,1>::Accessor (
const TableType &table,
1735 const iterator data)
1743 template <
int N,
typename T,
bool C>
1745 Accessor<N,T,C,1>::Accessor ()
1747 table (*static_cast<const TableType *>(0)),
1753 Assert (
false, ExcInternalError());
1758 template <
int N,
typename T,
bool C>
1760 Accessor<N,T,C,1>::Accessor (
const Accessor &a)
1768 template <
int N,
typename T,
bool C>
1770 typename Accessor<N,T,C,1>::reference
1771 Accessor<N,T,C,1>::operator [] (
const unsigned int i)
const 1773 Assert (i < table.size()[N-1],
1774 ExcIndexRange (i, 0, table.size()[N-1]));
1780 template <
int N,
typename T,
bool C>
1783 Accessor<N,T,C,1>::size ()
const 1785 return table.size()[N-1];
1790 template <
int N,
typename T,
bool C>
1792 typename Accessor<N,T,C,1>::iterator
1793 Accessor<N,T,C,1>::begin ()
const 1800 template <
int N,
typename T,
bool C>
1802 typename Accessor<N,T,C,1>::iterator
1803 Accessor<N,T,C,1>::end ()
const 1805 return data+table.size()[N-1];
1812 template <
int N,
typename T>
1819 template <
int N,
typename T>
1833 template <
int N,
typename T>
1834 template <
typename T2>
1848 template <
int N,
typename T>
1858 template <
int N,
typename T>
1870 template <
int N,
typename T>
1882 template <
int N,
typename T>
1886 const bool omit_default_initialization)
1911 if (!omit_default_initialization)
1914 values.resize(new_size, T());
1917 values.resize_fast(new_size);
1922 values.resize_fast (new_size);
1927 template <
int N,
typename T>
1937 template <
int N,
typename T>
1942 Assert (i<N, ExcIndexRange(i,0,N));
1948 template <
int N,
typename T>
1954 for (
unsigned int n=0; n<N; ++n)
1961 template <
int N,
typename T>
1975 template <
typename InputIterator,
typename T>
1976 void fill_Fortran_style (InputIterator entries,
1979 for (
unsigned int i=0; i<table.
size()[0]; ++i)
1984 template <
typename InputIterator,
typename T>
1985 void fill_Fortran_style (InputIterator entries,
1988 for (
unsigned int j=0; j<table.
size()[1]; ++j)
1989 for (
unsigned int i=0; i<table.
size()[0]; ++i)
1994 template <
typename InputIterator,
typename T>
1995 void fill_Fortran_style (InputIterator entries,
1998 for (
unsigned int k=0; k<table.
size()[2]; ++k)
1999 for (
unsigned int j=0; j<table.
size()[1]; ++j)
2000 for (
unsigned int i=0; i<table.
size()[0]; ++i)
2005 template <
typename InputIterator,
typename T,
int N>
2006 void fill_Fortran_style (InputIterator,
2009 Assert (
false, ExcNotImplemented());
2015 template <
int N,
typename T>
2016 template <
typename InputIterator>
2020 const bool C_style_indexing)
2023 ExcMessage(
"Trying to fill an empty matrix."));
2025 if (C_style_indexing)
2026 for (
typename AlignedVector<T>::iterator p =
values.begin();
2030 internal::Table::fill_Fortran_style (entries, *
this);
2035 template <
int N,
typename T>
2046 template <
int N,
typename T>
2056 template <
int N,
typename T>
2078 for (
unsigned int n=1; n<N; ++n)
2087 template <
int N,
typename T>
2089 typename AlignedVector<T>::const_reference
2092 for (
unsigned int n=0; n<N; ++n)
2094 ExcIndexRange (indices[n], 0,
table_size[n]));
2100 template <
int N,
typename T>
2102 typename AlignedVector<T>::reference
2105 for (
unsigned int n=0; n<N; ++n)
2107 ExcIndexRange (indices[n], 0,
table_size[n]));
2113 template <
int N,
typename T>
2115 typename AlignedVector<T>::const_reference
2123 template <
int N,
typename T>
2125 typename AlignedVector<T>::reference
2135 template <
typename T>
2142 template <
typename T>
2151 template <
typename T>
2152 template <
typename InputIterator>
2155 InputIterator entries,
2156 const bool C_style_indexing)
2165 template <
typename T>
2167 typename AlignedVector<T>::const_reference
2171 ExcIndexRange (i, 0, this->table_size[0]));
2177 template <
typename T>
2179 typename AlignedVector<T>::reference
2183 ExcIndexRange (i, 0, this->table_size[0]));
2189 template <
typename T>
2191 typename AlignedVector<T>::const_reference
2195 ExcIndexRange (i, 0, this->table_size[0]));
2201 template <
typename T>
2203 typename AlignedVector<T>::reference
2207 ExcIndexRange (i, 0, this->table_size[0]));
2213 template <
typename T>
2215 typename AlignedVector<T>::const_reference
2223 template <
typename T>
2225 typename AlignedVector<T>::reference
2234 template <
typename T>
2241 template <
typename T>
2244 const unsigned int size2)
2251 template <
typename T>
2252 template <
typename InputIterator>
2255 const unsigned int size2,
2256 InputIterator entries,
2257 const bool C_style_indexing)
2266 template <
typename T>
2270 const unsigned int size2,
2271 const bool omit_default_initialization)
2278 template <
typename T>
2280 ::internal::TableBaseAccessors::Accessor<2,T,true,1>
2284 ExcIndexRange (i, 0, this->table_size[0]));
2285 return ::internal::TableBaseAccessors::Accessor<2,T,true,1>(*
this,
2291 template <
typename T>
2293 ::internal::TableBaseAccessors::Accessor<2,T,false,1>
2296 Assert (i < this->table_size[0],
2297 ExcIndexRange (i, 0, this->table_size[0]));
2298 return ::internal::TableBaseAccessors::Accessor<2,T,false,1>(*
this,
2304 template <
typename T>
2306 typename AlignedVector<T>::const_reference
2308 const unsigned int j)
const 2310 Assert (i < this->table_size[0],
2311 ExcIndexRange (i, 0, this->table_size[0]));
2312 Assert (j < this->table_size[1],
2313 ExcIndexRange (j, 0, this->table_size[1]));
2319 template <
typename T>
2321 typename AlignedVector<T>::reference
2323 const unsigned int j)
2325 Assert (i < this->table_size[0],
2326 ExcIndexRange (i, 0, this->table_size[0]));
2327 Assert (j < this->table_size[1],
2328 ExcIndexRange (j, 0, this->table_size[1]));
2334 template <
typename T>
2336 typename AlignedVector<T>::const_reference
2344 template <
typename T>
2346 typename AlignedVector<T>::reference
2354 template <
typename T>
2356 typename AlignedVector<T>::const_reference
2358 const unsigned int j)
const 2365 template <
typename T>
2367 typename AlignedVector<T>::reference
2369 const unsigned int j)
2376 template <
typename T>
2381 return this->table_size[0];
2386 template <
typename T>
2391 return this->table_size[1];
2398 template <
typename T>
2405 template <
typename T>
2408 const unsigned int size2)
2415 template <
typename T>
2419 const unsigned int size2,
2420 const bool omit_default_initialization)
2427 template <
typename T>
2429 typename AlignedVector<T>::const_reference
2431 const unsigned int j)
const 2433 Assert (i < this->table_size[1],
2434 ExcIndexRange (i, 0, this->table_size[1]));
2435 Assert (j < this->table_size[0],
2436 ExcIndexRange (j, 0, this->table_size[0]));
2442 template <
typename T>
2444 typename AlignedVector<T>::reference
2446 const unsigned int j)
2448 Assert (i < this->table_size[1],
2449 ExcIndexRange (i, 0, this->table_size[1]));
2450 Assert (j < this->table_size[0],
2451 ExcIndexRange (j, 0, this->table_size[0]));
2457 template <
typename T>
2459 typename AlignedVector<T>::const_reference
2461 const unsigned int j)
const 2468 template <
typename T>
2470 typename AlignedVector<T>::reference
2472 const unsigned int j)
2479 template <
typename T>
2484 return this->table_size[1];
2489 template <
typename T>
2494 return this->table_size[0];
2502 template <
typename T>
2509 template <
typename T>
2512 const unsigned int size2,
2513 const unsigned int size3)
2520 template <
typename T>
2521 template <
typename InputIterator>
2524 const unsigned int size2,
2525 const unsigned int size3,
2526 InputIterator entries,
2527 const bool C_style_indexing)
2536 template <
typename T>
2538 ::internal::TableBaseAccessors::Accessor<3,T,true,2>
2541 Assert (i < this->table_size[0],
2542 ExcIndexRange (i, 0, this->table_size[0]));
2544 this->table_size[2];
2545 return (::internal::TableBaseAccessors::Accessor<3,T,true,2>
2547 this->
values.begin() + i*subobject_size));
2552 template <
typename T>
2554 ::internal::TableBaseAccessors::Accessor<3,T,false,2>
2557 Assert (i < this->table_size[0],
2558 ExcIndexRange (i, 0, this->table_size[0]));
2560 this->table_size[2];
2561 return (::internal::TableBaseAccessors::Accessor<3,T,false,2>
2563 this->
values.begin() + i*subobject_size));
2568 template <
typename T>
2570 typename AlignedVector<T>::const_reference
2572 const unsigned int j,
2573 const unsigned int k)
const 2575 Assert (i < this->table_size[0],
2576 ExcIndexRange (i, 0, this->table_size[0]));
2577 Assert (j < this->table_size[1],
2578 ExcIndexRange (j, 0, this->table_size[1]));
2579 Assert (k < this->table_size[2],
2580 ExcIndexRange (k, 0, this->table_size[2]));
2582 *this->table_size[2] + k];
2587 template <
typename T>
2589 typename AlignedVector<T>::reference
2591 const unsigned int j,
2592 const unsigned int k)
2594 Assert (i < this->table_size[0],
2595 ExcIndexRange (i, 0, this->table_size[0]));
2596 Assert (j < this->table_size[1],
2597 ExcIndexRange (j, 0, this->table_size[1]));
2598 Assert (k < this->table_size[2],
2599 ExcIndexRange (k, 0, this->table_size[2]));
2601 *this->table_size[2] + k];
2606 template <
typename T>
2608 typename AlignedVector<T>::const_reference
2616 template <
typename T>
2618 typename AlignedVector<T>::reference
2626 template <
typename T>
2633 template <
typename T>
2636 const unsigned int size2,
2637 const unsigned int size3,
2638 const unsigned int size4)
2645 template <
typename T>
2647 ::internal::TableBaseAccessors::Accessor<4,T,true,3>
2650 Assert (i < this->table_size[0],
2651 ExcIndexRange (i, 0, this->table_size[0]));
2653 this->table_size[2] *
2654 this->table_size[3];
2655 return (::internal::TableBaseAccessors::Accessor<4,T,true,3>
2657 this->
values.begin() + i*subobject_size));
2662 template <
typename T>
2664 ::internal::TableBaseAccessors::Accessor<4,T,false,3>
2667 Assert (i < this->table_size[0],
2668 ExcIndexRange (i, 0, this->table_size[0]));
2670 this->table_size[2] *
2671 this->table_size[3];
2672 return (::internal::TableBaseAccessors::Accessor<4,T,false,3>
2674 this->
values.begin() + i*subobject_size));
2679 template <
typename T>
2681 typename AlignedVector<T>::const_reference
2683 const unsigned int j,
2684 const unsigned int k,
2685 const unsigned int l)
const 2687 Assert (i < this->table_size[0],
2688 ExcIndexRange (i, 0, this->table_size[0]));
2689 Assert (j < this->table_size[1],
2690 ExcIndexRange (j, 0, this->table_size[1]));
2691 Assert (k < this->table_size[2],
2692 ExcIndexRange (k, 0, this->table_size[2]));
2693 Assert (l < this->table_size[3],
2694 ExcIndexRange (l, 0, this->table_size[3]));
2696 *this->table_size[2] + k)
2697 *this->table_size[3] + l];
2702 template <
typename T>
2704 typename AlignedVector<T>::reference
2706 const unsigned int j,
2707 const unsigned int k,
2708 const unsigned int l)
2710 Assert (i < this->table_size[0],
2711 ExcIndexRange (i, 0, this->table_size[0]));
2712 Assert (j < this->table_size[1],
2713 ExcIndexRange (j, 0, this->table_size[1]));
2714 Assert (k < this->table_size[2],
2715 ExcIndexRange (k, 0, this->table_size[2]));
2716 Assert (l < this->table_size[3],
2717 ExcIndexRange (l, 0, this->table_size[3]));
2719 *this->table_size[2] + k)
2720 *this->table_size[3] + l];
2725 template <
typename T>
2727 typename AlignedVector<T>::const_reference
2735 template <
typename T>
2737 typename AlignedVector<T>::reference
2745 template <
typename T>
2752 template <
typename T>
2755 const unsigned int size2,
2756 const unsigned int size3,
2757 const unsigned int size4,
2758 const unsigned int size5)
2765 template <
typename T>
2767 ::internal::TableBaseAccessors::Accessor<5,T,true,4>
2770 Assert (i < this->table_size[0],
2771 ExcIndexRange (i, 0, this->table_size[0]));
2773 this->table_size[2] *
2774 this->table_size[3] *
2775 this->table_size[4];
2776 return (::internal::TableBaseAccessors::Accessor<5,T,true,4>
2778 this->
values.begin() + i*subobject_size));
2783 template <
typename T>
2785 ::internal::TableBaseAccessors::Accessor<5,T,false,4>
2788 Assert (i < this->table_size[0],
2789 ExcIndexRange (i, 0, this->table_size[0]));
2791 this->table_size[2] *
2792 this->table_size[3] *
2793 this->table_size[4];
2794 return (::internal::TableBaseAccessors::Accessor<5,T,false,4>
2796 this->
values.begin() + i*subobject_size));
2801 template <
typename T>
2803 typename AlignedVector<T>::const_reference
2805 const unsigned int j,
2806 const unsigned int k,
2807 const unsigned int l,
2808 const unsigned int m)
const 2810 Assert (i < this->table_size[0],
2811 ExcIndexRange (i, 0, this->table_size[0]));
2812 Assert (j < this->table_size[1],
2813 ExcIndexRange (j, 0, this->table_size[1]));
2814 Assert (k < this->table_size[2],
2815 ExcIndexRange (k, 0, this->table_size[2]));
2816 Assert (l < this->table_size[3],
2817 ExcIndexRange (l, 0, this->table_size[3]));
2818 Assert (m < this->table_size[4],
2819 ExcIndexRange (m, 0, this->table_size[4]));
2821 *this->table_size[2] + k)
2822 *this->table_size[3] + l)
2823 *this->table_size[4] + m];
2828 template <
typename T>
2830 typename AlignedVector<T>::reference
2832 const unsigned int j,
2833 const unsigned int k,
2834 const unsigned int l,
2835 const unsigned int m)
2837 Assert (i < this->table_size[0],
2838 ExcIndexRange (i, 0, this->table_size[0]));
2839 Assert (j < this->table_size[1],
2840 ExcIndexRange (j, 0, this->table_size[1]));
2841 Assert (k < this->table_size[2],
2842 ExcIndexRange (k, 0, this->table_size[2]));
2843 Assert (l < this->table_size[3],
2844 ExcIndexRange (l, 0, this->table_size[3]));
2845 Assert (m < this->table_size[4],
2846 ExcIndexRange (m, 0, this->table_size[4]));
2848 *this->table_size[2] + k)
2849 *this->table_size[3] + l)
2850 *this->table_size[4] + m];
2855 template <
typename T>
2857 typename AlignedVector<T>::const_reference
2865 template <
typename T>
2867 typename AlignedVector<T>::reference
2875 template <
typename T>
2882 template <
typename T>
2885 const unsigned int size2,
2886 const unsigned int size3,
2887 const unsigned int size4,
2888 const unsigned int size5,
2889 const unsigned int size6)
2896 template <
typename T>
2898 ::internal::TableBaseAccessors::Accessor<6,T,true,5>
2901 Assert (i < this->table_size[0],
2902 ExcIndexRange (i, 0, this->table_size[0]));
2904 this->table_size[2] *
2905 this->table_size[3] *
2906 this->table_size[4] *
2907 this->table_size[5];
2908 return (::internal::TableBaseAccessors::Accessor<6,T,true,5>
2910 this->
values.begin() + i*subobject_size));
2915 template <
typename T>
2917 ::internal::TableBaseAccessors::Accessor<6,T,false,5>
2920 Assert (i < this->table_size[0],
2921 ExcIndexRange (i, 0, this->table_size[0]));
2923 this->table_size[2] *
2924 this->table_size[3] *
2925 this->table_size[4] *
2926 this->table_size[5];
2927 return (::internal::TableBaseAccessors::Accessor<6,T,false,5>
2929 this->
values.begin() + i*subobject_size));
2934 template <
typename T>
2936 typename AlignedVector<T>::const_reference
2938 const unsigned int j,
2939 const unsigned int k,
2940 const unsigned int l,
2941 const unsigned int m,
2942 const unsigned int n)
const 2944 Assert (i < this->table_size[0],
2945 ExcIndexRange (i, 0, this->table_size[0]));
2946 Assert (j < this->table_size[1],
2947 ExcIndexRange (j, 0, this->table_size[1]));
2948 Assert (k < this->table_size[2],
2949 ExcIndexRange (k, 0, this->table_size[2]));
2950 Assert (l < this->table_size[3],
2951 ExcIndexRange (l, 0, this->table_size[3]));
2952 Assert (m < this->table_size[4],
2953 ExcIndexRange (m, 0, this->table_size[4]));
2954 Assert (n < this->table_size[5],
2955 ExcIndexRange (n, 0, this->table_size[5]));
2957 *this->table_size[2] + k)
2958 *this->table_size[3] + l)
2959 *this->table_size[4] + m)
2960 *this->table_size[5] + n];
2965 template <
typename T>
2967 typename AlignedVector<T>::reference
2969 const unsigned int j,
2970 const unsigned int k,
2971 const unsigned int l,
2972 const unsigned int m,
2973 const unsigned int n)
2975 Assert (i < this->table_size[0],
2976 ExcIndexRange (i, 0, this->table_size[0]));
2977 Assert (j < this->table_size[1],
2978 ExcIndexRange (j, 0, this->table_size[1]));
2979 Assert (k < this->table_size[2],
2980 ExcIndexRange (k, 0, this->table_size[2]));
2981 Assert (l < this->table_size[3],
2982 ExcIndexRange (l, 0, this->table_size[3]));
2983 Assert (m < this->table_size[4],
2984 ExcIndexRange (m, 0, this->table_size[4]));
2985 Assert (n < this->table_size[5],
2986 ExcIndexRange (n, 0, this->table_size[5]));
2988 *this->table_size[2] + k)
2989 *this->table_size[3] + l)
2990 *this->table_size[4] + m)
2991 *this->table_size[5] + n];
2996 template <
typename T>
2998 typename AlignedVector<T>::const_reference
3006 template <
typename T>
3008 typename AlignedVector<T>::reference
3016 template <
typename T>
3023 template <
typename T>
3026 const unsigned int size2,
3027 const unsigned int size3,
3028 const unsigned int size4,
3029 const unsigned int size5,
3030 const unsigned int size6,
3031 const unsigned int size7)
3038 template <
typename T>
3040 ::internal::TableBaseAccessors::Accessor<7,T,true,6>
3043 Assert (i < this->table_size[0],
3044 ExcIndexRange (i, 0, this->table_size[0]));
3046 this->table_size[2] *
3047 this->table_size[3] *
3048 this->table_size[4] *
3049 this->table_size[5] *
3050 this->table_size[6];
3051 return (::internal::TableBaseAccessors::Accessor<7,T,true,6>
3053 this->
values.begin() + i*subobject_size));
3058 template <
typename T>
3060 ::internal::TableBaseAccessors::Accessor<7,T,false,6>
3063 Assert (i < this->table_size[0],
3064 ExcIndexRange (i, 0, this->table_size[0]));
3066 this->table_size[2] *
3067 this->table_size[3] *
3068 this->table_size[4] *
3069 this->table_size[5] *
3070 this->table_size[6];
3071 return (::internal::TableBaseAccessors::Accessor<7,T,false,6>
3073 this->
values.begin() + i*subobject_size));
3078 template <
typename T>
3080 typename AlignedVector<T>::const_reference
3082 const unsigned int j,
3083 const unsigned int k,
3084 const unsigned int l,
3085 const unsigned int m,
3086 const unsigned int n,
3087 const unsigned int o)
const 3089 Assert (i < this->table_size[0],
3090 ExcIndexRange (i, 0, this->table_size[0]));
3091 Assert (j < this->table_size[1],
3092 ExcIndexRange (j, 0, this->table_size[1]));
3093 Assert (k < this->table_size[2],
3094 ExcIndexRange (k, 0, this->table_size[2]));
3095 Assert (l < this->table_size[3],
3096 ExcIndexRange (l, 0, this->table_size[3]));
3097 Assert (m < this->table_size[4],
3098 ExcIndexRange (m, 0, this->table_size[4]));
3099 Assert (n < this->table_size[5],
3100 ExcIndexRange (n, 0, this->table_size[5]));
3101 Assert (o < this->table_size[6],
3102 ExcIndexRange (o, 0, this->table_size[6]));
3104 *this->table_size[2] + k)
3105 *this->table_size[3] + l)
3106 *this->table_size[4] + m)
3107 *this->table_size[5] + n)
3108 *this->table_size[6] + o];
3113 template <
typename T>
3115 typename AlignedVector<T>::reference
3117 const unsigned int j,
3118 const unsigned int k,
3119 const unsigned int l,
3120 const unsigned int m,
3121 const unsigned int n,
3122 const unsigned int o)
3124 Assert (i < this->table_size[0],
3125 ExcIndexRange (i, 0, this->table_size[0]));
3126 Assert (j < this->table_size[1],
3127 ExcIndexRange (j, 0, this->table_size[1]));
3128 Assert (k < this->table_size[2],
3129 ExcIndexRange (k, 0, this->table_size[2]));
3130 Assert (l < this->table_size[3],
3131 ExcIndexRange (l, 0, this->table_size[3]));
3132 Assert (m < this->table_size[4],
3133 ExcIndexRange (m, 0, this->table_size[4]));
3134 Assert (n < this->table_size[5],
3135 ExcIndexRange (n, 0, this->table_size[5]));
3136 Assert (o < this->table_size[5],
3137 ExcIndexRange (o, 0, this->table_size[6]));
3139 *this->table_size[2] + k)
3140 *this->table_size[3] + l)
3141 *this->table_size[4] + m)
3142 *this->table_size[5] + n)
3143 *this->table_size[6] + o];
3148 template <
typename T>
3150 typename AlignedVector<T>::const_reference
3158 template <
typename T>
3160 typename AlignedVector<T>::reference
3178 template <
int N,
typename T>
3185 DEAL_II_NAMESPACE_CLOSE
bool operator==(const TableBase< N, T > &T2) const
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)
const TableIndices< N > & size() const
AlignedVector< T >::reference el(const unsigned int i, const unsigned int j)
::ExceptionBase & ExcMessage(std::string arg1)
TableBase< N, T > & operator=(const TableBase< N, T > &src)
TableBase< 7, T >::size_type size_type
TableBase< 4, T >::size_type size_type
unsigned int n_cols() const
size_type n_elements() const
TableBase< 2, T >::size_type size_type
TableBase< 5, T >::size_type size_type
TableBase< 2, T >::size_type size_type
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
#define Assert(cond, exc)
AlignedVector< T >::reference el(const TableIndices< N > &indices)
unsigned int n_rows() const
AlignedVector< T >::const_reference operator()(const unsigned int i, const unsigned int j) const
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
std::size_t memory_consumption() const
TableBase< 3, T >::size_type size_type
unsigned int size(const unsigned int i) const
TableIndices< N > table_size
#define DeclException3(Exception3, type1, type2, type3, outsequence)
AlignedVector< T >::size_type size_type
TableBase< 1, T >::size_type size_type
AlignedVector< T >::reference operator()(const TableIndices< N > &indices)
AlignedVector< T > values
void reinit(const unsigned int size1, const unsigned int size2, const bool omit_default_initialization=false)
void fill(InputIterator entries, const bool C_style_indexing=true)