i have write this code, but i have many errors. I will try to figuer out what's goin on. If any time you are online and see it, say to me what u see wrong!! As you see below i have mess a little up things.Here u are:
Code:
Solution* selected_columns;
Solution* n_covered;
Solution* is_covered;
double k[5000];
while (!aSol -> is_complete()) {
for (int i = 0; i < instance -> n_cols ; i++) {
if(aSol -> is_added[i]){
k[i] = -1;}
else{
for (int j = 0; j < (instance->covers)[i].size(); j++) {
int aRow = (instance->covers)[i][j];
if (!aSol -> is_covered[aRow]) {
n_covered++;
}
}
k[i] = ((instance->covers[i].size()) - (instance -> covered_by[j][i].size()))/(instance -> cost[i]);
}
}
aSol -> add_column(GetMax(k,instance->n_cols));
}
random_shuffle (aSol -> selected_columns.begin(), aSol -> selected_columns.end() );
erase ( aSol -> selected_columns.size() / 2 );
i get 2 errors(also for erase,but this will look after) for the line
Code:
k[i] = ((instance->covers[i].size()) - (instance -> covered_by[j][i].size()))/(instance -> cost[i]);
1) request for member 'size' ......
2)name lookup of 'j' changed for new ISO 'for' scoping
and one error for the line
Code:
for (int j = 0; j < (instance->covers)[i].size(); j++) {
1)using obsolete binding at 'j'
Maybe i didn't understand that well.Also i don't know what do these errors mean.. :-(