Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mmghannam committed Jan 9, 2025
1 parent 2aec2d4 commit a7044b4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
9 changes: 8 additions & 1 deletion src/branchrule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,14 @@ mod tests {
.include_default_plugins()
.read_prob("data/test/gen-ip054.mps")
.unwrap()
.include_branch_rule("FirstChoosingBranchingRule", "", 100000, 1000, 1., Box::new(br));
.include_branch_rule(
"FirstChoosingBranchingRule",
"",
100000,
1000,
1.,
Box::new(br),
);

let solved = model.solve();
assert_eq!(solved.status(), Status::NodeLimit);
Expand Down
6 changes: 5 additions & 1 deletion src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ impl Node {

#[cfg(test)]
mod tests {
use crate::{branchrule::{BranchRule, BranchingResult}, model::Model, SCIPBranchRule, Solving};
use crate::{
branchrule::{BranchRule, BranchingResult},
model::Model,
SCIPBranchRule, Solving,
};

struct NodeDataBranchRule;

Expand Down
10 changes: 6 additions & 4 deletions src/scip.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use crate::branchrule::{BranchRule, BranchingCandidate};
use crate::pricer::{Pricer, PricerResultState};
use crate::{ffi, scip_call_panic, BranchingResult, Constraint, Event, Eventhdlr, HeurResult, Model, Node, ObjSense, ParamSetting, Retcode, Row, SCIPBranchRule, SCIPEventhdlr, SCIPPricer, SCIPSeparator, Separator, Solution, Solving, Status, VarType, Variable};
use crate::{
ffi, scip_call_panic, BranchingResult, Constraint, Event, Eventhdlr, HeurResult, Model, Node,
ObjSense, ParamSetting, Retcode, Row, SCIPBranchRule, SCIPEventhdlr, SCIPPricer, SCIPSeparator,
Separator, Solution, Solving, Status, VarType, Variable,
};
use crate::{scip_call, HeurTiming, Heuristic};
use core::panic;
use scip_sys::{SCIP_Cons, SCIP_Var, Scip, SCIP_SOL};
Expand Down Expand Up @@ -696,9 +700,7 @@ impl ScipPtr {
scip: Rc::new(scip_ptr),
state: Solving,
};
let branchrule = SCIPBranchRule {
raw: branchrule,
};
let branchrule = SCIPBranchRule { raw: branchrule };
let branching_res = unsafe { (*rule_ptr).execute(model, branchrule, cands) };

if let BranchingResult::BranchOn(cand) = branching_res.clone() {
Expand Down

0 comments on commit a7044b4

Please sign in to comment.