Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
CpSatHelper.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
11import com.google.ortools.util.Domain;
12
13public class CpSatHelper {
14 private transient long swigCPtr;
15 protected transient boolean swigCMemOwn;
16
17 public CpSatHelper(long cPtr, boolean cMemoryOwn) {
18 swigCMemOwn = cMemoryOwn;
19 swigCPtr = cPtr;
20 }
21
22 public static long getCPtr(CpSatHelper obj) {
23 return (obj == null) ? 0 : obj.swigCPtr;
24 }
25
26 public static long swigRelease(CpSatHelper obj) {
27 long ptr = 0;
28 if (obj != null) {
29 if (!obj.swigCMemOwn)
30 throw new RuntimeException("Cannot release ownership as memory is not owned");
31 ptr = obj.swigCPtr;
32 obj.swigCMemOwn = false;
33 obj.delete();
34 }
35 return ptr;
36 }
37
38 @SuppressWarnings({"deprecation", "removal"})
39 protected void finalize() {
40 delete();
41 }
42
43 public synchronized void delete() {
44 if (swigCPtr != 0) {
45 if (swigCMemOwn) {
46 swigCMemOwn = false;
47 mainJNI.delete_CpSatHelper(swigCPtr);
48 }
49 swigCPtr = 0;
50 }
51 }
52
53 public static String modelStats(com.google.ortools.sat.CpModelProto model_proto) {
54 return mainJNI.CpSatHelper_modelStats(model_proto.toByteArray());
55 }
56
57 public static String solverResponseStats(com.google.ortools.sat.CpSolverResponse response) {
58 return mainJNI.CpSatHelper_solverResponseStats(response.toByteArray());
59 }
60
61 public static String validateModel(com.google.ortools.sat.CpModelProto model_proto) {
62 return mainJNI.CpSatHelper_validateModel(model_proto.toByteArray());
63 }
64
65 public static Domain variableDomain(com.google.ortools.sat.IntegerVariableProto variable_proto) {
66 return new Domain(mainJNI.CpSatHelper_variableDomain(variable_proto.toByteArray()), true);
67 }
68
69 public static boolean writeModelToFile(com.google.ortools.sat.CpModelProto model_proto, String filename) {
70 return mainJNI.CpSatHelper_writeModelToFile(model_proto.toByteArray(), filename);
71 }
72
73 public CpSatHelper() {
74 this(mainJNI.new_CpSatHelper(), true);
75 }
76
77}
static long swigRelease(CpSatHelper obj)
static String validateModel(com.google.ortools.sat.CpModelProto model_proto)
static String solverResponseStats(com.google.ortools.sat.CpSolverResponse response)
static long getCPtr(CpSatHelper obj)
CpSatHelper(long cPtr, boolean cMemoryOwn)
static boolean writeModelToFile(com.google.ortools.sat.CpModelProto model_proto, String filename)
static String modelStats(com.google.ortools.sat.CpModelProto model_proto)
static Domain variableDomain(com.google.ortools.sat.IntegerVariableProto variable_proto)