26 template <
typename T, order SO,
size_t D>
31 iterable<custom_dyn_matrix_impl<T, SO, D>, SO == order::RowMajor>,
45 using iterator = std::conditional_t<SO == order::RowMajor, value_type*, etl::iterator<this_type>>;
46 using const_iterator = std::conditional_t<SO == order::RowMajor, const value_type*, etl::iterator<const this_type>>;
51 template <
typename V = default_vec>
55 using base_type::_dimensions;
57 using base_type::_size;
59 using base_type::check_invariants;
63 using base_type::memory_end;
64 using base_type::memory_start;
84 rhs._memory =
nullptr;
98 template <
typename... S>
112 _dimensions = rhs._dimensions;
132 _dimensions = std::move(rhs._dimensions);
136 rhs._memory =
nullptr;
149 template <etl_expr E>
151 validate_assign(*
this, e);
155 if (e.alias(*
this)) {
182 template <std_container Container>
184 validate_assign(*
this, vec);
186 std::copy(vec.begin(), vec.end(),
begin());
220 template <
typename Y>
230 template <
typename Y>
242 swap(_size, other._size);
243 swap(_dimensions, other._dimensions);
259 template <
typename V = default_vec>
270 template <
typename V = default_vec>
281 template <
typename V = default_vec>
292 template <
typename V = default_vec>
303 template <
typename V = default_vec>
314 template <
typename L>
323 template <
typename L>
332 template <
typename L>
341 template <
typename L>
350 template <
typename L>
359 template <
typename L>
380 return os <<
"CV[" << mat.size() <<
"]";
383 os <<
"CM[" << mat.dim(0);
385 for (
size_t i = 1; i <
D; ++i) {
386 os <<
"," << mat.dim(i);
393 static_assert(std::is_nothrow_move_constructible_v<
dyn_vector<double>>,
"dyn_vector should be nothrow move constructible");
394 static_assert(std::is_nothrow_move_assignable_v<
dyn_vector<double>>,
"dyn_vector should be nothrow move assignable");
395 static_assert(std::is_nothrow_destructible_v<
dyn_vector<double>>,
"dyn_vector should be nothrow destructible");
402 template <
typename T, order SO,
size_t D>
T value_type
The value type.
Definition: custom_dyn.hpp:40
custom_dyn_matrix_impl(const custom_dyn_matrix_impl &rhs) noexcept
Copy construct a custom_dyn_matrix_impl.
Definition: custom_dyn.hpp:74
const value_type * const_memory_type
The const memory type.
Definition: custom_dyn.hpp:43
CRTP class to inject iterators functions.
Definition: iterable.hpp:23
void assign_add_to(L &&lhs) const
Add to the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:217
static constexpr size_t n_dimensions
The number of dimensions.
Definition: custom_dyn.hpp:33
Dense Matrix with run-time fixed dimensions. The matrix support an arbitrary number of dimensions...
Definition: dyn_base.hpp:294
void std_assign_evaluate(Expr &&expr, Result &&result)
Evaluation of the expr into result.
Definition: evaluator.hpp:1176
typename V::template vec_type< T > vec_type
The vectorization type for V.
Definition: custom_dyn.hpp:52
std::conditional_t< SO==order::RowMajor, value_type *, etl::iterator< this_type > > iterator
The iterator type.
Definition: custom_dyn.hpp:45
void assign_div_to(L &&lhs) const
Divide the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:244
value_t< sub_type > value_type
The value contained in the expression.
Definition: dyn_matrix_view.hpp:31
void assign_mul_to(L &&lhs) const
Multiply the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:235
void assign_to(L &&lhs) const
Assign to the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:208
D D
The number of dimensions.
Definition: dyn_matrix_view.hpp:24
Standard memory utilities.
order
Storage order of a matrix.
Definition: order.hpp:15
typename V::template vec_type< value_type > vec_type
The vectorization type for V.
Definition: dyn_matrix_view.hpp:43
CRTP class to inject functions testing values of the expressions.
Definition: value_testable.hpp:26
auto end() noexcept
Return an iterator to the past-the-end element of the matrix.
Definition: iterable.hpp:59
static constexpr order storage_order
The storage order.
Definition: custom_dyn.hpp:34
std::array< size_t, n_dimensions > dimension_storage_impl
The type used to store the dimensions.
Definition: custom_dyn.hpp:41
auto load(size_t x) const noexcept
Load several elements of the expression at once.
Definition: dyn_matrix_view.hpp:143
Traits to get information about ETL types.
Definition: tmp.hpp:68
Root namespace for the ETL library.
Definition: adapter.hpp:15
void invalidate_gpu() const noexcept
Invalidates the GPU memory.
Definition: sub_view.hpp:695
auto dim(E &&value, size_t i) -> detail::identity_helper< E, dim_view< detail::build_identity_type< E >, D >>
Return a view representing the ith Dth dimension.
Definition: view_expression_builder.hpp:25
CRTP class to inject functions creating new expressions.
Definition: expression_able.hpp:23
void store(vec_type< V > in, size_t i) noexcept
Store several elements in the matrix at once.
Definition: dyn_matrix_view.hpp:176
void stream(vec_type< V > in, size_t i) noexcept
Store several elements in the matrix at once, using non-temporal store.
Definition: dyn_matrix_view.hpp:165
std::ostream & operator<<(std::ostream &os, const etl::complex< T > &c)
Outputs a textual representation of the complex number in the given stream.
Definition: complex.hpp:576
Visitor to perform local evaluation when necessary.
Definition: eval_visitors.hpp:23
static constexpr size_t alignment
The memory alignment.
Definition: custom_dyn.hpp:35
void storeu(vec_type< V > in, size_t i) noexcept
Store several elements in the matrix at once.
Definition: dyn_matrix_view.hpp:187
value_type * memory_type
The memory type.
Definition: custom_dyn.hpp:42
CRTP class to inject inplace operations to matrix and vector structures.
Definition: inplace_assignable.hpp:26
void std_mod_evaluate(Expr &&expr, Result &&result)
Compound modulo evaluation of the expr into result.
Definition: evaluator.hpp:1271
auto begin() noexcept
Return an iterator to the first element of the matrix.
Definition: iterable.hpp:46
Matrix with run-time fixed dimensions.
Definition: dyn.hpp:26
void direct_fill(E &&mat, V value)
Fill the given ETL value class with the given value.
Definition: direct_fill.hpp:25
std::conditional_t< SO==order::RowMajor, const value_type *, etl::iterator< const this_type > > const_iterator
The const iterator type.
Definition: custom_dyn.hpp:46
void std_mul_evaluate(Expr &&expr, Result &&result)
Compound multiply evaluation of the expr into result.
Definition: evaluator.hpp:1233
void swap(custom_dyn_matrix_impl< T, SO, D > &lhs, custom_dyn_matrix_impl< T, SO, D > &rhs)
Swap two dyn matrix.
Definition: custom_dyn.hpp:403
auto loadu(size_t x) const noexcept
Load several elements of the expression at once.
Definition: dyn_matrix_view.hpp:154
Base class and utilities for dyn matrix implementations.
void visit(detail::evaluator_visitor &visitor) const
Apply the given visitor to this expression and its descendants.
Definition: dyn_matrix_view.hpp:263
requires(D > 0) struct dyn_base
Matrix with run-time fixed dimensions.
Definition: dyn_base.hpp:113
void ensure_gpu_up_to_date() const
Copy back from the GPU to the expression memory if necessary.
Definition: dyn_matrix_view.hpp:280
Matrix with run-time fixed dimensions.
Definition: custom_dyn.hpp:27
void std_sub_evaluate(Expr &&expr, Result &&result)
Compound subtract evaluation of the expr into result.
Definition: evaluator.hpp:1214
void assign_mod_to(L &&lhs) const
Modulo the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:253
dense_dyn_base< custom_dyn_matrix_impl< T, SO, D >, T, SO, D > base_type
The base type.
Definition: custom_dyn.hpp:39
const auto & gpu_compute_hint([[maybe_unused]] Y &y) const
Return a GPU computed version of this expression.
Definition: sub_view.hpp:653
typename decay_traits< E >::value_type value_t
Traits to extract the value type out of an ETL type.
Definition: tmp.hpp:81
void std_div_evaluate(Expr &&expr, Result &&result)
Compound divide evaluation of the expr into result.
Definition: evaluator.hpp:1252
custom_dyn_matrix_impl(custom_dyn_matrix_impl &&rhs) noexcept
Move construct a matrix.
Definition: custom_dyn.hpp:82
void validate_cpu() const noexcept
Validates the CPU memory.
Definition: sub_view.hpp:702
void std_add_evaluate(Expr &&expr, Result &&result)
Compound add evaluation of the expr into result.
Definition: evaluator.hpp:1195
value_type *ETL_RESTRICT _memory
Pointer to the allocated memory.
Definition: dyn_base.hpp:312
CRTP class to inject functions testing the dimensions.
Definition: dim_testable.hpp:45
void assign_sub_to(L &&lhs) const
Sub from the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:226