17 #ifndef __deal2__table_h
18 #define __deal2__table_h
20 #include <deal.II/base/config.h>
22 #include <deal.II/base/subscriptor.h>
23 #include <deal.II/base/table_indices.h>
24 #include <deal.II/base/memory_consumption.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>;
64 namespace TableBaseAccessors
74 template <
int N,
typename T,
bool Constness>
84 template <
int N,
typename T>
struct Types<N,T,true>
86 typedef const T value_type;
89 typedef typename std::vector<T>::const_iterator iterator;
90 typedef typename std::vector<T>::const_iterator const_iterator;
92 typedef typename std::vector<T>::const_reference reference;
93 typedef typename std::vector<T>::const_reference const_reference;
102 template <
int N,
typename T>
struct Types<N,T,false>
104 typedef T value_type;
107 typedef typename std::vector<T>::iterator iterator;
108 typedef typename std::vector<T>::const_iterator const_iterator;
110 typedef typename std::vector<T>::reference reference;
111 typedef typename std::vector<T>::const_reference const_reference;
154 template <
int N,
typename T,
bool C,
unsigned int P>
173 const iterator data);
212 <<
"Index " << N-P+1 <<
"has a value of "
213 << arg1 <<
" but needs to be in the range ["
214 << arg2 <<
"," << arg3 <<
"[");
231 template <
int N1,
typename T1>
friend class ::Table;
232 template <
int N1,
typename T1,
bool C1,
unsigned int P1>
234 # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG
235 friend class ::Table<N,T>;
252 template <
int N,
typename T,
bool C>
273 typedef size_t size_type;
274 typedef ptrdiff_t difference_type;
309 const iterator data);
345 unsigned int size ()
const;
352 iterator begin ()
const;
359 iterator end ()
const;
377 template <
int N1,
typename T1>
friend class ::Table;
378 template <
int N1,
typename T1,
bool C1,
unsigned int P1>
380 # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG
381 friend class ::Table<2,T>;
466 template <
int N,
typename T>
495 template <
typename T2>
527 template<
typename T2>
554 const bool fast =
false);
560 unsigned int size (
const unsigned int i)
const;
609 template<
typename T2>
610 void fill (
const T2 *entries);
616 void fill (
const T &value);
622 typename std::vector<T>::reference
638 typename std::vector<T>::const_reference
664 template <
class Archive>
665 void serialize (Archive &ar,
const unsigned int version);
706 typename std::vector<T>::const_reference
el (
const TableIndices<N> &indices)
const;
756 template <
int N,typename T>
757 class
Table : public TableBase<N,T>
775 template <
typename T>
799 typename std::vector<T>::const_reference
800 operator [] (
const unsigned int i)
const;
809 typename std::vector<T>::reference
810 operator [] (
const unsigned int i);
819 typename std::vector<T>::const_reference
829 typename std::vector<T>::reference
838 typename std::vector<T>::reference
847 typename std::vector<T>::const_reference
866 template <
typename T>
881 Table (
const unsigned int size1,
882 const unsigned int size2);
894 void reinit (
const unsigned int size1,
895 const unsigned int size2,
896 const bool fast =
false);
909 operator [] (
const unsigned int i)
const;
922 operator [] (
const unsigned int i);
933 typename std::vector<T>::const_reference
935 const unsigned int j)
const;
947 typename std::vector<T>::reference
949 const unsigned int j);
957 typename std::vector<T>::reference
966 typename std::vector<T>::const_reference
976 unsigned int n_rows ()
const;
984 unsigned int n_cols ()
const;
1002 typename std::vector<T>::reference
el (
const unsigned int i,
1003 const unsigned int j);
1029 typename std::vector<T>::const_reference
el (
const unsigned int i,
1030 const unsigned int j)
const;
1045 template <
typename T>
1060 Table (
const unsigned int size1,
1061 const unsigned int size2,
1062 const unsigned int size3);
1076 operator [] (
const unsigned int i)
const;
1090 operator [] (
const unsigned int i);
1101 typename std::vector<T>::const_reference
operator () (
const unsigned int i,
1102 const unsigned int j,
1103 const unsigned int k)
const;
1115 typename std::vector<T>::reference
operator () (
const unsigned int i,
1116 const unsigned int j,
1117 const unsigned int k);
1148 template <
typename T>
1163 Table (
const unsigned int size1,
1164 const unsigned int size2,
1165 const unsigned int size3,
1166 const unsigned int size4);
1180 operator [] (
const unsigned int i)
const;
1194 operator [] (
const unsigned int i);
1205 typename std::vector<T>::const_reference
operator () (
const unsigned int i,
1206 const unsigned int j,
1207 const unsigned int k,
1208 const unsigned int l)
const;
1220 typename std::vector<T>::reference
operator () (
const unsigned int i,
1221 const unsigned int j,
1222 const unsigned int k,
1223 const unsigned int l);
1231 typename std::vector<T>::reference
1240 typename std::vector<T>::const_reference
1256 template <
typename T>
1271 Table (
const unsigned int size1,
1272 const unsigned int size2,
1273 const unsigned int size3,
1274 const unsigned int size4,
1275 const unsigned int size5);
1289 operator [] (
const unsigned int i)
const;
1303 operator [] (
const unsigned int i);
1314 typename std::vector<T>::const_reference
operator () (
const unsigned int i,
1315 const unsigned int j,
1316 const unsigned int k,
1317 const unsigned int l,
1318 const unsigned int m)
const;
1329 typename std::vector<T>::reference
operator () (
const unsigned int i,
1330 const unsigned int j,
1331 const unsigned int k,
1332 const unsigned int l,
1333 const unsigned int m);
1341 typename std::vector<T>::reference
1350 typename std::vector<T>::const_reference
1366 template <
typename T>
1381 Table (
const unsigned int size1,
1382 const unsigned int size2,
1383 const unsigned int size3,
1384 const unsigned int size4,
1385 const unsigned int size5,
1386 const unsigned int size6);
1400 operator [] (
const unsigned int i)
const;
1414 operator [] (
const unsigned int i);
1425 typename std::vector<T>::const_reference
operator () (
const unsigned int i,
1426 const unsigned int j,
1427 const unsigned int k,
1428 const unsigned int l,
1429 const unsigned int m,
1430 const unsigned int n)
const;
1441 typename std::vector<T>::reference
operator () (
const unsigned int i,
1442 const unsigned int j,
1443 const unsigned int k,
1444 const unsigned int l,
1445 const unsigned int m,
1446 const unsigned int n);
1454 typename std::vector<T>::reference
1463 typename std::vector<T>::const_reference
1478 template <
typename T>
1493 Table (
const unsigned int size1,
1494 const unsigned int size2,
1495 const unsigned int size3,
1496 const unsigned int size4,
1497 const unsigned int size5,
1498 const unsigned int size6,
1499 const unsigned int size7);
1513 operator [] (
const unsigned int i)
const;
1527 operator [] (
const unsigned int i);
1538 typename std::vector<T>::const_reference
operator () (
const unsigned int i,
1539 const unsigned int j,
1540 const unsigned int k,
1541 const unsigned int l,
1542 const unsigned int m,
1543 const unsigned int n,
1544 const unsigned int o)
const;
1555 typename std::vector<T>::reference
operator () (
const unsigned int i,
1556 const unsigned int j,
1557 const unsigned int k,
1558 const unsigned int l,
1559 const unsigned int m,
1560 const unsigned int n,
1561 const unsigned int o);
1569 typename std::vector<T>::reference
1578 typename std::vector<T>::const_reference
1597 template <
typename T>
1613 const unsigned int size2);
1625 void reinit (
const unsigned int size1,
1626 const unsigned int size2,
1627 const bool fast =
false);
1638 typename std::vector<T>::const_reference
operator () (
const unsigned int i,
1639 const unsigned int j)
const;
1650 typename std::vector<T>::reference
operator () (
const unsigned int i,
1651 const unsigned int j);
1659 unsigned int n_rows ()
const;
1667 unsigned int n_cols ()
const;
1685 typename std::vector<T>::reference
el (
const unsigned int i,
1686 const unsigned int j);
1712 typename std::vector<T>::const_reference
el (
const unsigned int i,
1713 const unsigned int j)
const;
1723 template <
int N,
typename T>
1729 template <
int N,
typename T>
1737 template <
int N,
typename T>
1749 template <
int N,
typename T>
1750 template <
typename T2>
1755 std::copy (src.
values.begin(), src.
values.end(), values.begin());
1760 template <
int N,
typename T>
1761 template <
class Archive>
1768 ar &values &table_size;
1775 namespace TableBaseAccessors
1777 template <
int N,
typename T,
bool C,
unsigned int P>
1780 const iterator data)
1788 template <
int N,
typename T,
bool C,
unsigned int P>
1790 Accessor<N,T,C,P>::Accessor (
const Accessor &a)
1798 template <
int N,
typename T,
bool C,
unsigned int P>
1800 Accessor<N,T,C,P>::Accessor ()
1802 table (*static_cast<const TableType *>(0)),
1813 template <
int N,
typename T,
bool C,
unsigned int P>
1816 Accessor<N,T,C,P>::operator [] (
const unsigned int i)
const
1818 Assert (i < table.size()[N-P],
1825 return Accessor<N,T,C,P-1> (table, data);
1831 unsigned int subobject_size = table.size()[N-1];
1832 for (
int p=P-1; p>1; --p)
1833 subobject_size *= table.size()[N-p];
1834 const iterator new_data = data + i*subobject_size;
1835 return Accessor<N,T,C,P-1> (table, new_data);
1841 template <
int N,
typename T,
bool C>
1843 Accessor<N,T,C,1>::Accessor (
const TableType &table,
1844 const iterator data)
1852 template <
int N,
typename T,
bool C>
1854 Accessor<N,T,C,1>::Accessor ()
1856 table (*static_cast<const TableType *>(0)),
1867 template <
int N,
typename T,
bool C>
1869 Accessor<N,T,C,1>::Accessor (
const Accessor &a)
1877 template <
int N,
typename T,
bool C>
1879 typename Accessor<N,T,C,1>::reference
1880 Accessor<N,T,C,1>::operator [] (
const unsigned int i)
const
1882 Assert (i < table.size()[N-1],
1889 template <
int N,
typename T,
bool C>
1892 Accessor<N,T,C,1>::size ()
const
1894 return table.size()[N-1];
1899 template <
int N,
typename T,
bool C>
1901 typename Accessor<N,T,C,1>::iterator
1902 Accessor<N,T,C,1>::begin ()
const
1909 template <
int N,
typename T,
bool C>
1911 typename Accessor<N,T,C,1>::iterator
1912 Accessor<N,T,C,1>::end ()
const
1914 return data+table.size()[N-1];
1921 template <
int N,
typename T>
1928 template <
int N,
typename T>
1935 std::copy (m.
values.begin(), m.
values.end(), values.begin());
1942 template <
int N,
typename T>
1943 template <
typename T2>
1950 std::copy (m.
values.begin(), m.
values.begin() + n_elements(),
1957 template <
int N,
typename T>
1962 return (values == T2.
values);
1967 template <
int N,
typename T>
1972 if (n_elements() != 0)
1973 std::fill (values.begin(), values.end(), T());
1978 template <
int N,
typename T>
1983 if (n_elements() != 0)
1984 std::fill (values.begin(), values.end(), value);
1990 template <
int N,
typename T>
1996 table_size = new_sizes;
1998 const unsigned int new_size = n_elements();
2017 values.resize (new_size);
2039 template <
int N,
typename T>
2049 template <
int N,
typename T>
2055 return table_size[i];
2060 template <
int N,
typename T>
2066 for (
unsigned int n=0; n<N; ++n)
2073 template <
int N,
typename T>
2078 return (n_elements() == 0);
2083 template <
int N,
typename T>
2084 template <
typename T2>
2089 Assert (n_elements() != 0,
2090 ExcMessage(
"Trying to fill an empty matrix."));
2092 std::copy (entries, entries+n_elements(), values.begin());
2097 template <
int N,
typename T>
2108 template <
int N,
typename T>
2118 template <
int N,
typename T>
2133 return indices[0]*table_size[1] + indices[1];
2135 return ((indices[0]*table_size[1] + indices[1])*table_size[2]
2139 unsigned int s = indices[0];
2140 for (
unsigned int n=1; n<N; ++n)
2141 s = s*table_size[n] + indices[n];
2149 template <
int N,
typename T>
2151 typename std::vector<T>::const_reference
2154 for (
unsigned int n=0; n<N; ++n)
2155 Assert (indices[n] < table_size[n],
2162 template <
int N,
typename T>
2164 typename std::vector<T>::reference
2167 for (
unsigned int n=0; n<N; ++n)
2168 Assert (indices[n] < table_size[n],
2175 template <
int N,
typename T>
2177 typename std::vector<T>::const_reference
2180 return values[position(indices)];
2185 template <
int N,
typename T>
2187 typename std::vector<T>::reference
2190 Assert (position(indices) < values.size(),
2192 return values[position(indices)];
2197 template <
int N,
typename T>
2199 typename std::vector<T>::const_pointer
2202 if (values.size() == 0)
2203 return typename std::vector<T>::const_pointer();
2211 template <
typename T>
2218 template <
typename T>
2227 template <
typename T>
2229 typename std::vector<T>::const_reference
2239 template <
typename T>
2241 typename std::vector<T>::reference
2251 template <
typename T>
2253 typename std::vector<T>::const_reference
2263 template <
typename T>
2265 typename std::vector<T>::reference
2275 template <
typename T>
2277 typename std::vector<T>::const_reference
2285 template <
typename T>
2287 typename std::vector<T>::reference
2296 template <
typename T>
2303 template <
typename T>
2306 const unsigned int size2)
2313 template <
typename T>
2317 const unsigned int size2,
2325 template <
typename T>
2327 ::internal::TableBaseAccessors::Accessor<2,T,true,1>
2332 return ::internal::TableBaseAccessors::Accessor<2,T,true,1>(*
this,
2333 this->
values.begin()+i*n_cols());
2338 template <
typename T>
2340 ::internal::TableBaseAccessors::Accessor<2,T,false,1>
2343 Assert (i < this->table_size[0],
2345 return ::internal::TableBaseAccessors::Accessor<2,T,false,1>(*
this,
2346 this->
values.begin()+i*n_cols());
2351 template <
typename T>
2353 typename std::vector<T>::const_reference
2355 const unsigned int j)
const
2357 Assert (i < this->table_size[0],
2359 Assert (j < this->table_size[1],
2361 return this->
values[i*this->table_size[1]+j];
2366 template <
typename T>
2368 typename std::vector<T>::reference
2370 const unsigned int j)
2372 Assert (i < this->table_size[0],
2374 Assert (j < this->table_size[1],
2376 return this->
values[i*this->table_size[1]+j];
2381 template <
typename T>
2383 typename std::vector<T>::const_reference
2391 template <
typename T>
2393 typename std::vector<T>::reference
2401 template <
typename T>
2403 typename std::vector<T>::const_reference
2405 const unsigned int j)
const
2407 return this->
values[i*this->table_size[1]+j];
2412 template <
typename T>
2414 typename std::vector<T>::reference
2416 const unsigned int j)
2418 return this->
values[i*this->table_size[1]+j];
2423 template <
typename T>
2428 return this->table_size[0];
2433 template <
typename T>
2438 return this->table_size[1];
2445 template <
typename T>
2452 template <
typename T>
2455 const unsigned int size2)
2462 template <
typename T>
2466 const unsigned int size2,
2474 template <
typename T>
2476 typename std::vector<T>::const_reference
2478 const unsigned int j)
const
2480 Assert (i < this->table_size[1],
2482 Assert (j < this->table_size[0],
2484 return this->values[j*this->table_size[1]+i];
2489 template <
typename T>
2491 typename std::vector<T>::reference
2493 const unsigned int j)
2495 Assert (i < this->table_size[1],
2497 Assert (j < this->table_size[0],
2499 return this->values[j*this->table_size[1]+i];
2504 template <
typename T>
2506 typename std::vector<T>::const_reference
2508 const unsigned int j)
const
2510 return this->values[j*this->table_size[1]+i];
2515 template <
typename T>
2517 typename std::vector<T>::reference
2519 const unsigned int j)
2521 return this->values[j*this->table_size[1]+i];
2526 template <
typename T>
2531 return this->table_size[1];
2536 template <
typename T>
2541 return this->table_size[0];
2549 template <
typename T>
2556 template <
typename T>
2559 const unsigned int size2,
2560 const unsigned int size3)
2567 template <
typename T>
2569 ::internal::TableBaseAccessors::Accessor<3,T,true,2>
2572 Assert (i < this->table_size[0],
2574 const unsigned int subobject_size = this->table_size[1] *
2575 this->table_size[2];
2578 this->
values.begin() + i*subobject_size));
2583 template <
typename T>
2585 ::internal::TableBaseAccessors::Accessor<3,T,false,2>
2588 Assert (i < this->table_size[0],
2590 const unsigned int subobject_size = this->table_size[1] *
2591 this->table_size[2];
2594 this->
values.begin() + i*subobject_size));
2599 template <
typename T>
2601 typename std::vector<T>::const_reference
2603 const unsigned int j,
2604 const unsigned int k)
const
2606 Assert (i < this->table_size[0],
2608 Assert (j < this->table_size[1],
2610 Assert (k < this->table_size[2],
2612 return this->
values[(i*this->table_size[1]+j)
2613 *this->table_size[2] + k];
2618 template <
typename T>
2620 typename std::vector<T>::reference
2622 const unsigned int j,
2623 const unsigned int k)
2625 Assert (i < this->table_size[0],
2627 Assert (j < this->table_size[1],
2629 Assert (k < this->table_size[2],
2631 return this->
values[(i*this->table_size[1]+j)
2632 *this->table_size[2] + k];
2637 template <
typename T>
2639 typename std::vector<T>::const_reference
2647 template <
typename T>
2649 typename std::vector<T>::reference
2657 template <
typename T>
2664 template <
typename T>
2667 const unsigned int size2,
2668 const unsigned int size3,
2669 const unsigned int size4)
2676 template <
typename T>
2678 ::internal::TableBaseAccessors::Accessor<4,T,true,3>
2681 Assert (i < this->table_size[0],
2683 const unsigned int subobject_size = this->table_size[1] *
2684 this->table_size[2] *
2685 this->table_size[3];
2688 this->
values.begin() + i*subobject_size));
2693 template <
typename T>
2695 ::internal::TableBaseAccessors::Accessor<4,T,false,3>
2698 Assert (i < this->table_size[0],
2700 const unsigned int subobject_size = this->table_size[1] *
2701 this->table_size[2] *
2702 this->table_size[3];
2705 this->
values.begin() + i*subobject_size));
2710 template <
typename T>
2712 typename std::vector<T>::const_reference
2714 const unsigned int j,
2715 const unsigned int k,
2716 const unsigned int l)
const
2718 Assert (i < this->table_size[0],
2720 Assert (j < this->table_size[1],
2722 Assert (k < this->table_size[2],
2724 Assert (l < this->table_size[3],
2726 return this->
values[((i*this->table_size[1]+j)
2727 *this->table_size[2] + k)
2728 *this->table_size[3] + l];
2733 template <
typename T>
2735 typename std::vector<T>::reference
2737 const unsigned int j,
2738 const unsigned int k,
2739 const unsigned int l)
2741 Assert (i < this->table_size[0],
2743 Assert (j < this->table_size[1],
2745 Assert (k < this->table_size[2],
2747 Assert (l < this->table_size[3],
2749 return this->
values[((i*this->table_size[1]+j)
2750 *this->table_size[2] + k)
2751 *this->table_size[3] + l];
2756 template <
typename T>
2758 typename std::vector<T>::const_reference
2766 template <
typename T>
2768 typename std::vector<T>::reference
2776 template <
typename T>
2783 template <
typename T>
2786 const unsigned int size2,
2787 const unsigned int size3,
2788 const unsigned int size4,
2789 const unsigned int size5)
2796 template <
typename T>
2798 ::internal::TableBaseAccessors::Accessor<5,T,true,4>
2801 Assert (i < this->table_size[0],
2803 const unsigned int subobject_size = this->table_size[1] *
2804 this->table_size[2] *
2805 this->table_size[3] *
2806 this->table_size[4];
2809 this->
values.begin() + i*subobject_size));
2814 template <
typename T>
2816 ::internal::TableBaseAccessors::Accessor<5,T,false,4>
2819 Assert (i < this->table_size[0],
2821 const unsigned int subobject_size = this->table_size[1] *
2822 this->table_size[2] *
2823 this->table_size[3] *
2824 this->table_size[4];
2827 this->
values.begin() + i*subobject_size));
2832 template <
typename T>
2834 typename std::vector<T>::const_reference
2836 const unsigned int j,
2837 const unsigned int k,
2838 const unsigned int l,
2839 const unsigned int m)
const
2841 Assert (i < this->table_size[0],
2843 Assert (j < this->table_size[1],
2845 Assert (k < this->table_size[2],
2847 Assert (l < this->table_size[3],
2849 Assert (m < this->table_size[4],
2851 return this->
values[(((i*this->table_size[1]+j)
2852 *this->table_size[2] + k)
2853 *this->table_size[3] + l)
2854 *this->table_size[4] + m];
2859 template <
typename T>
2861 typename std::vector<T>::reference
2863 const unsigned int j,
2864 const unsigned int k,
2865 const unsigned int l,
2866 const unsigned int m)
2868 Assert (i < this->table_size[0],
2870 Assert (j < this->table_size[1],
2872 Assert (k < this->table_size[2],
2874 Assert (l < this->table_size[3],
2876 Assert (m < this->table_size[4],
2878 return this->
values[(((i*this->table_size[1]+j)
2879 *this->table_size[2] + k)
2880 *this->table_size[3] + l)
2881 *this->table_size[4] + m];
2886 template <
typename T>
2888 typename std::vector<T>::const_reference
2896 template <
typename T>
2898 typename std::vector<T>::reference
2906 template <
typename T>
2913 template <
typename T>
2916 const unsigned int size2,
2917 const unsigned int size3,
2918 const unsigned int size4,
2919 const unsigned int size5,
2920 const unsigned int size6)
2927 template <
typename T>
2929 ::internal::TableBaseAccessors::Accessor<6,T,true,5>
2932 Assert (i < this->table_size[0],
2934 const unsigned int subobject_size = this->table_size[1] *
2935 this->table_size[2] *
2936 this->table_size[3] *
2937 this->table_size[4] *
2938 this->table_size[5];
2941 this->
values.begin() + i*subobject_size));
2946 template <
typename T>
2948 ::internal::TableBaseAccessors::Accessor<6,T,false,5>
2951 Assert (i < this->table_size[0],
2953 const unsigned int subobject_size = this->table_size[1] *
2954 this->table_size[2] *
2955 this->table_size[3] *
2956 this->table_size[4] *
2957 this->table_size[5];
2960 this->
values.begin() + i*subobject_size));
2965 template <
typename T>
2967 typename std::vector<T>::const_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)
const
2975 Assert (i < this->table_size[0],
2977 Assert (j < this->table_size[1],
2979 Assert (k < this->table_size[2],
2981 Assert (l < this->table_size[3],
2983 Assert (m < this->table_size[4],
2985 Assert (n < this->table_size[5],
2987 return this->
values[((((i*this->table_size[1]+j)
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 std::vector<T>::reference
3000 const unsigned int j,
3001 const unsigned int k,
3002 const unsigned int l,
3003 const unsigned int m,
3004 const unsigned int n)
3006 Assert (i < this->table_size[0],
3008 Assert (j < this->table_size[1],
3010 Assert (k < this->table_size[2],
3012 Assert (l < this->table_size[3],
3014 Assert (m < this->table_size[4],
3016 Assert (n < this->table_size[5],
3018 return this->
values[((((i*this->table_size[1]+j)
3019 *this->table_size[2] + k)
3020 *this->table_size[3] + l)
3021 *this->table_size[4] + m)
3022 *this->table_size[5] + n];
3027 template <
typename T>
3029 typename std::vector<T>::const_reference
3037 template <
typename T>
3039 typename std::vector<T>::reference
3047 template <
typename T>
3054 template <
typename T>
3057 const unsigned int size2,
3058 const unsigned int size3,
3059 const unsigned int size4,
3060 const unsigned int size5,
3061 const unsigned int size6,
3062 const unsigned int size7)
3069 template <
typename T>
3071 ::internal::TableBaseAccessors::Accessor<7,T,true,6>
3074 Assert (i < this->table_size[0],
3076 const unsigned int subobject_size = this->table_size[1] *
3077 this->table_size[2] *
3078 this->table_size[3] *
3079 this->table_size[4] *
3080 this->table_size[5] *
3081 this->table_size[6];
3084 this->
values.begin() + i*subobject_size));
3089 template <
typename T>
3091 ::internal::TableBaseAccessors::Accessor<7,T,false,6>
3094 Assert (i < this->table_size[0],
3096 const unsigned int subobject_size = this->table_size[1] *
3097 this->table_size[2] *
3098 this->table_size[3] *
3099 this->table_size[4] *
3100 this->table_size[5] *
3101 this->table_size[6];
3104 this->
values.begin() + i*subobject_size));
3109 template <
typename T>
3111 typename std::vector<T>::const_reference
3113 const unsigned int j,
3114 const unsigned int k,
3115 const unsigned int l,
3116 const unsigned int m,
3117 const unsigned int n,
3118 const unsigned int o)
const
3120 Assert (i < this->table_size[0],
3122 Assert (j < this->table_size[1],
3124 Assert (k < this->table_size[2],
3126 Assert (l < this->table_size[3],
3128 Assert (m < this->table_size[4],
3130 Assert (n < this->table_size[5],
3132 Assert (o < this->table_size[6],
3134 return this->
values[(((((i*this->table_size[1]+j)
3135 *this->table_size[2] + k)
3136 *this->table_size[3] + l)
3137 *this->table_size[4] + m)
3138 *this->table_size[5] + n)
3139 *this->table_size[6] + o];
3144 template <
typename T>
3146 typename std::vector<T>::reference
3148 const unsigned int j,
3149 const unsigned int k,
3150 const unsigned int l,
3151 const unsigned int m,
3152 const unsigned int n,
3153 const unsigned int o)
3155 Assert (i < this->table_size[0],
3157 Assert (j < this->table_size[1],
3159 Assert (k < this->table_size[2],
3161 Assert (l < this->table_size[3],
3163 Assert (m < this->table_size[4],
3165 Assert (n < this->table_size[5],
3167 Assert (o < this->table_size[5],
3169 return this->
values[(((((i*this->table_size[1]+j)
3170 *this->table_size[2] + k)
3171 *this->table_size[3] + l)
3172 *this->table_size[4] + m)
3173 *this->table_size[5] + n)
3174 *this->table_size[6] + o];
3179 template <
typename T>
3181 typename std::vector<T>::const_reference
3189 template <
typename T>
3191 typename std::vector<T>::reference
3209 template <
int N,
typename T>
3216 DEAL_II_NAMESPACE_CLOSE
unsigned int n_rows() const
void reinit(const TableIndices< N > &new_size, const bool fast=false)
std::vector< T >::const_pointer data() const DEAL_II_DEPRECATED
void serialize(Archive &ar, const unsigned int version)
void swap(TableBase< N, T > &v)
::ExceptionBase & ExcMessage(std::string arg1)
unsigned int n_elements() const
TableBase< N, T > & operator=(const TableBase< N, T > &src)
void swap(BlockVector< Number > &u, BlockVector< Number > &v)
Accessor< N, T, C, P-1 > operator[](const unsigned int i) const
const TableIndices< N > & size() const
std::vector< T >::reference operator()(const TableIndices< N > &indices)
#define Assert(cond, exc)
std::size_t memory_consumption(const T &t)
std::vector< T >::reference el(const unsigned int i, const unsigned int j)
std::size_t memory_consumption() const
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
Types< N, T, C >::value_type value_type
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
Types< N, T, C >::TableType TableType
DeclException3(ExcIndexRange, int, int, int,<< "Index "<< N-P+1<< "has a value of "<< arg1<< " but needs to be in the range ["<< arg2<< ","<< arg3<< "[")
unsigned int position(const TableIndices< N > &indices) const
std::vector< T >::const_reference operator()(const unsigned int i, const unsigned int j) const
void fill(const T2 *entries)
void reinit(const unsigned int size1, const unsigned int size2, const bool fast=false)
std::vector< T >::reference el(const TableIndices< N > &indices)
TableIndices< N > table_size
unsigned int size(const unsigned int i) const
::ExceptionBase & ExcInternalError()
unsigned int n_cols() const
bool operator==(const TableBase< N, T > &T2) const