resizeIndices
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2184 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
8280cf082b
commit
de587618e2
1 changed files with 4 additions and 12 deletions
|
|
@ -58,7 +58,7 @@ public:
|
|||
*/
|
||||
|
||||
~moIndexSwapNeighbor() {
|
||||
delete[] (indices);
|
||||
//delete[] (indices);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -93,7 +93,6 @@ public:
|
|||
virtual moIndexSwapNeighbor<EOT> & operator=(
|
||||
const moIndexSwapNeighbor<EOT> & _source) {
|
||||
moIndexNeighbor<EOT, Fitness>::operator=(_source);
|
||||
this->key = _source.key;
|
||||
this->Kswap = _source.Kswap;
|
||||
this->reSizeIndices(Kswap);
|
||||
for (unsigned int i = 0; i <= Kswap; i++)
|
||||
|
|
@ -133,16 +132,9 @@ public:
|
|||
*/
|
||||
|
||||
void setIndices(unsigned int * _indices) {
|
||||
for (unsigned int i = 0; i <= Kswap; i++)
|
||||
for (unsigned int i = 0; i <= Kswap; i++){
|
||||
setIndice(i, _indices[i]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the set of k-swap indexes
|
||||
*/
|
||||
|
||||
unsigned int * getIndices() {
|
||||
return indices;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -185,7 +177,7 @@ public:
|
|||
*/
|
||||
|
||||
void reSizeIndices(unsigned int _Kswap) {
|
||||
delete[] (indices);
|
||||
delete [] (indices);
|
||||
indices = new unsigned int[_Kswap + 1];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue