30 const char*
what() const noexcept
override {
31 return "Invalid assignment to a symmetric matrix";
40 template <adaptable Matrix>
48 static constexpr
size_t alignment = matrix_t::alignment;
62 template <
typename V = default_vec>
65 using base_type::value;
137 template <convertible_expr<value_type> E>
146 validate_assign(*
this, e);
150 if (e.alias(*
this)) {
185 template <etl_expr R>
192 validate_expression(*
this, rhs);
193 rhs.assign_add_to(*
this);
212 template <etl_expr R>
219 validate_expression(*
this, rhs);
220 rhs.assign_sub_to(*
this);
239 template <etl_expr R>
246 validate_expression(*
this, rhs);
247 rhs.assign_mul_to(*
this);
266 template <etl_expr R>
273 validate_expression(*
this, rhs);
274 rhs.assign_mul_to(*
this);
293 template <etl_expr R>
300 validate_expression(*
this, rhs);
301 rhs.assign_div_to(*
this);
320 template <etl_expr R>
327 validate_expression(*
this, rhs);
328 rhs.assign_mod_to(*
this);
341 return {value, i, j};
344 using base_type::operator();
350 template <
typename Matrix>
symmetric_matrix & operator*=(const R &rhs)
Multiply each element by the value of the elements in the right hand side expression.
Definition: symmetric.hpp:240
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
Contains symmetric matrix reference proxy implementation.
void assign_to(L &&lhs) const
Assign to the given left-hand-side expression.
Definition: adapter.hpp:279
Contains base class for adapters.
typename matrix_t::const_iterator const_iterator
The type of const iterator.
Definition: symmetric.hpp:55
symmetric_matrix & operator=(E &&e) noexcept(false)
Assign the values of the ETL expression to the symmetric matrix.
Definition: symmetric.hpp:138
void assign_div_to(L &&lhs) const
Divide the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:244
void assign_mul_to(L &&lhs) const
Multiply the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:235
typename matrix_t::const_iterator iterator
The type of const iterator.
Definition: symmetric.hpp:54
symmetric_matrix & operator>>=(const R &rhs)
Multiply each element by the value of the elements in the right hand side expression.
Definition: symmetric.hpp:267
symmetric_matrix & operator>>=(const value_type &rhs) noexcept
Multiply each element by the right hand side scalar.
Definition: symmetric.hpp:256
const char * what() const noexcept override
Returns a description of the exception.
Definition: symmetric.hpp:30
symmetric_matrix(size_t dim, value_type value) noexcept
Construct a new sym matrix and fill it witht the given value.
Definition: symmetric.hpp:102
typename V::template vec_type< value_type > vec_type
The vectorization type for V.
Definition: adapter.hpp:33
order
Storage order of a matrix.
Definition: order.hpp:15
symmetric_matrix & operator%=(const R &rhs)
Modulo each element by the value of the elements in the right hand side expression.
Definition: symmetric.hpp:321
symmetric_matrix() noexcept
Construct a new sym matrix and fill it with zeros.
Definition: symmetric.hpp:73
const value_type * const_memory_type
The const memory type.
Definition: adapter.hpp:27
value_t< matrix_t > value_type
The value type.
Definition: adapter.hpp:25
dyn_base< this_type, T, D > base_type
The base type.
Definition: sparse.hpp:227
symmetric_matrix & operator+=(const R &rhs)
Multiply each element by the value of the elements in the right hand side expression.
Definition: symmetric.hpp:186
Traits to get information about ETL types.
Definition: tmp.hpp:68
Root namespace for the ETL library.
Definition: adapter.hpp:15
A symmetric matrix adapter.
Definition: symmetric.hpp:41
static constexpr size_t dimensions()
Return the number of dimensions of the expression.
Definition: traits_base.hpp:31
bool is_symmetric(E &&expr)
Indicates if the given expression is a symmetric matrix or not.
Definition: adapters.hpp:87
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
Exception that is thrown when an operation is made to a symmetric matrix that would render it non-sym...
Definition: symmetric.hpp:26
value_type * memory_type
The memory type.
Definition: adapter.hpp:26
symmetric_matrix & operator+=(const value_type &rhs) noexcept
Multiply each element by the right hand side scalar.
Definition: symmetric.hpp:175
symmetric_matrix & operator%=(const value_type &rhs) noexcept
Modulo each element by the right hand side scalar.
Definition: symmetric.hpp:310
A base class for adapters.
Definition: adapter.hpp:21
A proxy representing a reference to a mutable element of a symmetric matrix.
Definition: symmetric_reference.hpp:24
sym_detail::symmetric_reference< matrix_t > operator()(size_t i, size_t j) noexcept
Access the (i, j) element of the 2D matrix.
Definition: symmetric.hpp:340
symmetric_matrix & operator/=(const R &rhs)
Modulo each element by the value of the elements in the right hand side expression.
Definition: symmetric.hpp:294
Represents a scalar value.
Definition: concepts_base.hpp:19
matrix_t expr_t
The wrapped expression type.
Definition: adapter.hpp:23
etl::iterator< const this_type > const_iterator
The const iterator type.
Definition: dyn_matrix_view.hpp:37
symmetric_matrix(value_type value) noexcept
Construct a new sym matrix and fill it witht the given value.
Definition: symmetric.hpp:84
symmetric_matrix & operator-=(const value_type &rhs) noexcept
Multiply each element by the right hand side scalar.
Definition: symmetric.hpp:202
symmetric_matrix & operator-=(const R &rhs)
Multiply each element by the value of the elements in the right hand side expression.
Definition: symmetric.hpp:213
void assign_mod_to(L &&lhs) const
Modulo the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:253
symmetric_matrix & operator*=(const value_type &rhs) noexcept
Multiply each element by the right hand side scalar.
Definition: symmetric.hpp:229
symmetric_matrix(size_t dim) noexcept
Construct a new sym matrix and fill it with zeros.
Definition: symmetric.hpp:92
typename decay_traits< E >::value_type value_t
Traits to extract the value type out of an ETL type.
Definition: tmp.hpp:81
Traits for wrapper expressions.
Definition: wrapper_traits.hpp:21
Matrix matrix_t
The adapted matrix type.
Definition: adapter.hpp:22
symmetric_matrix & operator/=(const value_type &rhs) noexcept
Divide each element by the right hand side scalar.
Definition: symmetric.hpp:283
void assign_sub_to(L &&lhs) const
Sub from the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:226