Medial Code Documentation
Loading...
Searching...
No Matches
NoAlias.h
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
13namespace Eigen {
14
30template<typename ExpressionType, template <typename> class StorageBase>
32{
33 public:
34 typedef typename ExpressionType::Scalar Scalar;
35
36 explicit NoAlias(ExpressionType& expression) : m_expression(expression) {}
37
38 template<typename OtherDerived>
40 EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase<OtherDerived>& other)
41 {
42 call_assignment_no_alias(m_expression, other.derived(), internal::assign_op<Scalar>());
43 return m_expression;
44 }
45
46 template<typename OtherDerived>
48 EIGEN_STRONG_INLINE ExpressionType& operator+=(const StorageBase<OtherDerived>& other)
49 {
50 call_assignment_no_alias(m_expression, other.derived(), internal::add_assign_op<Scalar>());
51 return m_expression;
52 }
53
54 template<typename OtherDerived>
56 EIGEN_STRONG_INLINE ExpressionType& operator-=(const StorageBase<OtherDerived>& other)
57 {
58 call_assignment_no_alias(m_expression, other.derived(), internal::sub_assign_op<Scalar>());
59 return m_expression;
60 }
61
63 ExpressionType& expression() const
64 {
65 return m_expression;
66 }
67
68 protected:
69 ExpressionType& m_expression;
70};
71
100template<typename Derived>
105
106} // end namespace Eigen
107
108#endif // EIGEN_NOALIAS_H
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Pseudo expression providing an operator = assuming no aliasing.
Definition NoAlias.h:32
Pseudo expression representing a solving operation.
Definition Solve.h:63
Definition AssignmentFunctors.h:42
Definition AssignmentFunctors.h:21
Definition AssignmentFunctors.h:63