$darkmode
Eigen  5.0.1-dev
SelfCwiseBinaryOp.h
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_SELFCWISEBINARYOP_H
11 #define EIGEN_SELFCWISEBINARYOP_H
12 
13 // IWYU pragma: private
14 #include "./InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
18 template <typename Derived>
19 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const Scalar& other) {
20  using ConstantExpr = typename internal::plain_constant_type<Derived, Scalar>::type;
21  using Op = internal::mul_assign_op<Scalar>;
22  internal::call_assignment(derived(), ConstantExpr(rows(), cols(), other), Op());
23  return derived();
24 }
25 
26 template <typename Derived>
27 template <bool Enable, typename>
28 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const RealScalar& other) {
29  realView() *= other;
30  return derived();
31 }
32 
33 template <typename Derived>
34 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const Scalar& other) {
35  using ConstantExpr = typename internal::plain_constant_type<Derived, Scalar>::type;
36  using Op = internal::div_assign_op<Scalar>;
37  internal::call_assignment(derived(), ConstantExpr(rows(), cols(), other), Op());
38  return derived();
39 }
40 
41 template <typename Derived>
42 template <bool Enable, typename>
43 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const RealScalar& other) {
44  realView() /= other;
45  return derived();
46 }
47 
48 } // end namespace Eigen
49 
50 #endif // EIGEN_SELFCWISEBINARYOP_H
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1