8#include <kernel/lafem/tuple_vector.hpp>
30 template<
typename First_,
typename... Rest_>
34 template<
typename,
typename...>
49 static_assert(std::is_same<DataType, typename RestClass::DataType>::value,
50 "sub-matrices have different data-types");
51 static_assert(std::is_same<IndexType, typename RestClass::IndexType>::value,
52 "sub-matrices have different index-types");
55 template <
typename DT2_ = DataType,
typename IT2_ = IndexType>
61 template <
typename DataType2_,
typename IndexType2_>
89 _first(std::forward<First_>(the_first)),
96 _first(std::forward<First_>(the_first)),
97 _rest(std::forward<Rest_>(the_rest)...)
113 _first = std::forward<First_>(other._first);
114 _rest = std::forward<RestClass>(other._rest);
143 _first.clone(other._first, clone_mode);
154 _first.clone(other._first);
164 const First_& first()
const
169 TupleMatrixRow<Rest_...>& rest()
174 const TupleMatrixRow<Rest_...>&
rest()
const
192 static_assert((0 <= i_) && (i_ <
num_blocks),
"invalid sub-matrix index");
200 static_assert((0 <= i_) && (i_ <
num_blocks),
"invalid sub-matrix index");
210 template <Perspective perspective_ = Perspective::native>
213 const Index rows_f =
_first.template rows<perspective_>();
214 const Index rows_r =
_rest.template rows<perspective_>();
215 XASSERTM(rows_f == rows_r,
"row count mismatch");
225 template <Perspective perspective_ = Perspective::native>
228 return _first.template columns<perspective_>() +
_rest.template columns<perspective_>();
237 template <Perspective perspective_ = Perspective::native>
240 return _first.template used_elements<perspective_>() +
_rest.template used_elements<perspective_>();
267 first().format(
value);
268 rest().format(
value);
280 first().format(rng, min, max);
281 rest().format(rng, min, max);
294 return first().create_vector_l();
305 first().apply(r, x.first());
306 rest().apply(r, x.rest(), r,
DataType(1));
311 first().apply_transposed(r.first(), x);
312 rest().apply_transposed(r.rest(), x);
317 first().apply(r, x.first(), y, alpha);
318 rest().apply(r, x.rest(), r, alpha);
323 first().apply_transposed(r.first(), x, y.first(), alpha);
324 rest().apply_transposed(r.rest(), x, y.rest(), alpha);
327 Index get_length_of_line(
const Index row)
const
329 return first().get_length_of_line(row) +
rest().get_length_of_line(row);
334 const Index first_length(first().get_length_of_line(row));
336 first().set_line(row, pval_set, pcol_set, col_start, stride);
337 rest().set_line(row, pval_set + stride * first_length, pcol_set + stride * first_length, col_start + first().
template columns<Perspective::pod>(), stride);
340 void set_line_reverse(
const Index row,
DataType *
const pval_set,
const Index stride = 1)
342 const Index first_length(first().get_length_of_line(row));
344 first().set_line_reverse(row, pval_set, stride);
345 rest().set_line_reverse(row, pval_set + stride * first_length, stride);
350 return first().row_degree(row) +
rest().row_degree(row);
353 template<
typename IT2_>
354 Index get_row_col_indices(
const Index row, IT2_*
const pcol_idx,
const IT2_ col_offset)
const
356 const Index first_cols = first().template columns<Perspective::pod>();
357 const Index first_degree = first().get_row_col_indices(row, pcol_idx, col_offset);
358 return first_degree +
rest().get_row_col_indices(row, pcol_idx + first_degree, col_offset + IT2_(first_cols));
361 template<
typename DT2_>
362 Index get_row_values(
const Index row, DT2_ *
const pvals)
const
364 const Index first_degree = first().get_row_values(row, pvals);
365 return first_degree +
rest().get_row_values(row, pvals + first_degree);
368 template<
typename DT2_>
369 Index set_row_values(
const Index row,
const DT2_ *
const pvals)
371 const Index first_degree = first().set_row_values(row, pvals);
372 return first_degree +
rest().set_row_values(row, pvals + first_degree);
384 std::uint64_t isize = *(std::uint64_t*) data.data();
385 std::vector<char>::iterator start = std::begin(data) +
sizeof(std::uint64_t);
386 std::vector<char>::iterator last_of_first = std::begin(data) +
sizeof(std::uint64_t) + (
int) isize;
387 std::vector<char> buffer_first(start, last_of_first);
388 _first.restore_from_checkpoint_data(buffer_first);
390 data.erase(std::begin(data), last_of_first);
397 std::size_t old_size = data.size();
398 data.insert(std::end(data),
sizeof(std::uint64_t), 0);
399 std::uint64_t ireal_size =
_first.set_checkpoint_data(data, config);
400 char* csize =
reinterpret_cast<char*
>(&ireal_size);
401 for(std::size_t i(0) ; i <
sizeof(std::uint64_t) ; ++i)
403 data[old_size + i] = csize[i];
409 template<
typename OtherFirst_,
typename... OtherRest_>
412 first().convert(other.first());
413 rest().convert(other.rest());
416 template<
typename OtherFirst_,
typename... OtherRest_>
417 void convert_reverse(TupleMatrixRow<OtherFirst_, OtherRest_...>& other)
const
419 first().convert_reverse(other.first());
420 rest().convert_reverse(other.rest());
426 template<
typename First_>
427 class TupleMatrixRow<First_>
430 template<
typename,
typename...>
431 friend class TupleMatrixRow;
438 typedef typename First_::DataType
DataType;
440 typedef typename First_::IndexType
IndexType;
442 template <
typename DT2_ = DataType,
typename IT2_ = IndexType>
443 using ContainerType = TupleMatrixRow<typename First_::template ContainerType<DT2_, IT2_> >;
446 template <
typename DataType2_,
typename IndexType2_>
452 typedef TupleVector<typename First_::VectorTypeR>
VectorTypeR;
461 return First_::name();
471 explicit TupleMatrixRow(First_&& the_first) :
472 _first(std::forward<First_>(the_first))
477 TupleMatrixRow(TupleMatrixRow&& other) :
483 TupleMatrixRow&
operator=(TupleMatrixRow&& other)
493 TupleMatrixRow(
const TupleMatrixRow&) =
delete;
495 TupleMatrixRow&
operator=(
const TupleMatrixRow&) =
delete;
499 return TupleMatrixRow(
_first.clone(mode));
507 void clone(
const TupleMatrixRow& other)
518 const First_& first()
const
527 static_assert(i_ == 0,
"invalid sub-matrix index");
533 const First_&
at()
const
535 static_assert(i_ == 0,
"invalid sub-matrix index");
539 template <Perspective perspective_ = Perspective::native>
542 return _first.template rows<perspective_>();
545 template <Perspective perspective_ = Perspective::native>
548 return _first.template columns<perspective_>();
551 template <Perspective perspective_ = Perspective::native>
554 return _first.template used_elements<perspective_>();
557 std::size_t
bytes()
const
569 first().format(
value);
574 first().format(rng, min, max);
584 return first().create_vector_l();
594 first().apply(r, x.first());
599 first().apply(r, x.first(), y, alpha);
604 first().apply_transposed(r.first(), x);
609 first().apply_transposed(r.first(), x, y.first(), alpha);
612 Index get_length_of_line(
const Index row)
const
614 return first().get_length_of_line(row);
619 first().set_line(row, pval_set, pcol_set, col_start, stride);
622 void set_line_reverse(
const Index row,
DataType *
const pval_set,
const Index stride = 1)
624 first().set_line_reverse(row, pval_set, stride);
629 return first().row_degree(row);
632 template<
typename IT2_>
633 Index get_row_col_indices(
const Index row, IT2_*
const pcol_idx,
const IT2_ col_offset)
const
635 return first().get_row_col_indices(row, pcol_idx, col_offset);
638 template<
typename DT2_>
639 Index get_row_values(
const Index row, DT2_ *
const pvals)
const
641 return first().get_row_values(row, pvals);
644 template<
typename DT2_>
645 Index set_row_values(
const Index row,
const DT2_ *
const pvals)
647 return first().set_row_values(row, pvals);
653 return _first.get_checkpoint_size(config);
659 _first.restore_from_checkpoint_data(data);
665 return _first.set_checkpoint_data(data, config);
668 template<
typename OtherFirst_>
669 void convert(
const TupleMatrixRow<OtherFirst_>& other)
671 first().convert(
other.first());
674 template<
typename OtherFirst_>
675 void convert_reverse(TupleMatrixRow<OtherFirst_>& other)
const
677 first().convert_reverse(
other.first());
686 template<
typename T_>
689 static constexpr bool value =
false;
692 template<
typename... T_>
693 struct IsTMR_<TupleMatrixRow<T_...>>
695 static constexpr bool value =
true;
708 template<
int i_,
int j_,
typename FirstRow_,
typename... RestRows_>
712 static_assert(i_ > 0,
"invalid row index");
713 static_assert(j_ >= 0,
"invalid column index");
717 template<
typename Meta_>
718 static Type& get(Meta_& meta)
723 template<
typename Meta_>
724 static const Type& get(
const Meta_& meta)
734 template<
int j_,
typename First_,
typename... Rest_,
typename... RestRows_>
738 static_assert(j_ >= 0,
"invalid column index");
740 typedef typename TupleElement<j_, First_, Rest_...>::Type Type;
742 template<
typename Meta_>
743 static Type& get(Meta_& meta)
748 template<
typename Meta_>
749 static const Type& get(
const Meta_& meta)
751 return TupleElement<j_, First_, Rest_...>::get(meta.first());
768 template<
typename FirstRow_,
typename... RestRows_>
772 template<
typename,
typename...>
779 static_assert(Intern::IsTMR_<FirstRow_>::value,
780 "template parameter of TupleMatrix must be TupleMatrixRow<...>");
797 static_assert(std::is_same<DataType, typename RestClass::DataType>::value,
798 "sub-matrices have different data-types");
799 static_assert(std::is_same<IndexType, typename RestClass::IndexType>::value,
800 "sub-matrices have different index-types");
803 template <
typename DT2_ = DataType,
typename IT2_ = IndexType>
809 template <
typename DataType2_,
typename IndexType2_>
818 static_assert(std::is_same<VectorTypeR, typename RestClass::VectorTypeR>::value,
"vector type mismatch");
840 _first(std::forward<FirstRow_>(the_first)),
846 explicit TupleMatrix(FirstRow_&& the_first, RestRows_&&... the_rest) :
847 _first(std::forward<FirstRow_>(the_first)),
848 _rest(std::forward<RestRows_>(the_rest)...)
864 _first = std::forward<FirstRow_>(other._first);
865 _rest = std::forward<RestClass>(other._rest);
894 _first.clone(other._first, clone_mode);
905 _first.clone(other._first);
915 const FirstRow_& first()
const
920 TupleMatrix<RestRows_...>& rest()
925 const TupleMatrix<RestRows_...>&
rest()
const
940 template<
int i_,
int j_>
943 static_assert((0 <= i_) && (i_ <
num_row_blocks),
"invalid sub-matrix row index");
944 static_assert((0 <= j_) && (j_ <
num_col_blocks),
"invalid sub-matrix column index");
949 template<
int i_,
int j_>
952 static_assert((0 <= i_) && (i_ <
num_row_blocks),
"invalid sub-matrix row index");
953 static_assert((0 <= j_) && (j_ <
num_col_blocks),
"invalid sub-matrix column index");
963 template <Perspective perspective_ = Perspective::native>
966 return _first.template rows<perspective_>() +
_rest.template rows<perspective_>();
975 template <Perspective perspective_ = Perspective::native>
978 const Index cols_f =
_first.template columns<perspective_>();
979 const Index cols_r =
_rest.template columns<perspective_>();
980 XASSERTM(cols_f == cols_r,
"column count mismatch");
990 template <Perspective perspective_ = Perspective::native>
993 return _first.template used_elements<perspective_>() +
_rest.template used_elements<perspective_>();
1020 first().format(
value);
1021 rest().format(
value);
1033 first().format(rng, min, max);
1034 rest().format(rng, min, max);
1053 return first().create_vector_r();
1064 first().apply(r.first(), x);
1065 rest().apply(r.rest(), x);
1076 first().apply_transposed(r, x.first());
1077 rest().apply_transposed(r, x.rest(), r,
DataType(1));
1090 first().apply(r.first(), x, y.first(), alpha);
1091 rest().apply(r.rest(), x, y.rest(), alpha);
1104 first().apply_transposed(r, x.first(), y, alpha);
1105 rest().apply_transposed(r, x.rest(), r, alpha);
1108 Index get_length_of_line(
const Index row)
const
1110 const Index first_rows = first().template rows<Perspective::pod>();
1111 if(row < first_rows)
1112 return first().get_length_of_line(row);
1114 return rest().get_length_of_line(row - first_rows);
1119 const Index first_rows = first().template rows<Perspective::pod>();
1120 if(row < first_rows)
1121 first().set_line(row, pval_set, pcol_set, col_start, stride);
1123 rest().set_line(row - first_rows, pval_set, pcol_set, col_start, stride);
1126 void set_line_reverse(
const Index row,
DataType *
const pval_set,
const Index stride = 1)
1128 const Index first_rows = first().template rows<Perspective::pod>();
1129 if(row < first_rows)
1130 first().set_line_reverse(row, pval_set, stride);
1132 rest().set_line_reverse(row - first_rows, pval_set, stride);
1137 const Index first_rows = first().template rows<Perspective::pod>();
1138 if(row < first_rows)
1139 return first().row_degree(row);
1141 return rest().row_degree(row - first_rows);
1144 template<
typename IT2_>
1145 Index get_row_col_indices(
const Index row, IT2_*
const pcol_idx,
const IT2_ col_offset)
const
1147 const Index first_rows = first().template rows<Perspective::pod>();
1148 if(row < first_rows)
1149 return first().get_row_col_indices(row, pcol_idx, col_offset);
1151 return rest().get_row_col_indices(row - first_rows, pcol_idx, col_offset);
1154 template<
typename DT2_>
1155 Index get_row_values(
const Index row, DT2_ *
const pvals)
const
1157 const Index first_rows = first().template rows<Perspective::pod>();
1158 if(row < first_rows)
1159 return first().get_row_values(row, pvals);
1161 return rest().get_row_values(row - first_rows, pvals);
1164 template<
typename DT2_>
1165 Index set_row_values(
const Index row,
const DT2_ *
const pvals)
1167 const Index first_rows = first().template rows<Perspective::pod>();
1168 if(row < first_rows)
1169 return first().set_row_values(row, pvals);
1171 return rest().set_row_values(row - first_rows, pvals);
1183 std::uint64_t isize = *(std::uint64_t*) data.data();
1184 std::vector<char>::iterator start = std::begin(data) +
sizeof(std::uint64_t);
1185 std::vector<char>::iterator last_of_first = std::begin(data) +
sizeof(std::uint64_t) + (
int) isize;
1186 std::vector<char> buffer_first(start, last_of_first);
1187 _first.restore_from_checkpoint_data(buffer_first);
1189 data.erase(std::begin(data), last_of_first);
1196 std::size_t old_size = data.size();
1197 data.insert(std::end(data),
sizeof(std::uint64_t), 0);
1198 std::uint64_t ireal_size =
_first.set_checkpoint_data(data, config);
1199 char* csize =
reinterpret_cast<char*
>(&ireal_size);
1200 for(std::size_t i(0) ; i <
sizeof(std::uint64_t) ; ++i)
1202 data[old_size +i] = csize[i];
1207 template<
typename OtherFirstRow_,
typename... OtherRestRows_>
1210 first().convert(other.first());
1211 rest().convert(other.rest());
1214 template<
typename OtherFirstRow_,
typename... OtherRestRows_>
1215 void convert_reverse(TupleMatrix<OtherFirstRow_, OtherRestRows_...>& other)
const
1217 first().convert_reverse(other.first());
1218 rest().convert_reverse(other.rest());
1224 template<
typename FirstRow_>
1225 class TupleMatrix<FirstRow_>
1228 template<
typename,
typename...>
1229 friend class TupleMatrix;
1232 static_assert(Intern::IsTMR_<FirstRow_>::value,
1233 "template parameter of TupleMatrix must be TupleMatrixRow<...>");
1237 static constexpr int num_blocks = 1;
1246 typedef typename FirstRow_::DataType
DataType;
1248 typedef typename FirstRow_::IndexType
IndexType;
1250 template <
typename DT2_ = DataType,
typename IT2_ = IndexType>
1251 using ContainerType = TupleMatrix<typename FirstRow_::template ContainerType<DT2_, IT2_> >;
1253 template <
typename DataType2_,
typename IndexType2_>
1257 typedef TupleVector<typename FirstRow_::VectorTypeL>
VectorTypeL;
1259 typedef typename FirstRow_::VectorTypeR
VectorTypeR;
1268 return FirstRow_::name();
1278 explicit TupleMatrix(FirstRow_&& the_first) :
1279 _first(std::forward<FirstRow_>(the_first))
1284 TupleMatrix(TupleMatrix&& other) :
1290 TupleMatrix&
operator=(TupleMatrix&& other)
1300 TupleMatrix(
const TupleMatrix&) =
delete;
1302 TupleMatrix&
operator=(
const TupleMatrix&) =
delete;
1306 return TupleMatrix(
_first.clone(mode));
1314 void clone(
const TupleMatrix& other)
1324 const FirstRow_& first()
const
1329 template<
int i_,
int j_>
1330 typename TupleMatrixElement<i_, j_, FirstRow_>::Type&
at()
1332 static_assert(0 == i_,
"invalid sub-matrix row index");
1333 static_assert((0 <= j_) && (j_ <
num_col_blocks),
"invalid sub-matrix column index");
1334 return TupleMatrixElement<i_, j_, FirstRow_>::get(*
this);
1337 template<
int i_,
int j_>
1338 const typename TupleMatrixElement<i_, j_, FirstRow_>::Type&
at()
const
1340 static_assert(0 == i_,
"invalid sub-matrix row index");
1341 static_assert((0 <= j_) && (j_ <
num_col_blocks),
"invalid sub-matrix column index");
1342 return TupleMatrixElement<i_, j_, FirstRow_>::get(*
this);
1345 template <Perspective perspective_ = Perspective::native>
1348 return _first.template rows<perspective_>();
1351 template <Perspective perspective_ = Perspective::native>
1354 return _first.template columns<perspective_>();
1357 template <Perspective perspective_ = Perspective::native>
1360 return _first.template used_elements<perspective_>();
1363 std::size_t
bytes()
const
1368 static String
name()
1375 first().format(
value);
1380 first().format(rng, min, max);
1397 return first().create_vector_r();
1402 first().apply(r.first(), x);
1407 first().apply(r.first(), x, y.first(), alpha);
1412 first().apply_transposed(r, x.first());
1417 first().apply(r, x.first(), y, alpha);
1420 Index get_length_of_line(
const Index row)
const
1422 return first().get_length_of_line(row);
1427 first().set_line(row, pval_set, pcol_set, col_start, stride);
1430 void set_line_reverse(
const Index row,
DataType *
const pval_set,
const Index stride = 1)
1432 first().set_line_reverse(row, pval_set, stride);
1437 return first().row_degree(row);
1440 template<
typename IT2_>
1441 Index get_row_col_indices(
const Index row, IT2_*
const pcol_idx,
const IT2_ col_offset)
const
1443 return first().get_row_col_indices(row, pcol_idx, col_offset);
1446 template<
typename DT2_>
1447 Index get_row_values(
const Index row, DT2_ *
const pvals)
const
1449 return first().get_row_values(row, pvals);
1452 template<
typename DT2_>
1453 Index set_row_values(
const Index row,
const DT2_ *
const pvals)
1455 return first().set_row_values(row, pvals);
1461 return _first.get_checkpoint_size(config);
1467 _first.restore_from_checkpoint_data(data);
1473 return _first.set_checkpoint_data(data, config);
1476 template<
typename OtherFirstRow_>
1477 void convert(
const TupleMatrix<OtherFirstRow_>& other)
1479 first().convert(
other.first());
1482 template<
typename OtherFirstRow_>
1483 void convert_reverse(TupleMatrix<OtherFirstRow_>& other)
const
1485 first().convert_reverse(
other.first());
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Config class for serialize parameter.
TupleMatrix element helper class template.
Variadic TupleMatrix class template.
TupleMatrix & operator=(TupleMatrix &&other)
move-assign operator
static constexpr int num_col_blocks
number of column blocks (horizontal size)
FirstRow_::IndexType IndexType
sub-matrix index-type
TupleMatrixElement< i_, j_, FirstRow_, RestRows_... >::Type & at()
Returns a sub-matrix block.
void format(Random &rng, DataType min, DataType max)
Reset all elements of the container to random values.
VectorTypeL create_vector_l() const
Returns a new compatible L-Vector.
VectorTypeR create_vector_r() const
Returns a new compatible R-Vector.
TupleMatrix clone(LAFEM::CloneMode mode=LAFEM::CloneMode::Weak) const
Creates and returns a copy of this matrix.
void clone(const TupleMatrix &other)
Turns this matrix into a clone of other.
static constexpr int num_row_blocks
number of row blocks (vertical size)
std::size_t bytes() const
Returns the total amount of bytes allocated.
void clear()
Free all allocated arrays.
std::uint64_t get_checkpoint_size(SerialConfig &config)
Calculate size.
FirstRow_ _first
sanity check: vector types must match for all rows
TupleMatrix(FirstRow_ &&the_first, RestRows_ &&... the_rest)
Sub-Matrix emplacement constructor.
void format(DataType value=DataType(0))
Reset all elements of the container to a given value or zero if missing.
Index columns() const
Returns the total number of columns in this matrix.
void apply(VectorTypeL &r, const VectorTypeR &x) const
Calculate .
ContainerType< DataType2_, IndexType2_ > ContainerTypeByDI
this typedef lets you create a vector container with new Datatype and Index types
Index rows() const
Returns the total number of rows in this matrix.
void restore_from_checkpoint_data(std::vector< char > &data)
Extract object from checkpoint.
FirstRow_::DataType DataType
sub-matrix data-type
RestClass _rest
all remaining sub-matrix rows
TupleMatrix & operator=(const TupleMatrix &)=delete
deleted copy-assign operator
Index used_elements() const
Returns the total number of non-zeros in this matrix.
void apply_transposed(VectorTypeR &r, const VectorTypeL &x) const
Calculate .
static String sub_name_list()
Returns a list of all sub-matrix type names.
TupleMatrix< typename FirstRow_::template ContainerType< DT2_, IT2_ >, typename RestRows_::template ContainerType< DT2_, IT2_ >... > ContainerType
Our 'base' class type.
void apply_transposed(VectorTypeR &r, const VectorTypeL &x, const VectorTypeR &y, DataType alpha=DataType(1)) const
Calculate .
TupleMatrix()
default CTOR
TupleMatrix(FirstRow_ &&the_first, RestClass &&the_rest)
rest-class emplacement ctor; for internal use only
TupleVector< typename FirstRow_::VectorTypeL, typename RestRows_::VectorTypeL... > VectorTypeL
Compatible L-vector type.
TupleMatrix(const TupleMatrix &)=delete
deleted copy-ctor
const TupleMatrixElement< i_, j_, FirstRow_, RestRows_... >::Type & at() const
Returns a sub-matrix block.
void clone(const TupleMatrix &other, CloneMode clone_mode)
Turns this matrix into a clone of other.
std::uint64_t set_checkpoint_data(std::vector< char > &data, SerialConfig &config)
TupleMatrix(TupleMatrix &&other)
move ctor
static String name()
Returns a descriptive string for this container.
void apply(VectorTypeL &r, const VectorTypeR &x, const VectorTypeL &y, DataType alpha=DataType(1)) const
Calculate .
FirstRow_::VectorTypeR VectorTypeR
Compatible R-vector type.
TupleMatrix row helper class template.
void restore_from_checkpoint_data(std::vector< char > &data)
Extract object from checkpoint.
static String name()
Returns a descriptive string for this container.
VectorTypeL create_vector_l() const
Returns a new compatible L-Vector.
void clone(const TupleMatrixRow &other, CloneMode clone_mode)
Turns this matrix into a clone of other.
Index columns() const
Returns the total number of columns in this matrix.
static constexpr int num_blocks
number of matrix columns
static String sub_name_list()
Returns a list of all sub-matrix type names.
TupleVector< typename First_::VectorTypeR, typename Rest_::VectorTypeR... > VectorTypeR
Compatible R-vector type.
TupleElement< i_, First_, Rest_... >::Type const & at() const
Returns a sub-matrix block.
TupleMatrixRow< typename First_::template ContainerType< DT2_, IT2_ >, typename Rest_::template ContainerType< DT2_, IT2_ >... > ContainerType
Our 'base' class type.
std::uint64_t get_checkpoint_size(SerialConfig &config)
Calculate size.
VectorTypeR create_vector_r() const
Returns a new compatible R-Vector.
TupleMatrixRow & operator=(TupleMatrixRow &&other)
move-assign operator
RestClass _rest
all remaining sub-matrices
TupleMatrixRow(TupleMatrixRow &&other)
move ctor
Index used_elements() const
Returns the total number of non-zeros in this matrix.
TupleMatrixRow(First_ &&the_first, RestClass &&the_rest)
rest-class emplacement ctor; for internal use only
ContainerType< DataType2_, IndexType2_ > ContainerTypeByDI
this typedef lets you create a vector container with new Datatype and Index types
void format(Random &rng, DataType min, DataType max)
Reset all elements of the container to random values.
TupleMatrixRow(First_ &&the_first, Rest_ &&... the_rest)
Sub-Matrix emplacement constructor.
void format(DataType value=DataType(0))
Reset all elements of the container to a given value or zero if missing.
First_::IndexType IndexType
sub-matrix index-type
std::size_t bytes() const
Returns the total amount of bytes allocated.
TupleMatrixRow()
default CTOR
First_::DataType DataType
sub-matrix data-type
TupleMatrixRow clone(LAFEM::CloneMode mode=LAFEM::CloneMode::Weak) const
Creates and returns a copy of this matrix.
void clone(const TupleMatrixRow &other)
Turns this matrix into a clone of other.
TupleMatrixRow(const TupleMatrixRow &)=delete
deleted copy-ctor
TupleElement< i_, First_, Rest_... >::Type & at()
Returns a sub-matrix block.
First_::VectorTypeL VectorTypeL
Compatible L-vector type.
Index rows() const
Returns the total number of rows in this matrix.
First_ _first
the first sub-matrix
TupleMatrixRow & operator=(const TupleMatrixRow &)=delete
deleted copy-assign operator
void clear()
Free all allocated arrays.
std::uint64_t set_checkpoint_data(std::vector< char > &data, SerialConfig &config)
Variadic TupleVector class template.
Pseudo-Random Number Generator.
String class implementation.
@ other
generic/other permutation strategy
@ rest
restriction (multigrid)
@ value
specifies whether the space should supply basis function values
std::uint64_t Index
Index data type.
Tuple container element helper class template.