Lines Matching full:aliasing
3 /** \page TopicAliasing Aliasing
5 In Eigen, aliasing refers to assignment statement in which the same matrix (or array or vector) appears on the
7 mat.transpose();</tt> exhibit aliasing. The aliasing in the first example is harmless, but the aliasing in the
8 second example leads to unexpected results. This page explains what aliasing is, when it is harmful, and what
21 Here is a simple example exhibiting aliasing:
36 This assignment exhibits aliasing: the coefficient \c mat(1,1) appears both in the block
51 Note that if \c mat were a bigger, then the blocks would not overlap, and there would be no aliasing
52 problem. This means that in general aliasing cannot be detected at compile time. However, Eigen does detect
53 some instances of aliasing, albeit at run time. The following example exhibiting aliasing was mentioned in
65 Again, the output shows the aliasing issue. However, by default Eigen uses a run-time assertion to detect this
72 && "aliasing detected during tranposition, use transposeInPlace() or evaluate the rhs into a temporary using .eval()"' failed.
75 The user can turn Eigen's run-time assertions like the one to detect this aliasing problem off by defining the
77 aliasing problem. See \ref TopicAssertions for more information about Eigen's run-time assertions.
80 \section TopicAliasingSolution Resolving aliasing issues
82 If you understand the cause of the aliasing issue, then it is obvious what must happen to solve it: Eigen has
129 \section TopicAliasingCwise Aliasing and component-wise operations
153 \section TopicAliasingMatrixMult Aliasing and matrix multiplication
155 Matrix multiplication is the only operation in Eigen that assumes aliasing by default. Thus, if \c matA is a
157 there are no aliasing problems, either because the result is assigned to a different matrix or because it is a
176 aliasing, as follows: <tt>matB.noalias() = matA * matA</tt>. This allows Eigen to evaluate the matrix product
188 Of course, you should not use \c noalias() when there is in fact aliasing taking place. If you do, then you
203 Aliasing occurs when the same matrix or array coefficients appear both on the left- and the right-hand side of
205 - Aliasing is harmless with coefficient-wise computations; this includes scalar multiplication and matrix or
207 - When you multiply two matrices, Eigen assumes that aliasing occurs. If you know that there is no aliasing,
209 - In all other situations, Eigen assumes that there is no aliasing issue and thus gives the wrong result if
210 aliasing does in fact occur. To prevent this, you have to use \link DenseBase::eval() eval() \endlink or