Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
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 <[email protected]>
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
18// TODO generalize the scalar type of 'other'
19
20template <typename Derived>
21EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const Scalar& other) {
22 internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
23 internal::mul_assign_op<Scalar, Scalar>());
24 return derived();
25}
26
27template <typename Derived>
28EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator+=(const Scalar& other) {
29 internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
30 internal::add_assign_op<Scalar, Scalar>());
31 return derived();
32}
33
34template <typename Derived>
35EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator-=(const Scalar& other) {
36 internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
37 internal::sub_assign_op<Scalar, Scalar>());
38 return derived();
39}
40
41template <typename Derived>
42EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const Scalar& other) {
43 internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
44 internal::div_assign_op<Scalar, Scalar>());
45 return derived();
46}
47
48} // end namespace Eigen
49
50#endif // EIGEN_SELFCWISEBINARYOP_H
Namespace containing all symbols from the Eigen library.
Definition Core:137