9 #ifndef BC_EXPRESSION_TEMPLATES_EXPRESSION_UNARY_H_ 10 #define BC_EXPRESSION_TEMPLATES_EXPRESSION_UNARY_H_ 18 template<
class Operation,
class ArrayType>
20 Expression_Base<Un_Op<Operation, ArrayType>>,
23 using return_type = decltype(std::declval<Operation>()(
24 std::declval<typename ArrayType::value_type>()));
36 return static_cast<const Operation&
>(*this);
40 Un_Op(ArrayType v,
const args&... args_):
46 return Operation::operator()(
array(index...));
51 return Operation::operator()(array[index]);
56 return Operation::operator()(
array(index...));
61 return Operation::operator()(array[index]);
72 template<
class Operation,
class Expression>
BCHOT 73 auto make_un_expr(Expression expression, Operation operation=Operation()) {
#define BCINLINE
Definition: common.h:96
BCINLINE bc::size_t dim(int i) const
Definition: expression_unary.h:68
BCHOT auto make_un_expr(Expression expression, Operation operation=Operation())
Definition: expression_unary.h:73
BCINLINE const Operation & get_operation() const
Definition: expression_unary.h:35
std::decay_t< return_type > value_type
Definition: expression_unary.h:26
decltype(std::declval< Operation >()(std::declval< typename ArrayType::value_type >())) return_type
Definition: expression_unary.h:24
BCINLINE Un_Op(ArrayType v, const args &... args_)
Definition: expression_unary.h:40
BCINLINE const auto inner_shape() const
Definition: expression_unary.h:64
BCINLINE value_type operator()(integers... index) const
Definition: expression_unary.h:45
BCINLINE bc::size_t rows() const
Definition: expression_unary.h:66
BCINLINE value_type operator[](int index) const
Definition: expression_unary.h:50
ArrayType array
Definition: expression_unary.h:32
int size_t
Definition: common.h:283
static constexpr int tensor_iterator_dim
Definition: expression_unary.h:30
static constexpr int tensor_dim
Definition: expression_unary.h:29
typename ArrayType::system_tag system_tag
Definition: expression_unary.h:27
BCINLINE bc::size_t cols() const
Definition: expression_unary.h:67
BCINLINE bc::size_t size() const
Definition: expression_unary.h:65
#define BCHOT
Definition: common.h:97
Definition: expression_template_traits.h:19
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22