Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:56:17

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
0005 //
0006 // This Source Code Form is subject to the terms of the Mozilla
0007 // Public License v. 2.0. If a copy of the MPL was not distributed
0008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0009 
0010 #ifndef EIGEN_SELFCWISEBINARYOP_H
0011 #define EIGEN_SELFCWISEBINARYOP_H
0012 
0013 namespace Eigen { 
0014 
0015 // TODO generalize the scalar type of 'other'
0016 
0017 template<typename Derived>
0018 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const Scalar& other)
0019 {
0020   internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op<Scalar,Scalar>());
0021   return derived();
0022 }
0023 
0024 template<typename Derived>
0025 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator+=(const Scalar& other)
0026 {
0027   internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op<Scalar,Scalar>());
0028   return derived();
0029 }
0030 
0031 template<typename Derived>
0032 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator-=(const Scalar& other)
0033 {
0034   internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op<Scalar,Scalar>());
0035   return derived();
0036 }
0037 
0038 template<typename Derived>
0039 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const Scalar& other)
0040 {
0041   internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op<Scalar,Scalar>());
0042   return derived();
0043 }
0044 
0045 } // end namespace Eigen
0046 
0047 #endif // EIGEN_SELFCWISEBINARYOP_H