Added at(Index) synonym for the operator[]. This allows easier matlab wrapping.

release/4.3a0
Stephen Williams 2012-06-21 17:53:45 +00:00
parent 2123938b1b
commit f5cd87129d
1 changed files with 16 additions and 6 deletions

View File

@ -86,11 +86,25 @@ public:
/// @{
/**
* Permute the given variable, i.e. determine it's new index after the
* permutation.
* Return the new index of the supplied variable after the permutation
*/
Index operator[](Index variable) const { check(variable); return rangeIndices_[variable]; }
/**
* Return the new index of the supplied variable after the permutation. This version allows modification.
*/
Index& operator[](Index variable) { check(variable); return rangeIndices_[variable]; }
/**
* Return the new index of the supplied variable after the permutation. Synonym for operator[](Index).
*/
Index at(Index variable) const { return operator[](variable); }
/**
* Return the new index of the supplied variable after the permutation. This version allows modification. Synonym for operator[](Index).
*/
Index& at(Index variable) { return operator[](variable); }
/**
* The number of variables in the range of this permutation, i.e. the output
* space.
@ -145,10 +159,6 @@ public:
/// @name Advanced Interface
/// @{
/**
* TODO: comment
*/
Index& operator[](Index variable) { check(variable); return rangeIndices_[variable]; }
/**
* A partial permutation, reorders the variables selected by selector through