CONOPT
Loading...
Searching...
No Matches
Constraint.java
Go to the documentation of this file.
1
4
5/* ----------------------------------------------------------------------------
6 * This file was automatically generated by SWIG (https://www.swig.org).
7 * Version 4.3.1
8 *
9 * Do not make changes to this file unless you know what you are doing - modify
10 * the SWIG interface file instead.
11 * ----------------------------------------------------------------------------- */
12
13package jconopt;
14
25public class Constraint {
26 private transient long swigCPtr;
27 protected transient boolean swigCMemOwn;
28
29 protected Constraint(long cPtr, boolean cMemoryOwn) {
30 swigCMemOwn = cMemoryOwn;
31 swigCPtr = cPtr;
32 }
33
34 protected static long getCPtr(Constraint obj) {
35 return (obj == null) ? 0 : obj.swigCPtr;
36 }
37
38 protected static long swigRelease(Constraint obj) {
39 long ptr = 0;
40 if (obj != null) {
41 if (!obj.swigCMemOwn)
42 throw new RuntimeException("Cannot release ownership as memory is not owned");
43 ptr = obj.swigCPtr;
44 obj.swigCMemOwn = false;
45 obj.delete();
46 }
47 return ptr;
48 }
49
50 @SuppressWarnings({"deprecation", "removal"})
51 protected void finalize() {
52 delete();
53 }
54
55 public synchronized void delete() {
56 if (swigCPtr != 0) {
57 if (swigCMemOwn) {
58 swigCMemOwn = false;
60 }
61 swigCPtr = 0;
62 }
63 }
64
65 public Constraint(int idx, ConstraintType type, double bound, int slackstat) {
66 this(jconoptJNI.new_Constraint(idx, type.swigValue(), bound, slackstat), true);
67 }
68
72 public void setIndex(int value) {
73 jconoptJNI.Constraint_index_set(swigCPtr, this, value);
74 }
75
79 public int getIndex() {
80 return jconoptJNI.Constraint_index_get(swigCPtr, this);
81 }
82
86 public void setConstype(ConstraintType value) {
87 jconoptJNI.Constraint_constype_set(swigCPtr, this, value.swigValue());
88 }
89
96
100 public void setRhs(double value) {
101 jconoptJNI.Constraint_rhs_set(swigCPtr, this, value);
102 }
103
107 public double getRhs() {
108 return jconoptJNI.Constraint_rhs_get(swigCPtr, this);
109 }
110
114 public void setSlackstatus(int value) {
115 jconoptJNI.Constraint_slackstatus_set(swigCPtr, this, value);
116 }
117
121 public int getSlackstatus() {
122 return jconoptJNI.Constraint_slackstatus_get(swigCPtr, this);
123 }
124
125}
static ConstraintType swigToEnum(int swigValue)
static long getCPtr(Constraint obj)
void setSlackstatus(int value)
synchronized void delete()
Constraint(int idx, ConstraintType type, double bound, int slackstat)
void setRhs(double value)
transient boolean swigCMemOwn
void setIndex(int value)
Constraint(long cPtr, boolean cMemoryOwn)
ConstraintType getConstype()
static long swigRelease(Constraint obj)
void setConstype(ConstraintType value)
static final native int Constraint_slackstatus_get(long jarg1, Constraint jarg1_)
static final native int Constraint_constype_get(long jarg1, Constraint jarg1_)
static final native void delete_Constraint(long jarg1)
static final native void Constraint_rhs_set(long jarg1, Constraint jarg1_, double jarg2)
static final native int Constraint_index_get(long jarg1, Constraint jarg1_)
static final native double Constraint_rhs_get(long jarg1, Constraint jarg1_)
static final native void Constraint_constype_set(long jarg1, Constraint jarg1_, int jarg2)
static final native void Constraint_slackstatus_set(long jarg1, Constraint jarg1_, int jarg2)
static final native long new_Constraint(int jarg1, int jarg2, double jarg3, int jarg4)
static final native void Constraint_index_set(long jarg1, Constraint jarg1_, int jarg2)