diff --git a/nl-writer2/include/mp/nl-model.h b/nl-writer2/include/mp/nl-model.h index 5c3783ae3..aa013608e 100644 --- a/nl-writer2/include/mp/nl-model.h +++ b/nl-writer2/include/mp/nl-model.h @@ -69,7 +69,8 @@ class NLModel { /// Add linear objective (only single objective supported.) /// Sense: NLW2_ObjSenseM.... /// Coefficients: dense vector. - void SetLinearObjective(int sense, double c0, const double* c) + void SetLinearObjective(int sense, double c0, + const double* c = nullptr) { obj_sense_=sense; obj_c0_=c0; obj_c_=c; } /// Add Q for the objective quadratic part 0.5 @ x.T @ Q @ x. diff --git a/nl-writer2/src/nl-solver.cc b/nl-writer2/src/nl-solver.cc index e7ae48eb9..9644686db 100644 --- a/nl-writer2/src/nl-solver.cc +++ b/nl-writer2/src/nl-solver.cc @@ -83,7 +83,7 @@ class NLFeeder2_Easy auto c = NLME().ObjCoefficients(); for (int j=0; j