Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SolutionCallback.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.0
4 *
5 * Do not make changes to this file unless you know what you are doing - modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
8
9package com.google.ortools.sat;
10
11public class SolutionCallback {
12 private transient long swigCPtr;
13 protected transient boolean swigCMemOwn;
14
15 public SolutionCallback(long cPtr, boolean cMemoryOwn) {
16 swigCMemOwn = cMemoryOwn;
17 swigCPtr = cPtr;
18 }
19
20 public static long getCPtr(SolutionCallback obj) {
21 return (obj == null) ? 0 : obj.swigCPtr;
22 }
23
24 public static long swigRelease(SolutionCallback obj) {
25 long ptr = 0;
26 if (obj != null) {
27 if (!obj.swigCMemOwn)
28 throw new RuntimeException("Cannot release ownership as memory is not owned");
29 ptr = obj.swigCPtr;
30 obj.swigCMemOwn = false;
31 obj.delete();
32 }
33 return ptr;
34 }
35
36 @SuppressWarnings({"deprecation", "removal"})
37 protected void finalize() {
38 delete();
39 }
40
41 public synchronized void delete() {
42 if (swigCPtr != 0) {
43 if (swigCMemOwn) {
44 swigCMemOwn = false;
45 mainJNI.delete_SolutionCallback(swigCPtr);
46 }
47 swigCPtr = 0;
48 }
49 }
50
51 protected void swigDirectorDisconnect() {
52 swigCMemOwn = false;
53 delete();
54 }
55
56 public void swigReleaseOwnership() {
57 swigCMemOwn = false;
58 mainJNI.SolutionCallback_change_ownership(this, swigCPtr, false);
59 }
60
61 public void swigTakeOwnership() {
62 swigCMemOwn = true;
63 mainJNI.SolutionCallback_change_ownership(this, swigCPtr, true);
64 }
65
66 public void onSolutionCallback() {
67 mainJNI.SolutionCallback_onSolutionCallback(swigCPtr, this);
68 }
69
70 public long numBooleans() {
71 return mainJNI.SolutionCallback_numBooleans(swigCPtr, this);
72 }
73
74 public long numBranches() {
75 return mainJNI.SolutionCallback_numBranches(swigCPtr, this);
76 }
77
78 public long numConflicts() {
79 return mainJNI.SolutionCallback_numConflicts(swigCPtr, this);
80 }
81
82 public long numBinaryPropagations() {
83 return mainJNI.SolutionCallback_numBinaryPropagations(swigCPtr, this);
84 }
85
86 public long numIntegerPropagations() {
87 return mainJNI.SolutionCallback_numIntegerPropagations(swigCPtr, this);
88 }
89
90 public double wallTime() {
91 return mainJNI.SolutionCallback_wallTime(swigCPtr, this);
92 }
93
94 public double userTime() {
95 return mainJNI.SolutionCallback_userTime(swigCPtr, this);
96 }
97
98 public double objectiveValue() {
99 return mainJNI.SolutionCallback_objectiveValue(swigCPtr, this);
100 }
101
102 public double bestObjectiveBound() {
103 return mainJNI.SolutionCallback_bestObjectiveBound(swigCPtr, this);
104 }
105
106 public long solutionIntegerValue(int index) {
107 return mainJNI.SolutionCallback_solutionIntegerValue(swigCPtr, this, index);
108 }
109
110 public boolean solutionBooleanValue(int index) {
111 return mainJNI.SolutionCallback_solutionBooleanValue(swigCPtr, this, index);
112 }
113
114 public void stopSearch() {
115 mainJNI.SolutionCallback_stopSearch(swigCPtr, this);
116 }
117
119 this(mainJNI.new_SolutionCallback(), true);
120 mainJNI.SolutionCallback_director_connect(this, swigCPtr, true, true);
121 }
122
123}
SolutionCallback(long cPtr, boolean cMemoryOwn)
static long getCPtr(SolutionCallback obj)
static long swigRelease(SolutionCallback obj)