As proposed on the list:

- rename EvalBeforeAssignBit to MayAliasBit
- make .lazy() remove the MayAliasBit only, and mark it as deprecated
- add a NoAlias pseudo expression, and MatrixBase::noalias() function
Todo:
- we have to decide whether += and -= assume no aliasing by default ?
- once we agree on the API: update the Sparse module and the unit tests respectively.
This commit is contained in:
Gael Guennebaud
2009-08-15 18:35:51 +02:00
parent 13a8956188
commit 50c703f0c7
14 changed files with 138 additions and 29 deletions

View File

@@ -76,8 +76,10 @@ const unsigned int EvalBeforeNestingBit = 0x2;
/** \ingroup flags
*
* means the expression should be evaluated before any assignement */
const unsigned int EvalBeforeAssigningBit = 0x4;
* Means the expression cannot be evaluated safely if the result alias one
* of the operands of the expression. Therefore it should be evaluated
* before any assignement. */
const unsigned int MayAliasBit = 0x4;
/** \ingroup flags
*
@@ -182,7 +184,7 @@ const unsigned int SparseBit = 0x1000;
// list of flags that are inherited by default
const unsigned int HereditaryBits = RowMajorBit
| EvalBeforeNestingBit
| EvalBeforeAssigningBit
| MayAliasBit
| SparseBit;
// Possible values for the Mode parameter of part()

View File

@@ -35,6 +35,7 @@ template<typename _Scalar, int _Rows, int _Cols,
int _MaxRows = _Rows, int _MaxCols = _Cols> class Matrix;
template<typename ExpressionType, unsigned int Added, unsigned int Removed> class Flagged;
template<typename ExpressionType> class NoAlias;
template<typename ExpressionType> class NestByValue;
template<typename ExpressionType> class SwapWrapper;
template<typename MatrixType> class Minor;