Skip to content

Commit cf2891f

Browse files
Fix compilaton errors.
1 parent 64ece41 commit cf2891f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

hill_climbing.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ namespace marxan {
195195
//
196196
void hill_climbing_two_steps(int puno, int spno, const vector<spustuff>& pu, const vector<sconnections>& connections,
197197
vector<sspecies>& spec, const vector<spu>& SM, vector<spu_out>& SM_out, vector<int>& R, double cm,
198-
scost& reserve, scost& change, double costthresh, double tpf1, double tpf2,
198+
scost& reserve, double costthresh, double tpf1, double tpf2,
199199
int clumptype, int irun, int iterations, string savename, stringstream& logBuffer, rng_engine& rngEngine)
200200
{
201201
int puvalid = 0, ipu = 0;
@@ -241,18 +241,18 @@ namespace marxan {
241241

242242
for (int i0 = 0; i0 < puvalid && itime <= iterations; i0++)
243243
{
244-
scost change0;
244+
scost change0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
245245
int ichoice0 = iimparray[i0];
246246
//remenber old score
247247
int imode0 = R[ichoice0] == 1 ? -1 : 1;
248248
computeChangeScore(-1, ichoice0, spno, puno, pu, connections, spec, SM, SM_out, R, cm, imode0, change0, reserve,
249249
costthresh, tpf1, tpf2, 1, clumptype);
250250

251-
doChange(ichoice0, puno, R, reserve, change, pu, SM, SM_out, spec, connections, imode0, clumptype, logBuffer);
251+
doChange(ichoice0, puno, R, reserve, change0, pu, SM, SM_out, spec, connections, imode0, clumptype, logBuffer);
252252

253253
for (int i1 = i0+1; i1 < puvalid && itime <= iterations; i1++, itime++)
254254
{
255-
scost change1;
255+
scost change1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
256256
int ichoice1 = iimparray[i1];
257257

258258
int imode1 = R[ichoice1] == 1 ? -1 : 1;
@@ -266,7 +266,7 @@ namespace marxan {
266266
}
267267

268268
if (fnames.saveitimptrace)
269-
import_trace_saver.append( itime, puno, reserve, change, R);
269+
import_trace_saver.append( itime, puno, reserve, change1, R);
270270

271271
} // no untested PUs left
272272
if(!was_change)

hill_climbing.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ namespace marxan {
3232
//consider two steps in a time, move if we found two steps which generates better solution
3333
void hill_climbing_two_steps(int puno, int spno, const vector<spustuff>& pu, const vector<sconnections>& connections,
3434
vector<sspecies>& spec, const vector<spu>& SM, vector<spu_out>& SM_out, vector<int>& R, double cm,
35-
scost& reserve, scost& change, double costthresh, double tpf1, double tpf2,
36-
int clumptype, int irun, int iterations, string savename, stringstream& logBuffer, rng_engine& rngEngine);
37-
35+
scost& reserve, double costthresh, double tpf1, double tpf2,
36+
int clumptype, int irun, int iterations, string savename, stringstream& logBuffer, rng_engine& rngEngine);
3837
} // namespace marxan

0 commit comments

Comments
 (0)