Assign.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2007 Michael Olbrich <michael.olbrich@gmx.net>
5 // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
6 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
7 //
8 // This Source Code Form is subject to the terms of the Mozilla
9 // Public License v. 2.0. If a copy of the MPL was not distributed
10 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 
12 #ifndef EIGEN_ASSIGN_H
13 #define EIGEN_ASSIGN_H
14 
15 // IWYU pragma: private
16 #include "./InternalHeaderCheck.h"
17 
18 namespace Eigen {
19 
20 template <typename Derived>
21 template <typename OtherDerived>
24 
26  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived, OtherDerived)
28  SameType,
29  YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
30 
31  eigen_assert(rows() == other.rows() && cols() == other.cols());
32  internal::call_assignment_no_alias(derived(), other.derived());
33 
34  return derived();
35 }
36 
37 template <typename Derived>
38 template <typename OtherDerived>
40  internal::call_assignment(derived(), other.derived());
41  return derived();
42 }
43 
44 template <typename Derived>
46  internal::call_assignment(derived(), other.derived());
47  return derived();
48 }
49 
50 template <typename Derived>
52  internal::call_assignment(derived(), other.derived());
53  return derived();
54 }
55 
56 template <typename Derived>
57 template <typename OtherDerived>
59  internal::call_assignment(derived(), other.derived());
60  return derived();
61 }
62 
63 template <typename Derived>
64 template <typename OtherDerived>
66  internal::call_assignment(derived(), other.derived());
67  return derived();
68 }
69 
70 template <typename Derived>
71 template <typename OtherDerived>
73  const ReturnByValue<OtherDerived>& other) {
74  other.derived().evalTo(derived());
75  return derived();
76 }
77 
78 } // end namespace Eigen
79 
80 #endif // EIGEN_ASSIGN_H
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition: StaticAssert.h:87
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
#define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition: StaticAssert.h:79
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:44
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const DenseBase< OtherDerived > &other)
Definition: Assign.h:39
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC Derived & lazyAssign(const DenseBase< OtherDerived > &other)
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const MatrixBase &other)
Definition: Assign.h:51
Definition: ReturnByValue.h:50
EIGEN_DEVICE_FUNC void evalTo(Dest &dst) const
Definition: ReturnByValue.h:58
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition: AssignEvaluator.h:781
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:812
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
Definition: EigenBase.h:33
constexpr EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:49
Definition: Meta.h:205