24 static constexpr
bool gpu_computable =
false;
58 template <
typename... Sizes>
69 bool alias(
const E& rhs)
const noexcept {
70 return sub.alias(rhs);
81 sub.visit(std::forward<V>(visitor));
90 sub.ensure_cpu_up_to_date();
99 sub.ensure_gpu_up_to_date();
109 return os <<
"argmax(" << transformer.sub <<
")";
118 template <
typename T>
125 static constexpr
bool gpu_computable =
false;
159 template <
typename... Sizes>
169 template <
typename E>
170 bool alias(
const E& rhs)
const noexcept {
171 return sub.alias(rhs);
180 template <
typename V>
182 sub.visit(std::forward<V>(visitor));
191 sub.ensure_cpu_up_to_date();
200 sub.ensure_gpu_up_to_date();
210 return os <<
"argmin(" << transformer.sub <<
")";
218 template <
typename T>
225 static constexpr
bool gpu_computable =
false;
259 template <
typename... Sizes>
269 template <
typename E>
270 bool alias(
const E& rhs)
const noexcept {
271 return sub.alias(rhs);
280 template <
typename V>
282 sub.visit(std::forward<V>(visitor));
291 sub.ensure_cpu_up_to_date();
300 sub.ensure_gpu_up_to_date();
310 return os <<
"sum_r(" << transformer.sub <<
")";
318 template <
typename T>
325 static constexpr
bool gpu_computable =
false;
359 template <
typename... Sizes>
369 template <
typename E>
370 bool alias(
const E& rhs)
const noexcept {
371 return sub.alias(rhs);
380 template <
typename V>
382 sub.visit(std::forward<V>(visitor));
391 sub.ensure_cpu_up_to_date();
400 sub.ensure_gpu_up_to_date();
410 return os <<
"mean_r(" << transformer.sub <<
")";
418 template <
typename T>
425 static constexpr
bool gpu_computable =
false;
445 for (
size_t i = 0; i < dim<0>(sub); ++i) {
446 m += sub[j + i * (
etl::size(sub) / dim<0>(sub))];
461 for (
size_t i = 0; i < dim<0>(sub); ++i) {
462 m += sub.read_flat(j + i * (
etl::size(sub) / dim<0>(sub)));
474 template <
typename... Sizes>
478 for (
size_t i = 0; i < dim<0>(sub); ++i) {
479 m += sub(i, j, sizes...);
490 template <
typename E>
491 bool alias(
const E& rhs)
const noexcept {
492 return sub.alias(rhs);
501 template <
typename V>
503 sub.visit(std::forward<V>(visitor));
512 sub.ensure_cpu_up_to_date();
521 sub.ensure_gpu_up_to_date();
531 return os <<
"sum_l(" << transformer.sub <<
")";
539 template <
typename T>
546 static constexpr
bool gpu_computable =
false;
566 for (
size_t i = 0; i < dim<0>(sub); ++i) {
567 m += sub[j + i * (
etl::size(sub) / dim<0>(sub))];
582 for (
size_t i = 0; i < dim<0>(sub); ++i) {
583 m += sub.read_flat(j + i * (
etl::size(sub) / dim<0>(sub)));
595 template <
typename... Sizes>
599 for (
size_t i = 0; i < dim<0>(sub); ++i) {
600 m += sub(i, j, sizes...);
611 template <
typename E>
612 bool alias(
const E& rhs)
const noexcept {
613 return sub.alias(rhs);
622 template <
typename V>
624 sub.visit(std::forward<V>(visitor));
633 sub.ensure_cpu_up_to_date();
642 sub.ensure_gpu_up_to_date();
652 return os <<
"mean_l(" << transformer.sub <<
")";
659 template <
typename T>
661 cpp::specialization_of<etl::argmax_transformer, T>
662 || cpp::specialization_of<etl::argmin_transformer, T>
663 || cpp::specialization_of<etl::sum_r_transformer, T>
664 || cpp::specialization_of<etl::mean_r_transformer, T>)
670 static constexpr
bool is_etl =
true;
672 static constexpr
bool is_view =
false;
675 static constexpr
bool is_linear =
false;
677 static constexpr
bool is_value =
false;
678 static constexpr
bool is_direct =
false;
679 static constexpr
bool is_generator =
false;
680 static constexpr
bool is_padded =
false;
681 static constexpr
bool is_aligned =
false;
683 static constexpr
bool gpu_computable =
false;
691 template <vector_mode_t V>
692 static constexpr
bool vectorizable =
false;
699 static size_t size(
const expr_t& v) {
700 return etl::dim<0>(v.sub);
709 static size_t dim(
const expr_t& v, [[maybe_unused]]
size_t d) {
710 return etl::dim<0>(v.sub);
717 static constexpr
size_t size() {
727 static constexpr
size_t dim() {
735 static constexpr
size_t dimensions() {
751 template <
typename T>
752 requires(cpp::specialization_of<etl::sum_l_transformer, T> || cpp::specialization_of<etl::mean_l_transformer, T>)
758 static constexpr
bool is_etl =
true;
760 static constexpr
bool is_view =
false;
763 static constexpr
bool is_linear =
false;
765 static constexpr
bool is_value =
false;
766 static constexpr
bool is_direct =
false;
767 static constexpr
bool is_generator =
false;
768 static constexpr
bool is_padded =
false;
769 static constexpr
bool is_aligned =
false;
771 static constexpr
bool gpu_computable =
false;
779 template <vector_mode_t V>
780 static constexpr
bool vectorizable =
false;
787 static size_t size(
const expr_t& v) {
788 return etl::size(v.sub) / etl::dim<0>(v.sub);
797 static size_t dim(
const expr_t& v,
size_t d) {
805 static constexpr
size_t size() {
815 static constexpr
size_t dim() {
823 static constexpr
size_t dimensions() {
value_t< E > mean(E &&values)
Returns the mean of all the values contained in the given expression.
Definition: expression_builder.hpp:650
constexpr int complexity([[maybe_unused]] const E &expr) noexcept
Return the complexity of the expression.
Definition: helpers.hpp:38
value_t< sub_type > value_type
The value contained in the expression.
Definition: dyn_matrix_view.hpp:31
constexpr bool is_magic_view
Traits indicating if the given ETL type is a magic view expression.
Definition: traits.hpp:311
order
Storage order of a matrix.
Definition: order.hpp:15
T sub_type
The sub type.
Definition: dyn_matrix_view.hpp:30
constexpr bool is_fast
Traits to test if the given ETL expresion type is fast (sizes known at compile-time) ...
Definition: traits.hpp:588
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
size_t max_index(E &&values)
Returns the index of the maximum element contained in the expression.
Definition: expression_builder.hpp:720
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
constexpr bool is_transformer
Traits indicating if the given ETL type is a transformer expression.
Definition: traits.hpp:297
value_t< E > sum(E &&values)
Returns the sum of all the values contained in the given expression.
Definition: expression_builder.hpp:624
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
requires(D > 0) struct dyn_base
Matrix with run-time fixed dimensions.
Definition: dyn_base.hpp:113
constexpr bool is_view
Traits indicating if the given ETL type is a view expression.
Definition: traits.hpp:304
constexpr bool is_thread_safe
Traits to test if the given ETL expresion type is thread safe.
Definition: traits.hpp:687
size_t min_index(E &&values)
Returns the index of the minimum element contained in the expression.
Definition: expression_builder.hpp:753
typename decay_traits< E >::value_type value_t
Traits to extract the value type out of an ETL type.
Definition: tmp.hpp:81