Skip to content

Commit b41e645

Browse files
authored
Merge pull request #212 from scipopt/var-local-bounds
Variable local bounds getters
2 parents bcdcbcc + 70304b2 commit b41e645

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/variable.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ impl Variable {
5858
unsafe { ffi::SCIPvarGetUbLocal(self.raw) }
5959
}
6060

61+
/// Returns the local lower bound of the variable.
62+
pub fn lb_local(&self) -> f64 {
63+
unsafe { ffi::SCIPvarGetLbLocal(self.raw) }
64+
}
65+
66+
/// Returns the local upper bound of the variable.
67+
pub fn ub_local(&self) -> f64 {
68+
unsafe { ffi::SCIPvarGetUbLocal(self.raw) }
69+
}
70+
6171
/// Returns the type of the variable.
6272
pub fn var_type(&self) -> VarType {
6373
let var_type = unsafe { ffi::SCIPvarGetType(self.raw) };
@@ -177,7 +187,9 @@ mod tests {
177187

178188
assert_eq!(var.index(), 0);
179189
assert_eq!(var.lb(), 0.0);
190+
assert_eq!(var.lb_local(), 0.0);
180191
assert_eq!(var.ub(), 1.0);
192+
assert_eq!(var.ub_local(), 1.0);
181193
assert_eq!(var.obj(), 2.0);
182194
assert_eq!(var.name(), "x");
183195
assert_eq!(var.var_type(), VarType::ImplInt);

0 commit comments

Comments
 (0)