Skip to content

Commit 5a9d442

Browse files
committed
update dependencies
1 parent eae4626 commit 5a9d442

5 files changed

Lines changed: 16 additions & 12 deletions

File tree

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "good_lp"
3-
version = "1.13.0"
3+
version = "1.14.0"
44
authors = ["Ophir LOJKINE <contact@ophir.dev>"]
55
edition = "2018"
66
repository = "https://github.com/rust-or/good_lp"
@@ -40,18 +40,18 @@ minilp = [
4040
coin_cbc = { version = "0.1", optional = true, default-features = false }
4141
microlp = { version = "0.2.11", optional = true }
4242
lpsolve = { version = "0.1", optional = true }
43-
highs = { version = "1.8.0", optional = true }
44-
russcip = { version = "0.7.1", optional = true }
43+
highs = { version = "1.11.0", optional = true }
44+
russcip = { version = "0.8.2", optional = true }
4545
lp-solvers = { version = "1.0.0", features = ["cplex"], optional = true }
4646
cplex-rs = { version = "0.1", optional = true }
47-
clarabel = { version = "0.10.0", optional = true, features = [] }
47+
clarabel = { version = "0.11.0", optional = true, features = [] }
4848
fnv = "1.0.5"
4949

5050
[dev-dependencies]
5151
float_eq = "1.0"
5252

5353
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
54-
criterion = "0.5"
54+
criterion = "0.6"
5555

5656
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
5757
wasm-bindgen-test = "0.3.0"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ fn main() -> Result<(), Box<dyn Error>> {
1616
vars:
1717
a <= 1;
1818
2 <= b <= 4;
19-
} // variables can also be added dynamically
19+
} // variables can also be added dynamically with ProblemVariables::add
2020
let solution = vars.maximise(10 * (a - b / 5) - b)
21-
.using(default_solver) // multiple solvers available
21+
.using(default_solver) // IBM's coin_cbc by default
2222
.with(constraint!(a + 2 <= b))
23-
.with(constraint!(1 + a >= 4 - b))
23+
.with(constraint!(1 + a >= 4 - b)) // .with_all(iter) is also available
2424
.solve()?;
2525
println!("a={} b={}", solution.value(a), solution.value(b));
2626
println!("a + b = {}", solution.eval(a + b));

src/solvers/clarabel.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ impl ClarabelProblem {
7676
}
7777

7878
/// Convert the problem into a clarabel solver
79+
/// panics if the problem is not valid
7980
pub fn into_solver(self) -> DefaultSolver<f64> {
8081
let settings = self.settings.build().expect("Invalid clarabel settings");
8182
let quadratic_objective = &CscMatrix::zeros((self.variables, self.variables));
@@ -90,7 +91,7 @@ impl ClarabelProblem {
9091
constraint_values,
9192
cones,
9293
settings,
93-
)
94+
).expect("Invalid clarabel problem. This is likely a bug in good_lp. Problems should always have coherent dimensions.")
9495
}
9596
}
9697

@@ -117,6 +118,7 @@ impl SolverModel for ClarabelProblem {
117118
SolverStatus::MaxTime => Err(ResolutionError::Other("Time limit reached")),
118119
SolverStatus::NumericalError => Err(ResolutionError::Other("Numerical error")),
119120
SolverStatus::InsufficientProgress => Err(ResolutionError::Other("No progress")),
121+
SolverStatus::CallbackTerminated => Err(ResolutionError::Other("Callback terminated")),
120122
}
121123
}
122124

@@ -180,7 +182,7 @@ impl<'a> SolutionWithDual<'a> for ClarabelSolution {
180182
}
181183
}
182184

183-
impl<'a> DualValues for &'a ClarabelSolution {
185+
impl DualValues for &ClarabelSolution {
184186
fn dual(&self, constraint: ConstraintReference) -> f64 {
185187
self.solution.z[constraint.index]
186188
}

src/solvers/highs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ impl Solution for HighsSolution {
382382
}
383383
}
384384

385-
impl<'a> DualValues for &'a HighsSolution {
385+
impl DualValues for &HighsSolution {
386386
fn dual(&self, constraint: ConstraintReference) -> f64 {
387387
self.solution.dual_rows()[constraint.index]
388388
}

tests/variables.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use good_lp::{constraint, default_solver, variables, Expression, Solution, SolverModel};
1+
use good_lp::{variables, Expression};
22

33
#[cfg(target_arch = "wasm32")]
44
use wasm_bindgen_test::*;
@@ -47,6 +47,8 @@ fn debug_format() {
4747
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
4848
#[cfg(not(feature = "clarabel"))]
4949
fn variables_macro_integer() {
50+
use good_lp::{constraint, default_solver, variables, Solution, SolverModel};
51+
5052
variables! {
5153
vars:
5254
a <= 1;

0 commit comments

Comments
 (0)