9package com.google.ortools.sat;
12 private transient long swigCPtr;
21 return (obj ==
null) ? 0 : obj.swigCPtr;
28 throw new RuntimeException(
"Cannot release ownership as memory is not owned");
30 obj.swigCMemOwn =
false;
36 @SuppressWarnings({
"deprecation",
"removal"})
45 mainJNI.delete_SolveWrapper(swigCPtr);
51 public void setParameters(com.google.ortools.sat.SatParameters parameters) {
52 mainJNI.SolveWrapper_setParameters(swigCPtr,
this, parameters.toByteArray());
63 public void addLogCallback(java.util.function.Consumer<String> log_callback) {
64 mainJNI.SolveWrapper_addLogCallback(swigCPtr,
this, log_callback);
68 mainJNI.SolveWrapper_addBestBoundCallback(swigCPtr,
this, best_bound_callback);
72 byte[] buf = mainJNI.SolveWrapper_solve(swigCPtr,
this, model_proto.toByteArray());
73 if (buf ==
null || buf.length == 0) {
77 return com.google.ortools.sat.CpSolverResponse.parseFrom(buf);
78 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
79 throw new RuntimeException(
80 "Unable to parse com.google.ortools.sat.CpSolverResponse protocol message.");
85 mainJNI.SolveWrapper_stopSearch(swigCPtr,
this);
89 this(mainJNI.new_SolveWrapper(),
true);