From 9f5b0849ce0925bc19f964b169e90d50fc07b6f7 Mon Sep 17 00:00:00 2001 From: Charlie Vanaret Date: Tue, 15 Oct 2024 12:58:23 +0200 Subject: [PATCH] AMPLModel: fixed type of error flags --- bindings/AMPL/AMPLModel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/AMPL/AMPLModel.cpp b/bindings/AMPL/AMPLModel.cpp index b29b2d4f..e6d9801e 100644 --- a/bindings/AMPL/AMPLModel.cpp +++ b/bindings/AMPL/AMPLModel.cpp @@ -106,7 +106,7 @@ namespace uno { } double AMPLModel::evaluate_objective(const Vector& x) const { - int error_flag = 0; + fint error_flag = 0; double result = this->objective_sign * (*(this->asl)->p.Objval)(this->asl, 0, const_cast(x.data()), &error_flag); if (0 < error_flag) { throw FunctionEvaluationError(); @@ -116,7 +116,7 @@ namespace uno { // sparse gradient void AMPLModel::evaluate_objective_gradient(const Vector& x, SparseVector& gradient) const { - int error_flag = 0; + fint error_flag = 0; // prevent ASL to crash by catching all evaluation errors Jmp_buf err_jmp_uno; asl->i.err_jmp_ = &err_jmp_uno; @@ -143,7 +143,7 @@ namespace uno { /* double AMPLModel::evaluate_constraint(int j, const std::vector& x) const { - int error_flag = 0; + fint error_flag = 0; double result = (*(this->asl)->p.Conival)(this->asl_, j, const_cast(x.data()), &error_flag); if (0 < error_flag) { throw FunctionNumericalError(); @@ -153,7 +153,7 @@ namespace uno { */ void AMPLModel::evaluate_constraints(const Vector& x, std::vector& constraints) const { - int error_flag = 0; + fint error_flag = 0; (*(this->asl)->p.Conval)(this->asl, const_cast(x.data()), constraints.data(), &error_flag); if (0 < error_flag) { throw FunctionEvaluationError(); @@ -163,7 +163,7 @@ namespace uno { // sparse gradient void AMPLModel::evaluate_constraint_gradient(const Vector& x, size_t constraint_index, SparseVector& gradient) const { // compute the AMPL sparse gradient - int error_flag = 0; + fint error_flag = 0; (*(this->asl)->p.Congrd)(this->asl, static_cast(constraint_index), const_cast(x.data()), const_cast(this->asl_gradient.data()), &error_flag); if (0 < error_flag) {