Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 2007 Michael Olbrich <michael.olbrich@gmx.net>
0005 // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
0006 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
0007 //
0008 // This Source Code Form is subject to the terms of the Mozilla
0009 // Public License v. 2.0. If a copy of the MPL was not distributed
0010 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0011 
0012 #ifndef EIGEN_ASSIGN_H
0013 #define EIGEN_ASSIGN_H
0014 
0015 namespace Eigen {
0016 
0017 template<typename Derived>
0018 template<typename OtherDerived>
0019 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>
0020   ::lazyAssign(const DenseBase<OtherDerived>& other)
0021 {
0022   enum{
0023     SameType = internal::is_same<typename Derived::Scalar,typename OtherDerived::Scalar>::value
0024   };
0025 
0026   EIGEN_STATIC_ASSERT_LVALUE(Derived)
0027   EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived)
0028   EIGEN_STATIC_ASSERT(SameType,YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
0029 
0030   eigen_assert(rows() == other.rows() && cols() == other.cols());
0031   internal::call_assignment_no_alias(derived(),other.derived());
0032   
0033   return derived();
0034 }
0035 
0036 template<typename Derived>
0037 template<typename OtherDerived>
0038 EIGEN_DEVICE_FUNC
0039 EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator=(const DenseBase<OtherDerived>& other)
0040 {
0041   internal::call_assignment(derived(), other.derived());
0042   return derived();
0043 }
0044 
0045 template<typename Derived>
0046 EIGEN_DEVICE_FUNC
0047 EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator=(const DenseBase& other)
0048 {
0049   internal::call_assignment(derived(), other.derived());
0050   return derived();
0051 }
0052 
0053 template<typename Derived>
0054 EIGEN_DEVICE_FUNC
0055 EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(const MatrixBase& other)
0056 {
0057   internal::call_assignment(derived(), other.derived());
0058   return derived();
0059 }
0060 
0061 template<typename Derived>
0062 template <typename OtherDerived>
0063 EIGEN_DEVICE_FUNC
0064 EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(const DenseBase<OtherDerived>& other)
0065 {
0066   internal::call_assignment(derived(), other.derived());
0067   return derived();
0068 }
0069 
0070 template<typename Derived>
0071 template <typename OtherDerived>
0072 EIGEN_DEVICE_FUNC
0073 EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(const EigenBase<OtherDerived>& other)
0074 {
0075   internal::call_assignment(derived(), other.derived());
0076   return derived();
0077 }
0078 
0079 template<typename Derived>
0080 template<typename OtherDerived>
0081 EIGEN_DEVICE_FUNC
0082 EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(const ReturnByValue<OtherDerived>& other)
0083 {
0084   other.derived().evalTo(derived());
0085   return derived();
0086 }
0087 
0088 } // end namespace Eigen
0089 
0090 #endif // EIGEN_ASSIGN_H