Skip to content

Commit

Permalink
add with_all function to model
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpMimaroglu committed Jan 7, 2025
1 parent a8112da commit f7375e1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/solvers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ pub trait SolverModel {
self
}

/// Takes a model and adds a list of constraints to it
fn with_all(mut self, constraints: impl Iterator<Item = Constraint>) -> Self
where
Self: Sized,
{
for constraint in constraints {
self.add_constraint(constraint);
}
self
}

/// Find the solution for the problem being modeled
fn solve(self) -> Result<Self::Solution, Self::Error>;

Expand Down

0 comments on commit f7375e1

Please # to comment.