30 const char*
what() const noexcept
override {
31 return "Invalid assignment to a hermitian 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>
144 validate_assign(*
this, e);
148 if (e.alias(*
this)) {
183 template <etl_expr R>
190 validate_expression(*
this, rhs);
191 rhs.assign_add_to(*
this);
210 template <etl_expr R>
217 validate_expression(*
this, rhs);
218 rhs.assign_sub_to(*
this);
237 template <etl_expr R>
244 validate_expression(*
this, rhs);
245 rhs.assign_mul_to(*
this);
264 template <etl_expr R>
271 validate_expression(*
this, rhs);
272 rhs.assign_mul_to(*
this);
291 template <etl_expr R>
298 validate_expression(*
this, rhs);
299 rhs.assign_div_to(*
this);
318 template <etl_expr R>
325 validate_expression(*
this, rhs);
326 rhs.assign_mod_to(*
this);
339 return {value, i, j};
342 using base_type::operator();
348 template <
typename Matrix>
herm_detail::hermitian_reference< matrix_t > operator()(size_t i, size_t j) noexcept
Access the (i, j) element of the 2D matrix.
Definition: hermitian.hpp:338
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
void assign_to(L &&lhs) const
Assign to the given left-hand-side expression.
Definition: adapter.hpp:279
hermitian_matrix & operator/=(const value_type &rhs) noexcept
Divide each element by the right hand side scalar.
Definition: hermitian.hpp:281
Contains base class for adapters.
void assign_div_to(L &&lhs) const
Divide the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:244
hermitian_matrix & operator/=(const R &rhs)
Modulo each element by the value of the elements in the right hand side expression.
Definition: hermitian.hpp:292
void assign_mul_to(L &&lhs) const
Multiply the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:235
hermitian_matrix(value_type value) noexcept
Construct a new hermitian matrix and fill it witht the given value.
Definition: hermitian.hpp:84
typename V::template vec_type< value_type > vec_type
The vectorization type for V.
Definition: adapter.hpp:33
hermitian_matrix & operator%=(const R &rhs)
Modulo each element by the value of the elements in the right hand side expression.
Definition: hermitian.hpp:319
typename matrix_t::const_iterator iterator
The type of const iterator.
Definition: hermitian.hpp:54
order
Storage order of a matrix.
Definition: order.hpp:15
hermitian_matrix & operator*=(const R &rhs)
Multiply each element by the value of the elements in the right hand side expression.
Definition: hermitian.hpp:238
hermitian_matrix & operator*=(const value_type &rhs) noexcept
Multiply each element by the right hand side scalar.
Definition: hermitian.hpp:227
hermitian_matrix & operator-=(const value_type &rhs) noexcept
Multiply each element by the right hand side scalar.
Definition: hermitian.hpp:200
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
Traits to get information about ETL types.
Definition: tmp.hpp:68
Root namespace for the ETL library.
Definition: adapter.hpp:15
static constexpr size_t dimensions()
Return the number of dimensions of the expression.
Definition: traits_base.hpp:31
Contains hermitian matrix reference proxy implementation.
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
hermitian_matrix() noexcept
Construct a new hermitian matrix and fill it with zeros.
Definition: hermitian.hpp:73
hermitian_matrix & operator+=(const R &rhs)
Multiply each element by the value of the elements in the right hand side expression.
Definition: hermitian.hpp:184
value_type * memory_type
The memory type.
Definition: adapter.hpp:26
hermitian_matrix & operator-=(const R &rhs)
Multiply each element by the value of the elements in the right hand side expression.
Definition: hermitian.hpp:211
hermitian_matrix & operator>>=(const value_type &rhs) noexcept
Multiply each element by the right hand side scalar.
Definition: hermitian.hpp:254
A base class for adapters.
Definition: adapter.hpp:21
A proxy representing a reference to a mutable element of an hermitian matrix.
Definition: hermitian_reference.hpp:23
hermitian_matrix & operator+=(const value_type &rhs) noexcept
Multiply each element by the right hand side scalar.
Definition: hermitian.hpp:173
const char * what() const noexcept override
Returns a description of the exception.
Definition: hermitian.hpp:30
hermitian_matrix & operator=(E &&e) noexcept(false)
Assign the values of the ETL expression to the hermitian matrix.
Definition: hermitian.hpp:138
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
Exception that is thrown when an operation is made to a hermitian matrix that would render it non-her...
Definition: hermitian.hpp:26
hermitian_matrix & operator%=(const value_type &rhs) noexcept
Modulo each element by the right hand side scalar.
Definition: hermitian.hpp:308
hermitian_matrix & operator>>=(const R &rhs)
Multiply each element by the value of the elements in the right hand side expression.
Definition: hermitian.hpp:265
void assign_mod_to(L &&lhs) const
Modulo the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:253
bool is_hermitian(E &&expr)
Indicates if the given expression represents an hermitian matrix.
Definition: adapters.hpp:345
typename decay_traits< E >::value_type value_t
Traits to extract the value type out of an ETL type.
Definition: tmp.hpp:81
hermitian_matrix(size_t dim) noexcept
Construct a new hermitian matrix and fill it with zeros.
Definition: hermitian.hpp:92
A hermitian matrix adapter.
Definition: hermitian.hpp:41
hermitian_matrix(size_t dim, value_type value) noexcept
Construct a new hermitian matrix and fill it witht the given value.
Definition: hermitian.hpp:102
Traits for wrapper expressions.
Definition: wrapper_traits.hpp:21
Matrix matrix_t
The adapted matrix type.
Definition: adapter.hpp:22
typename matrix_t::const_iterator const_iterator
The type of const iterator.
Definition: hermitian.hpp:55
void assign_sub_to(L &&lhs) const
Sub from the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:226