fix(nbhood): make accessors const
This commit is contained in:
parent
a376921f07
commit
b96b537ed1
2 changed files with 4 additions and 4 deletions
|
|
@ -62,7 +62,7 @@ class moBinaryPartition : public EO<FitT>
|
||||||
* You are responsible for making it consistent after instantiation.
|
* You are responsible for making it consistent after instantiation.
|
||||||
*
|
*
|
||||||
* @warning If you do not fill at least the @ref rejected set,
|
* @warning If you do not fill at least the @ref rejected set,
|
||||||
* errors will be raised whe trying to @ref select or @ref reject.
|
* errors will be raised when trying to @ref select or @ref reject.
|
||||||
*/
|
*/
|
||||||
moBinaryPartition()
|
moBinaryPartition()
|
||||||
{ }
|
{ }
|
||||||
|
|
@ -127,7 +127,7 @@ class moBinaryPartition : public EO<FitT>
|
||||||
std::ostream_iterator<AtomType>(out, " ")); // Values.
|
std::ostream_iterator<AtomType>(out, " ")); // Values.
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Convenience function to only render the fitess and the selected atoms (and not the rejected ones).
|
//! Convenience function to only render the fitness and the selected atoms (and not the rejected ones).
|
||||||
std::string str() const
|
std::string str() const
|
||||||
{
|
{
|
||||||
std::ostringstream msg;
|
std::ostringstream msg;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class moBinaryPartitionSwapNeighborhood : public moNeighborhood<moBinaryPartitio
|
||||||
using AtomType = typename EOT::AtomType;
|
using AtomType = typename EOT::AtomType;
|
||||||
|
|
||||||
/** Get the currently pointed selected atom. */
|
/** Get the currently pointed selected atom. */
|
||||||
AtomType selected(EOT& from, const size_t i_select) {
|
AtomType selected(EOT& from, const size_t i_select) const {
|
||||||
typename EOT::ContainerType::iterator
|
typename EOT::ContainerType::iterator
|
||||||
it = std::begin(from.rejected);
|
it = std::begin(from.rejected);
|
||||||
std::advance(it, i_select);
|
std::advance(it, i_select);
|
||||||
|
|
@ -39,7 +39,7 @@ class moBinaryPartitionSwapNeighborhood : public moNeighborhood<moBinaryPartitio
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the currently pointed rejected atom. */
|
/** Get the currently pointed rejected atom. */
|
||||||
AtomType rejected(EOT& from, const size_t j_reject) {
|
AtomType rejected(EOT& from, const size_t j_reject) const {
|
||||||
typename EOT::ContainerType::iterator
|
typename EOT::ContainerType::iterator
|
||||||
it = std::begin(from.selected);
|
it = std::begin(from.selected);
|
||||||
std::advance(it, j_reject);
|
std::advance(it, j_reject);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue