NoAlias.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) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_NOALIAS_H
11 #define EIGEN_NOALIAS_H
12 
13 namespace Eigen {
14 
30 template<typename ExpressionType, template <typename> class StorageBase>
31 class NoAlias
32 {
33  public:
34  typedef typename ExpressionType::Scalar Scalar;
35 
37  explicit NoAlias(ExpressionType& expression) : m_expression(expression) {}
38 
39  template<typename OtherDerived>
41  EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase<OtherDerived>& other)
42  {
44  return m_expression;
45  }
46 
47  template<typename OtherDerived>
49  EIGEN_STRONG_INLINE ExpressionType& operator+=(const StorageBase<OtherDerived>& other)
50  {
52  return m_expression;
53  }
54 
55  template<typename OtherDerived>
57  EIGEN_STRONG_INLINE ExpressionType& operator-=(const StorageBase<OtherDerived>& other)
58  {
60  return m_expression;
61  }
62 
64  ExpressionType& expression() const
65  {
66  return m_expression;
67  }
68 
69  protected:
70  ExpressionType& m_expression;
71 };
72 
101 template<typename Derived>
103 {
104  return NoAlias<Derived, Eigen::MatrixBase >(derived());
105 }
106 
107 } // end namespace Eigen
108 
109 #endif // EIGEN_NOALIAS_H
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::internal::call_assignment_no_alias
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:873
Eigen::NoAlias::Scalar
ExpressionType::Scalar Scalar
Definition: NoAlias.h:34
Eigen::NoAlias
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:31
Eigen::NoAlias::NoAlias
EIGEN_DEVICE_FUNC NoAlias(ExpressionType &expression)
Definition: NoAlias.h:37
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::NoAlias::expression
EIGEN_DEVICE_FUNC ExpressionType & expression() const
Definition: NoAlias.h:64
Eigen::internal::assign_op
Definition: AssignmentFunctors.h:21
Eigen::NoAlias::operator=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ExpressionType & operator=(const StorageBase< OtherDerived > &other)
Definition: NoAlias.h:41
Eigen::internal::sub_assign_op
Definition: AssignmentFunctors.h:67
Eigen::NoAlias::m_expression
ExpressionType & m_expression
Definition: NoAlias.h:70
Eigen::NoAlias::operator+=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ExpressionType & operator+=(const StorageBase< OtherDerived > &other)
Definition: NoAlias.h:49
Eigen::internal::add_assign_op
Definition: AssignmentFunctors.h:46
Eigen::MatrixBase::noalias
NoAlias< Derived, Eigen::MatrixBase > EIGEN_DEVICE_FUNC noalias()
Definition: NoAlias.h:102
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
Eigen::NoAlias::operator-=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ExpressionType & operator-=(const StorageBase< OtherDerived > &other)
Definition: NoAlias.h:57
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:49