optimization_engine/constraints/no_constraints.rs
1use super::Constraint;
2
3/// The whole space, no constraints
4#[derive(Default, Clone, Copy)]
5pub struct NoConstraints {}
6
7impl NoConstraints {
8 /// Constructs new instance of `NoConstraints`
9 ///
10 pub fn new() -> NoConstraints {
11 NoConstraints {}
12 }
13}
14
15impl Constraint for NoConstraints {
16 fn project(&self, _x: &mut [f64]) {}
17
18 fn is_convex(&self) -> bool {
19 true
20 }
21}