Medial Code Documentation
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
13namespace Eigen {
14
15template<typename Derived>
16inline Derived& DenseBase<Derived>::operator*=(const Scalar& other)
17{
18 typedef typename Derived::PlainObject PlainObject;
19 internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op<Scalar>());
20 return derived();
21}
22
23template<typename Derived>
24inline Derived& ArrayBase<Derived>::operator+=(const Scalar& other)
25{
26 typedef typename Derived::PlainObject PlainObject;
27 internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op<Scalar>());
28 return derived();
29}
30
31template<typename Derived>
32inline Derived& ArrayBase<Derived>::operator-=(const Scalar& other)
33{
34 typedef typename Derived::PlainObject PlainObject;
35 internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op<Scalar>());
36 return derived();
37}
38
39template<typename Derived>
40inline Derived& DenseBase<Derived>::operator/=(const Scalar& other)
41{
42 typedef typename Derived::PlainObject PlainObject;
43 internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op<Scalar>());
44 return derived();
45}
46
47} // end namespace Eigen
48
49#endif // EIGEN_SELFCWISEBINARYOP_H