fix test_xpress_interface.cc
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#include "ortools/linear_solver/xpress_interface.cc"
|
||||
|
||||
#include <fstream>
|
||||
#include <locale>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
#include "ortools/xpress/environment.h"
|
||||
#define XPRS_NAMELENGTH 1028
|
||||
|
||||
namespace operations_research {
|
||||
@@ -239,13 +239,13 @@ namespace operations_research {
|
||||
if (should_throw_) {
|
||||
throw std::runtime_error("This is a mocked exception in MyMPCallback");
|
||||
}
|
||||
XpressMPCallbackContext* context_ = static_cast<XpressMPCallbackContext*>(callback_context);
|
||||
//XpressMPCallbackContext* context_ = static_cast<XpressMPCallbackContext*>(callback_context);
|
||||
++nSolutions_;
|
||||
EXPECT_TRUE(context_->CanQueryVariableValues());
|
||||
EXPECT_EQ(context_->Event(), MPCallbackEvent::kMipSolution);
|
||||
EXPECT_TRUE(callback_context->CanQueryVariableValues());
|
||||
EXPECT_EQ(callback_context->Event(), MPCallbackEvent::kMipSolution);
|
||||
last_variable_values_.resize(mpSolver_->NumVariables(), 0.0);
|
||||
for (int i = 0 ; i < mpSolver_->NumVariables(); i++) {
|
||||
last_variable_values_[i] = context_->VariableValue(mpSolver_->variable(i));
|
||||
last_variable_values_[i] = callback_context->VariableValue(mpSolver_->variable(i));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
#define XPRS_INTEGER 'I'
|
||||
#define XPRS_CONTINUOUS 'C'
|
||||
#define XPRS_NAMES_ROW 1
|
||||
#define XPRS_NAMES_COLUMN 2
|
||||
|
||||
// The argument to this macro is the invocation of a XPRS function that
|
||||
// returns a status. If the function returns non-zero the macro aborts
|
||||
|
||||
@@ -82,6 +82,12 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath);
|
||||
#define XPRS_TYPE_INT64 2
|
||||
#define XPRS_TYPE_DOUBLE 3
|
||||
#define XPRS_TYPE_STRING 4
|
||||
/***************************************************************************\
|
||||
* values related to NAMESPACES *
|
||||
\***************************************************************************/
|
||||
#define XPRS_NAMES_ROW 1
|
||||
#define XPRS_NAMES_COLUMN 2
|
||||
|
||||
|
||||
#define XPRS_PLUSINFINITY 1.0e+20
|
||||
#define XPRS_MINUSINFINITY -1.0e+20
|
||||
|
||||
@@ -93,7 +93,7 @@ class XpressHeaderParser(object):
|
||||
"XPRS_ROWS", "XPRS_SIMPLEXITER", "XPRS_LPSTATUS", "XPRS_MIPSTATUS", "XPRS_NODES",
|
||||
"XPRS_COLS", "XPRS_LP_OPTIMAL", "XPRS_LP_INFEAS", "XPRS_LP_UNBOUNDED",
|
||||
"XPRS_MIP_SOLUTION", "XPRS_MIP_INFEAS", "XPRS_MIP_OPTIMAL", "XPRS_MIP_UNBOUNDED",
|
||||
"XPRS_OBJ_MINIMIZE", "XPRS_OBJ_MAXIMIZE"}
|
||||
"XPRS_OBJ_MINIMIZE", "XPRS_OBJ_MAXIMIZE", "XPRS_NAMES_ROW", "XPRS_NAMES_COLUMN"}
|
||||
self.__missing_required_defines = self.__required_defines
|
||||
# These enum will detect control parameters that will all be imported
|
||||
self.__doc_section = XprsDocumentSection.OTHER
|
||||
|
||||
Reference in New Issue
Block a user