9 #ifndef BLACKCAT_TENSOR_BASE_H_ 10 #define BLACKCAT_TENSOR_BASE_H_ 23 template<
class ExpressionTemplate>
33 using expression_type = ExpressionTemplate;
49 using parent_type::parent_type;
50 using parent_type::expression_template;
61 using tensor_move_type =
64 using tensor_copy_type =
76 parent_type(std::move(tensor.as_expression_type())) {}
79 this->as_expression_type() = std::move(tensor.as_expression_type());
89 template<class ValueType, class=std::enable_if_t<std::is_convertible<ValueType, value_type>::value && tensor_dim==0>>
99 #include "tensor_utility.h" 109 expression_type& as_expression_type() {
110 return static_cast<expression_type&
>(*this);
112 const expression_type& as_expression_type()
const {
113 return static_cast<const expression_type&
>(*this);
typename traits_type::is_move_constructible move_constructible
Definition: tensor_base.h:44
typename traits_type::is_move_assignable move_assignable
Definition: tensor_base.h:46
bc::traits::conditional_detected_t< detail::query_move_assignable, T, std::true_type > is_move_assignable
Definition: expression_template_traits.h:100
#define BC_ITERATOR_DEF(suffix, iterator_name, begin_func, end_func)
Definition: tensor_iterator_defs.h:22
self_type & fill(value_type value)
Definition: tensor_base.h:2
Tensor_Base(ValueType scalar)
Definition: tensor_base.h:90
typename traits_type::is_move_constructible copy_constructible
Definition: tensor_base.h:45
Definition: tensor_base.h:97
auto bi_expr(Functor func, const Xpr &rv) const
Definition: expression_base.h:116
conditional_t< x, T, detail::DISABLE< T > > only_if
Definition: type_traits.h:23
typename ValueType ::value_type value_type
Definition: expression_base.h:36
bc::traits::conditional_detected_t< detail::query_copy_assignable, T, std::true_type > is_copy_assignable
Definition: expression_template_traits.h:103
auto rend() const
Definition: tensor_base.h:95
static constexpr int tensor_dim
Definition: expression_base.h:33
Tensor_Base & operator=(tensor_move_type tensor) noexcept
Definition: tensor_base.h:78
Tensor_Base(const Tensor_Base< U > &tensor)
Definition: tensor_base.h:69
typename ValueType ::system_tag system_tag
Definition: expression_base.h:37
bc::traits::conditional_detected_t< detail::query_move_constructible, T, std::true_type > is_move_constructible
Definition: expression_template_traits.h:94
Tensor_Base(expression_type &¶m)
Definition: tensor_base.h:57
Tensor_Base(tensor_move_type tensor)
Definition: tensor_base.h:75
Definition: expression_template_traits.h:76
#define BC_FORWARD_ITER(suffix, iter, access)
Definition: tensor_iterator_defs.h:2
void assert_valid(const Expression_Base< Xpr > &tensor) const
Definition: expression_base.h:126
std::conditional_t< ExpressionTemplate::tensor_dim==0, Scalar_Accessor, Tensor_Accessor_Base< ExpressionTemplate::tensor_dim, Tensor_Base< ExpressionTemplate > >> Tensor_Accessor
Definition: tensor_accessor.h:42
auto rbegin() const
Definition: tensor_base.h:94
static constexpr int tensor_iterator_dim
Definition: tensor_base.h:39
static constexpr int tensor_dim
Definition: tensor_base.h:38
auto end() const
Definition: tensor_base.h:95
Tensor_Base(tensor_copy_type tensor)
Definition: tensor_base.h:72
typename traits_type::is_copy_assignable copy_assignable
Definition: tensor_base.h:47
Tensor_Base(const expression_type ¶m)
Definition: tensor_base.h:56
Definition: tensor_base.h:96
~Tensor_Base()
Definition: tensor_base.h:104
static constexpr int tensor_iterator_dim
Definition: expression_base.h:34
auto begin() const
Definition: tensor_base.h:94
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22
Tensor_Base()
Definition: tensor_base.h:55