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);
135 void init_workspace()
const
138 _rest.init_workspace();
141 void reset_workspace()
const
144 _rest.reset_workspace();
155 _first.clone(other._first, clone_mode);
166 _first.clone(other._first);
176 const First_& first()
const
181 TupleMatrixRow<Rest_...>& rest()
186 const TupleMatrixRow<Rest_...>&
rest()
const
204 static_assert((0 <= i_) && (i_ <
num_blocks),
"invalid sub-matrix index");
212 static_assert((0 <= i_) && (i_ <
num_blocks),
"invalid sub-matrix index");
223 XASSERTM(rows_f == rows_r,
"row count mismatch");
250 XASSERTM(rows_f == rows_r,
"row count mismatch");
300 first().format(
value);
301 rest().format(
value);
313 first().format(rng, min, max);
314 rest().format(rng, min, max);
327 return first().create_vector_l();
338 first().apply(r, x.first());
339 rest().apply(r, x.rest(), r,
DataType(1));
344 first().apply_transposed(r.first(), x);
345 rest().apply_transposed(r.rest(), x);
350 first().apply(r, x.first(), y, alpha);
351 rest().apply(r, x.rest(), r, alpha);
356 first().apply_transposed(r.first(), x, y.first(), alpha);
357 rest().apply_transposed(r.rest(), x, y.rest(), alpha);
362 return first().row_degree(row) +
rest().row_degree(row);
365 template<
typename IT2_>
366 Index get_row_col_indices(
const Index row, IT2_*
const pcol_idx,
const IT2_ col_offset)
const
368 const Index first_cols = first().num_cols_raw();
369 const Index first_degree = first().get_row_col_indices(row, pcol_idx, col_offset);
370 return first_degree +
rest().get_row_col_indices(row, pcol_idx + first_degree, col_offset + IT2_(first_cols));
373 template<
typename DT2_>
374 Index get_row_values(
const Index row, DT2_ *
const pvals)
const
376 const Index first_degree = first().get_row_values(row, pvals);
377 return first_degree +
rest().get_row_values(row, pvals + first_degree);
380 template<
typename DT2_>
381 Index set_row_values(
const Index row,
const DT2_ *
const pvals)
383 const Index first_degree = first().set_row_values(row, pvals);
384 return first_degree +
rest().set_row_values(row, pvals + first_degree);
396 std::uint64_t isize = *(std::uint64_t*) data.data();
397 std::vector<char>::iterator start = std::begin(data) +
sizeof(std::uint64_t);
398 std::vector<char>::iterator last_of_first = std::begin(data) +
sizeof(std::uint64_t) + (
int) isize;
399 std::vector<char> buffer_first(start, last_of_first);
400 _first.restore_from_checkpoint_data(buffer_first);
402 data.erase(std::begin(data), last_of_first);
409 std::size_t old_size = data.size();
410 data.insert(std::end(data),
sizeof(std::uint64_t), 0);
411 std::uint64_t ireal_size =
_first.set_checkpoint_data(data, config);
412 char* csize =
reinterpret_cast<char*
>(&ireal_size);
413 for(std::size_t i(0) ; i <
sizeof(std::uint64_t) ; ++i)
415 data[old_size + i] = csize[i];
421 template<
typename OtherFirst_,
typename... OtherRest_>
424 first().convert(source.first());
425 rest().convert(source.rest());
428 template<
typename OtherFirst_,
typename... OtherRest_>
429 void copy(
const TupleMatrixRow<OtherFirst_, OtherRest_...>& source)
431 first().copy(source.first());
432 rest().copy(source.rest());
435 template<
typename OtherFirst_,
typename... OtherRest_>
436 void copy_to(TupleMatrixRow<OtherFirst_, OtherRest_...>& target)
const
438 first().copy_to(target.first());
439 rest().copy_to(target.rest());
442 bool same_layout(
const TupleMatrixRow& other)
const
444 return first().same_layout(
other.first()) &&
rest().same_layout(
other.rest());
447 DataType max_rel_diff(
const TupleMatrixRow& other)
const
455 template<
typename First_>
456 class TupleMatrixRow<First_>
459 template<
typename,
typename...>
460 friend class TupleMatrixRow;
467 typedef typename First_::DataType
DataType;
469 typedef typename First_::IndexType
IndexType;
471 template <
typename DT2_ = DataType,
typename IT2_ = IndexType>
472 using ContainerType = TupleMatrixRow<typename First_::template ContainerType<DT2_, IT2_> >;
475 template <
typename DataType2_,
typename IndexType2_>
481 typedef TupleVector<typename First_::VectorTypeR>
VectorTypeR;
490 return First_::name();
500 explicit TupleMatrixRow(First_&& the_first) :
501 _first(std::forward<First_>(the_first))
506 TupleMatrixRow(TupleMatrixRow&& other) :
512 TupleMatrixRow&
operator=(TupleMatrixRow&& other)
522 TupleMatrixRow(
const TupleMatrixRow&) =
delete;
524 TupleMatrixRow&
operator=(
const TupleMatrixRow&) =
delete;
528 return TupleMatrixRow(
_first.clone(mode));
531 void init_workspace()
const
536 void reset_workspace()
const
546 void clone(
const TupleMatrixRow& other)
557 const First_& first()
const
566 static_assert(i_ == 0,
"invalid sub-matrix index");
572 const First_&
at()
const
574 static_assert(i_ == 0,
"invalid sub-matrix index");
595 return _first.num_rows_raw();
600 return _first.num_cols_raw();
605 return _first.num_nzes_raw();
608 std::size_t
bytes()
const
625 first().format(
value);
630 first().format(rng, min, max);
640 return first().create_vector_l();
650 first().apply(r, x.first());
655 first().apply(r, x.first(), y, alpha);
660 first().apply_transposed(r.first(), x);
665 first().apply_transposed(r.first(), x, y.first(), alpha);
670 return first().row_degree(row);
673 template<
typename IT2_>
674 Index get_row_col_indices(
const Index row, IT2_*
const pcol_idx,
const IT2_ col_offset)
const
676 return first().get_row_col_indices(row, pcol_idx, col_offset);
679 template<
typename DT2_>
680 Index get_row_values(
const Index row, DT2_ *
const pvals)
const
682 return first().get_row_values(row, pvals);
685 template<
typename DT2_>
686 Index set_row_values(
const Index row,
const DT2_ *
const pvals)
688 return first().set_row_values(row, pvals);
694 return _first.get_checkpoint_size(config);
700 _first.restore_from_checkpoint_data(data);
706 return _first.set_checkpoint_data(data, config);
709 template<
typename OtherFirst_>
710 void convert(
const TupleMatrixRow<OtherFirst_>& source)
712 first().convert(source.first());
715 template<
typename OtherFirst_>
716 void copy(
const TupleMatrixRow<OtherFirst_>& source)
718 first().copy(source.first());
721 template<
typename OtherFirst_>
722 void copy_to(TupleMatrixRow<OtherFirst_>& target)
const
724 first().copy_to(target.first());
727 bool same_layout(
const TupleMatrixRow& other)
const
729 return first().same_layout(
other.first());
732 DataType max_rel_diff(
const TupleMatrixRow& other)
const
734 return first().max_rel_diff(
other.first());
743 template<
typename T_>
746 static constexpr bool value =
false;
749 template<
typename... T_>
750 struct IsTMR_<TupleMatrixRow<T_...>>
752 static constexpr bool value =
true;
765 template<
int i_,
int j_,
typename FirstRow_,
typename... RestRows_>
769 static_assert(i_ > 0,
"invalid row index");
770 static_assert(j_ >= 0,
"invalid column index");
774 template<
typename Meta_>
775 static Type& get(Meta_& meta)
780 template<
typename Meta_>
781 static const Type& get(
const Meta_& meta)
791 template<
int j_,
typename First_,
typename... Rest_,
typename... RestRows_>
795 static_assert(j_ >= 0,
"invalid column index");
797 typedef typename TupleElement<j_, First_, Rest_...>::Type Type;
799 template<
typename Meta_>
800 static Type& get(Meta_& meta)
805 template<
typename Meta_>
806 static const Type& get(
const Meta_& meta)
808 return TupleElement<j_, First_, Rest_...>::get(meta.first());
825 template<
typename FirstRow_,
typename... RestRows_>
829 template<
typename,
typename...>
836 static_assert(Intern::IsTMR_<FirstRow_>::value,
837 "template parameter of TupleMatrix must be TupleMatrixRow<...>");
854 static_assert(std::is_same<DataType, typename RestClass::DataType>::value,
855 "sub-matrices have different data-types");
856 static_assert(std::is_same<IndexType, typename RestClass::IndexType>::value,
857 "sub-matrices have different index-types");
860 template <
typename DT2_ = DataType,
typename IT2_ = IndexType>
866 template <
typename DataType2_,
typename IndexType2_>
875 static_assert(std::is_same<VectorTypeR, typename RestClass::VectorTypeR>::value,
"vector type mismatch");
897 _first(std::forward<FirstRow_>(the_first)),
903 explicit TupleMatrix(FirstRow_&& the_first, RestRows_&&... the_rest) :
904 _first(std::forward<FirstRow_>(the_first)),
905 _rest(std::forward<RestRows_>(the_rest)...)
921 _first = std::forward<FirstRow_>(other._first);
922 _rest = std::forward<RestClass>(other._rest);
943 void init_workspace()
const
946 _rest.init_workspace();
949 void reset_workspace()
const
952 _rest.reset_workspace();
963 _first.clone(other._first, clone_mode);
974 _first.clone(other._first);
984 const FirstRow_& first()
const
989 TupleMatrix<RestRows_...>& rest()
994 const TupleMatrix<RestRows_...>&
rest()
const
1009 template<
int i_,
int j_>
1012 static_assert((0 <= i_) && (i_ <
num_row_blocks),
"invalid sub-matrix row index");
1013 static_assert((0 <= j_) && (j_ <
num_col_blocks),
"invalid sub-matrix column index");
1018 template<
int i_,
int j_>
1021 static_assert((0 <= i_) && (i_ <
num_row_blocks),
"invalid sub-matrix row index");
1022 static_assert((0 <= j_) && (j_ <
num_col_blocks),
"invalid sub-matrix column index");
1037 XASSERTM(cols_f == cols_r,
"column count mismatch");
1058 XASSERTM(cols_f == cols_r,
"column count mismatch");
1098 first().format(
value);
1099 rest().format(
value);
1111 first().format(rng, min, max);
1112 rest().format(rng, min, max);
1131 return first().create_vector_r();
1142 first().apply(r.first(), x);
1143 rest().apply(r.rest(), x);
1154 first().apply_transposed(r, x.first());
1155 rest().apply_transposed(r, x.rest(), r,
DataType(1));
1168 first().apply(r.first(), x, y.first(), alpha);
1169 rest().apply(r.rest(), x, y.rest(), alpha);
1182 first().apply_transposed(r, x.first(), y, alpha);
1183 rest().apply_transposed(r, x.rest(), r, alpha);
1188 const Index first_rows = first().num_rows_raw();
1189 if(row < first_rows)
1190 return first().row_degree(row);
1192 return rest().row_degree(row - first_rows);
1195 template<
typename IT2_>
1196 Index get_row_col_indices(
const Index row, IT2_*
const pcol_idx,
const IT2_ col_offset)
const
1198 const Index first_rows = first().num_rows_raw();
1199 if(row < first_rows)
1200 return first().get_row_col_indices(row, pcol_idx, col_offset);
1202 return rest().get_row_col_indices(row - first_rows, pcol_idx, col_offset);
1205 template<
typename DT2_>
1206 Index get_row_values(
const Index row, DT2_ *
const pvals)
const
1208 const Index first_rows = first().num_rows_raw();
1209 if(row < first_rows)
1210 return first().get_row_values(row, pvals);
1212 return rest().get_row_values(row - first_rows, pvals);
1215 template<
typename DT2_>
1216 Index set_row_values(
const Index row,
const DT2_ *
const pvals)
1218 const Index first_rows = first().num_rows_raw();
1219 if(row < first_rows)
1220 return first().set_row_values(row, pvals);
1222 return rest().set_row_values(row - first_rows, pvals);
1234 std::uint64_t isize = *(std::uint64_t*) data.data();
1235 std::vector<char>::iterator start = std::begin(data) +
sizeof(std::uint64_t);
1236 std::vector<char>::iterator last_of_first = std::begin(data) +
sizeof(std::uint64_t) + (
int) isize;
1237 std::vector<char> buffer_first(start, last_of_first);
1238 _first.restore_from_checkpoint_data(buffer_first);
1240 data.erase(std::begin(data), last_of_first);
1247 std::size_t old_size = data.size();
1248 data.insert(std::end(data),
sizeof(std::uint64_t), 0);
1249 std::uint64_t ireal_size =
_first.set_checkpoint_data(data, config);
1250 char* csize =
reinterpret_cast<char*
>(&ireal_size);
1251 for(std::size_t i(0) ; i <
sizeof(std::uint64_t) ; ++i)
1253 data[old_size +i] = csize[i];
1258 template<
typename OtherFirstRow_,
typename... OtherRestRows_>
1261 first().convert(source.first());
1262 rest().convert(source.rest());
1265 template<
typename OtherFirstRow_,
typename... OtherRestRows_>
1266 void copy(
const TupleMatrix<OtherFirstRow_, OtherRestRows_...>& source)
1268 first().copy(source.first());
1269 rest().copy(source.rest());
1272 template<
typename OtherFirstRow_,
typename... OtherRestRows_>
1273 void copy_to(TupleMatrix<OtherFirstRow_, OtherRestRows_...>& target)
const
1275 first().copy_to(target.first());
1276 rest().copy_to(target.rest());
1279 bool same_layout(
const TupleMatrix& other)
const
1281 return first().same_layout(
other.first()) &&
rest().same_layout(
other.rest());
1284 DataType max_rel_diff(
const TupleMatrix& other)
const
1292 template<
typename FirstRow_>
1293 class TupleMatrix<FirstRow_>
1296 template<
typename,
typename...>
1297 friend class TupleMatrix;
1300 static_assert(Intern::IsTMR_<FirstRow_>::value,
1301 "template parameter of TupleMatrix must be TupleMatrixRow<...>");
1305 static constexpr int num_blocks = 1;
1314 typedef typename FirstRow_::DataType
DataType;
1316 typedef typename FirstRow_::IndexType
IndexType;
1318 template <
typename DT2_ = DataType,
typename IT2_ = IndexType>
1319 using ContainerType = TupleMatrix<typename FirstRow_::template ContainerType<DT2_, IT2_> >;
1321 template <
typename DataType2_,
typename IndexType2_>
1325 typedef TupleVector<typename FirstRow_::VectorTypeL>
VectorTypeL;
1327 typedef typename FirstRow_::VectorTypeR
VectorTypeR;
1336 return FirstRow_::name();
1346 explicit TupleMatrix(FirstRow_&& the_first) :
1347 _first(std::forward<FirstRow_>(the_first))
1352 TupleMatrix(TupleMatrix&& other) :
1358 TupleMatrix&
operator=(TupleMatrix&& other)
1368 TupleMatrix(
const TupleMatrix&) =
delete;
1370 TupleMatrix&
operator=(
const TupleMatrix&) =
delete;
1374 return TupleMatrix(
_first.clone(mode));
1377 void init_workspace()
const
1382 void reset_workspace()
const
1384 _first.reset_workspace();
1392 void clone(
const TupleMatrix& other)
1402 const FirstRow_& first()
const
1407 template<
int i_,
int j_>
1408 typename TupleMatrixElement<i_, j_, FirstRow_>::Type&
at()
1410 static_assert(0 == i_,
"invalid sub-matrix row index");
1411 static_assert((0 <= j_) && (j_ <
num_col_blocks),
"invalid sub-matrix column index");
1412 return TupleMatrixElement<i_, j_, FirstRow_>::get(*
this);
1415 template<
int i_,
int j_>
1416 const typename TupleMatrixElement<i_, j_, FirstRow_>::Type&
at()
const
1418 static_assert(0 == i_,
"invalid sub-matrix row index");
1419 static_assert((0 <= j_) && (j_ <
num_col_blocks),
"invalid sub-matrix column index");
1420 return TupleMatrixElement<i_, j_, FirstRow_>::get(*
this);
1425 return _first.num_rows();
1430 return _first.num_cols();
1435 return _first.num_nzes();
1440 return _first.num_rows_raw();
1445 return _first.num_cols_raw();
1450 return _first.num_nzes_raw();
1453 std::size_t
bytes()
const
1458 static String
name()
1470 first().format(
value);
1475 first().format(rng, min, max);
1492 return first().create_vector_r();
1497 first().apply(r.first(), x);
1502 first().apply(r.first(), x, y.first(), alpha);
1507 first().apply_transposed(r, x.first());
1512 first().apply(r, x.first(), y, alpha);
1517 return first().row_degree(row);
1520 template<
typename IT2_>
1521 Index get_row_col_indices(
const Index row, IT2_*
const pcol_idx,
const IT2_ col_offset)
const
1523 return first().get_row_col_indices(row, pcol_idx, col_offset);
1526 template<
typename DT2_>
1527 Index get_row_values(
const Index row, DT2_ *
const pvals)
const
1529 return first().get_row_values(row, pvals);
1532 template<
typename DT2_>
1533 Index set_row_values(
const Index row,
const DT2_ *
const pvals)
1535 return first().set_row_values(row, pvals);
1541 return _first.get_checkpoint_size(config);
1547 _first.restore_from_checkpoint_data(data);
1553 return _first.set_checkpoint_data(data, config);
1556 template<
typename OtherFirstRow_>
1557 void convert(
const TupleMatrix<OtherFirstRow_>& source)
1559 first().convert(source.first());
1562 template<
typename OtherFirstRow_>
1563 void copy(
const TupleMatrix<OtherFirstRow_>& source)
1565 first().copy(source.first());
1568 template<
typename OtherFirstRow_>
1569 void copy_to(TupleMatrix<OtherFirstRow_>& target)
const
1571 first().copy_to(target.first());
1574 bool same_layout(
const TupleMatrix& other)
const
1576 return first().same_layout(
other.first());
1579 DataType max_rel_diff(
const TupleMatrix& other)
const
1581 return first().max_rel_diff(
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
Index num_nzes_raw() const
Returns the total number of non-zeros in this matrix.
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.
Index num_cols_raw() const
Returns the total number of columns in this matrix.
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.
Index num_rows_raw() const
Returns the total number of rows in 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 format()
Reset all elements of the container to a given value or zero if missing.
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
Index num_rows() const
Returns the total number of rows in this matrix.
TupleMatrix(FirstRow_ &&the_first, RestRows_ &&... the_rest)
Sub-Matrix emplacement constructor.
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
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
Index num_nzes() const
Returns the total number of non-zeros in this matrix.
TupleMatrix & operator=(const TupleMatrix &)=delete
deleted copy-assign operator
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.
Index num_cols() const
Returns the total number of columns in this matrix.
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 format()
Reset all elements of the container to a given value or zero if missing.
void clone(const TupleMatrixRow &other, CloneMode clone_mode)
Turns this matrix into a clone of other.
static constexpr int num_blocks
number of matrix columns
Index num_rows() const
Returns the total number of rows in this matrix.
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.
Index num_rows_raw() const
Returns the total number of rows in this matrix.
TupleMatrixRow & operator=(TupleMatrixRow &&other)
move-assign operator
Index num_cols() const
Returns the total number of columns in this matrix.
RestClass _rest
all remaining sub-matrices
TupleMatrixRow(TupleMatrixRow &&other)
move ctor
TupleMatrixRow(First_ &&the_first, RestClass &&the_rest)
rest-class emplacement ctor; for internal use only
Index num_nzes_raw() const
Returns the total number of non-zeros in this matrix.
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.
First_::IndexType IndexType
sub-matrix index-type
std::size_t bytes() const
Returns the total amount of bytes allocated.
TupleMatrixRow()
default CTOR
Index num_cols_raw() const
Returns the total number of columns in this matrix.
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
Index num_nzes() const
Returns the total number of non-zeros in this matrix.
TupleElement< i_, First_, Rest_... >::Type & at()
Returns a sub-matrix block.
First_::VectorTypeL VectorTypeL
Compatible L-vector type.
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
T_ max(T_ a, T_ b)
Returns the maximum of two values.
@ 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.