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 byte[] buf = mainJNI.SolveWrapper_solve(swigCPtr,
this, model_proto.toByteArray());
69 if (buf ==
null || buf.length == 0) {
73 return com.google.ortools.sat.CpSolverResponse.parseFrom(buf);
74 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
75 throw new RuntimeException(
76 "Unable to parse com.google.ortools.sat.CpSolverResponse protocol message.");
81 mainJNI.SolveWrapper_stopSearch(swigCPtr,
this);
85 this(mainJNI.new_SolveWrapper(),
true);