Skip to content

Commit

Permalink
Minor dimension fix in SLSQP.
Browse files Browse the repository at this point in the history
  • Loading branch information
kylc committed Feb 5, 2024
1 parent 1d26d28 commit 2cb8b63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/slsqp-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl SlsqpSolver {
toldx: -1.0,

f: 0.0,
g: vec![0.0; n],
g: vec![0.0; n1],

init: false,
}
Expand Down Expand Up @@ -138,7 +138,7 @@ impl SlsqpSolver {
}

if self.mode == -1 || !self.init {
gradient(x, &mut self.g);
gradient(x, &mut self.g[0..self.n as usize]);
}

unsafe {
Expand Down

0 comments on commit 2cb8b63

Please sign in to comment.