Skip to content

Commit

Permalink
feat!: Remove Function and Optimizer from the prelude
Browse files Browse the repository at this point in the history
Having both Solver and Optimizer traits in the prelude, when a type
implements both, the compiler can't distinguish between them for a call
to `next` method. Given that function optimization is not the main goal
of gomez, but just a by-product, as a temporary solution
function-related traits are removed from the prelude.

However, the design of the traits should be somehow improved so that the
clash is not there at all.
  • Loading branch information
pnevyk committed May 13, 2023
1 parent 8cae4f8 commit dd6524a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/core/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use super::{
/// two required methods: [`apply`](Function::apply) and [`dim`](Problem::dim).
///
/// ```rust
/// use gomez::core::Function;
/// use gomez::nalgebra as na;
/// use gomez::prelude::*;
/// use na::{Dim, DimName, IsContiguous};
Expand Down
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,7 @@ pub use nalgebra;
/// Gomez prelude.
pub mod prelude {
pub use crate::{
core::{
Domain, Function, Optimizer, Problem, ProblemError, Solver, System, Variable,
VariableBuilder,
},
core::{Domain, Problem, ProblemError, Solver, System, Variable, VariableBuilder},
var,
};
}

0 comments on commit dd6524a

Please sign in to comment.