Sync java SWIG with g3

This commit is contained in:
Corentin Le Molgat
2019-02-12 17:16:25 +01:00
parent 04ef816be7
commit 18d21667e1
2 changed files with 7 additions and 3 deletions

View File

@@ -123,6 +123,7 @@ PROTECT_FROM_FAILURE(Solver::Fail(), arg1);
%{
#include <setjmp.h>
#include <vector>
#include "ortools/base/integral_types.h"
#include "ortools/constraint_solver/constraint_solver.h"
#include "ortools/constraint_solver/constraint_solveri.h"
@@ -656,8 +657,7 @@ import java.util.function.LongConsumer;
// see https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html
import java.lang.Runnable;
%}
// Keep reference to FunctionalInterface to avoid GC to collect them early
// note: SWUG does not support multiple %typemap(javacode) Type, so we have to
// note: SWIG does not support multiple %typemap(javacode) Type, so we have to
// define all Solver tweak here (ed and not in the macro DEFINE_CALLBACK_*)
%typemap(javacode) Solver %{
/** This exceptions signal that a failure has been raised in the C++ world. */
@@ -1377,6 +1377,7 @@ import java.util.function.LongConsumer;
%}
%ignore IntVarLocalSearchFilter::FindIndex;
%ignore IntVarLocalSearchFilter::IsVarSynced;
%rename (addVars) IntVarLocalSearchFilter::AddVars; // Inherited.
%rename (injectObjectiveValue) IntVarLocalSearchFilter::InjectObjectiveValue;
%rename (isIncremental) IntVarLocalSearchFilter::IsIncremental;
@@ -1503,6 +1504,8 @@ namespace operations_research {
} // namespace operations_research
// Wrap cp includes
// TODO(user): Use ignoreall/unignoreall for this one. A lot of work.
//swiglint: disable include-h-allglobals
%include "ortools/constraint_solver/constraint_solver.h"
%include "ortools/constraint_solver/constraint_solveri.h"
%include "ortools/constraint_solver/java/javawrapcp_util.h"

View File

@@ -48,7 +48,6 @@ DEFINE_INDEX_TYPE_TYPEDEF(
operations_research::RoutingVehicleClassIndex,
operations_research::RoutingModel::VehicleClassIndex);
namespace operations_research {
// RoutingModel
// Map transit callback to Java @FunctionalInterface types.
@@ -78,6 +77,7 @@ import java.util.function.LongUnaryOperator;
$self->AddMatrixDimension(values, capacity, fix_start_cumul_to_zero, name);
}
}
%rename (activeVar) RoutingModel::ActiveVar;
%rename (addAllActive) RoutingModel::AddAllActive;
%rename (addAtSolutionCallback) RoutingModel::AddAtSolutionCallback;
@@ -216,6 +216,7 @@ import java.util.function.LongUnaryOperator;
// see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
import java.util.function.LongBinaryOperator;
%}
%rename (cumulVar) RoutingDimension::CumulVar;
%rename (fixedTransitVar) RoutingDimension::FixedTransitVar;
%rename (getBreakIntervalsOfVehicle) RoutingDimension::GetBreakIntervalsOfVehicle;