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);
52 this(mainJNI.new_SolveWrapper(),
true);
55 public void setParameters(com.google.ortools.sat.SatParameters parameters) {
56 mainJNI.SolveWrapper_setParameters(swigCPtr,
this, parameters.toByteArray());
67 public void addLogCallback(java.util.function.Consumer<String> log_callback) {
68 mainJNI.SolveWrapper_addLogCallback(swigCPtr,
this, log_callback);
72 mainJNI.SolveWrapper_addBestBoundCallback(swigCPtr,
this, best_bound_callback);
76 byte[] buf = mainJNI.SolveWrapper_solve(swigCPtr,
this, model_proto.toByteArray());
77 if (buf ==
null || buf.length == 0) {
81 return com.google.ortools.sat.CpSolverResponse.parseFrom(buf);
82 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
83 throw new RuntimeException(
84 "Unable to parse com.google.ortools.sat.CpSolverResponse protocol message.");
89 mainJNI.SolveWrapper_stopSearch(swigCPtr,
this);