2009-11-20 15:39:38 +01:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
|
|
|
|
// for linear algebra.
|
|
|
|
|
//
|
2010-06-24 23:21:58 +02:00
|
|
|
// Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
|
2009-11-20 15:39:38 +01:00
|
|
|
//
|
2012-07-13 14:42:47 -04:00
|
|
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
|
|
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
|
|
|
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2009-11-20 15:39:38 +01:00
|
|
|
|
|
|
|
|
#ifndef EIGEN_SELFCWISEBINARYOP_H
|
|
|
|
|
#define EIGEN_SELFCWISEBINARYOP_H
|
|
|
|
|
|
2012-04-15 11:06:28 +01:00
|
|
|
namespace Eigen {
|
|
|
|
|
|
2014-02-18 10:52:00 +01:00
|
|
|
template<typename Derived>
|
2016-02-11 09:33:32 -08:00
|
|
|
EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const Scalar& other)
|
2014-02-18 10:52:00 +01:00
|
|
|
{
|
|
|
|
|
typedef typename Derived::PlainObject PlainObject;
|
|
|
|
|
internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op<Scalar>());
|
|
|
|
|
return derived();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename Derived>
|
2016-02-11 09:33:32 -08:00
|
|
|
EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator+=(const Scalar& other)
|
2014-02-18 10:52:00 +01:00
|
|
|
{
|
|
|
|
|
typedef typename Derived::PlainObject PlainObject;
|
|
|
|
|
internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op<Scalar>());
|
|
|
|
|
return derived();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename Derived>
|
2016-02-11 09:33:32 -08:00
|
|
|
EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator-=(const Scalar& other)
|
2014-02-18 10:52:00 +01:00
|
|
|
{
|
|
|
|
|
typedef typename Derived::PlainObject PlainObject;
|
|
|
|
|
internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op<Scalar>());
|
|
|
|
|
return derived();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename Derived>
|
2016-02-11 09:33:32 -08:00
|
|
|
EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const Scalar& other)
|
2014-02-18 10:52:00 +01:00
|
|
|
{
|
|
|
|
|
typedef typename Derived::PlainObject PlainObject;
|
2014-09-14 18:27:48 +02:00
|
|
|
internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op<Scalar>());
|
2014-02-18 10:52:00 +01:00
|
|
|
return derived();
|
|
|
|
|
}
|
2010-01-05 12:46:07 +01:00
|
|
|
|
2012-04-15 11:06:28 +01:00
|
|
|
} // end namespace Eigen
|
|
|
|
|
|
2009-11-20 15:39:38 +01:00
|
|
|
#endif // EIGEN_SELFCWISEBINARYOP_H
|