VCCC  2024.05
VisualCamp Common C++ library
matrix_proxy_nocopy.hpp
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2020/03/02.
3 # */
4 #
5 # ifndef VCCC_MATH_MATRIX_MATRIX_PROXY_NOCOPY_HPP
6 # define VCCC_MATH_MATRIX_MATRIX_PROXY_NOCOPY_HPP
7 #
10 
11 namespace vccc {
12 
13 namespace internal {
14 namespace math {
15 
16 template<typename ExprType>
17 struct traits<MatrixProxyNocopy<ExprType>> {
18  enum : int {
19  rows = traits<ExprType>::rows,
20  cols = traits<ExprType>::cols,
21  size = rows * cols,
22  };
23 
24  enum : int {
25  option = Flag::kDefault | Flag::kReferenceUnsafe
26  };
27  using value_type = typename traits<ExprType>::value_type;
28 };
29 
30 } // namespace math
31 } // namespace internal
32 
33 template<typename ExprType>
34 class MatrixProxyNocopy : public MatrixBase<MatrixProxyNocopy<ExprType>> {
35  public:
36  static_assert(internal::math::is_concrete_matrix<ExprType>::value, "Only Concrete Matrix type is allowed");
37 
38  explicit MatrixProxyNocopy(ExprType& expr) : expr(expr) {}
39 
43  return *this;
44  }
45 
46  private:
47  ExprType& expr;
48 };
49 
50 } // namespace vccc
51 
52 # endif // VCCC_MATH_MATRIX_MATRIX_PROXY_NOCOPY_HPP
static void assignNocopy(const MatrixBase< ExprType > &expr, MatrixBase< DstType > &dst)
Definition: matrix_assigner.hpp:32
Definition: matrix_base.hpp:20
Definition: matrix_proxy_nocopy.hpp:34
MatrixProxyNocopy & operator=(const MatrixBase< E > &rhs) &&
Definition: matrix_proxy_nocopy.hpp:41
MatrixProxyNocopy(ExprType &expr)
Definition: matrix_proxy_nocopy.hpp:38
Definition: directory.h:12
constexpr auto size(const C &c) -> decltype(c.size())
Definition: size.hpp:16
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35