Eigen  5.0.1-dev+60122df6
 
Loading...
Searching...
No Matches
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
16namespace Eigen {
17
18template <typename Derived>
19EIGEN_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
26template <typename Derived>
27template <bool Enable, typename>
28EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const RealScalar& other) {
29 realView() *= other;
30 return derived();
31}
32
33template <typename Derived>
34EIGEN_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
41template <typename Derived>
42template <bool Enable, typename>
43EIGEN_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