mgcpp
A C++ Math Library Based on CUDA
scalar_dvec_mult.hpp
Go to the documentation of this file.
1 
2 // Copyright RedPortal, mujjingun 2017 - 2018.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef MGCPP_EXPRESSIONS_SCALAR_DVEC_MULT_EXPR_HPP
8 #define MGCPP_EXPRESSIONS_SCALAR_DVEC_MULT_EXPR_HPP
9 
10 #include <type_traits>
11 
15 
16 namespace mgcpp {
17 
18 struct scalar_dvec_mult_expr_type;
19 
20 template <typename ScalExpr, typename DVecExpr>
21 using scalar_dvec_mult_expr = binary_expr<scalar_dvec_mult_expr_type,
22  dvec_expr,
23  typename DVecExpr::result_type,
24  ScalExpr,
25  DVecExpr>;
26 
31 template <typename Scalar,
32  typename DVecExpr,
33  typename = typename std::enable_if<is_scalar<Scalar>::value>::type>
34 inline auto operator*(Scalar const& scalar,
35  dvec_expr<DVecExpr> const& exp) noexcept;
36 
41 template <typename Scalar,
42  typename DVecExpr,
43  typename = typename std::enable_if<is_scalar<Scalar>::value>::type>
44 inline auto operator*(dvec_expr<DVecExpr> const& exp,
45  Scalar const& scalar) noexcept;
46 
51 template <typename ScalExpr, typename DVecExpr>
52 inline auto operator*(scalar_expr<ScalExpr> const& scalar,
53  dvec_expr<DVecExpr> const& exp) noexcept;
54 
59 template <typename ScalExpr, typename DVecExpr>
60 inline auto operator*(dvec_expr<DVecExpr> const& exp,
61  scalar_expr<ScalExpr> const& scalar) noexcept;
62 
67 template <typename Scalar,
68  typename DVecExpr,
69  typename = typename std::enable_if<is_scalar<Scalar>::value>::type>
70 inline auto mult(Scalar const& scalar,
71  dvec_expr<DVecExpr> const& vec_exp) noexcept;
72 
77 template <typename Scalar,
78  typename DVecExpr,
79  typename = typename std::enable_if<is_scalar<Scalar>::value>::type>
80 inline auto mult(dvec_expr<DVecExpr> const& vec_exp,
81  Scalar const& scalar) noexcept;
82 
87 template <typename ScalExpr, typename DVecExpr>
88 inline auto mult(scalar_expr<ScalExpr> const& scalar,
89  dvec_expr<DVecExpr> const& vec_exp) noexcept;
90 
95 template <typename ScalExpr, typename DVecExpr>
96 inline auto mult(dvec_expr<DVecExpr> const& vec_exp,
97  scalar_expr<ScalExpr> const& scalar) noexcept;
98 } // namespace mgcpp
99 
101 #endif
Definition: adapter_base.hpp:12
dmat_dmat_mult_expr< LhsExpr, RhsExpr > mult(dmat_expr< LhsExpr > const &lhs, dmat_expr< RhsExpr > const &rhs) noexcept
generic_expr< TagType, 0, ResultExprType, ResultType, 0, LhsExpr, RhsExpr > binary_expr
Definition: generic_expr.hpp:110
Definition: dvec_expr.hpp:20
Definition: scalar_expr.hpp:18
binary_expr< scalar_dvec_mult_expr_type, dvec_expr, typename DVecExpr::result_type, ScalExpr, DVecExpr > scalar_dvec_mult_expr
Definition: scalar_dvec_mult.hpp:25
dmat_dmat_mult_expr< LhsExpr, RhsExpr > operator*(dmat_expr< LhsExpr > const &lhs, dmat_expr< RhsExpr > const &rhs) noexcept