File indexing completed on 2025-01-18 09:56:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
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 }
0089
0090 #endif