alphaville / optimization-engine

Nonconvex embedded optimization: code generation for fast real-time optimization + ROS support
https://alphaville.github.io/optimization-engine/
Other
499 stars 53 forks source link

Design consideration: move tolerance into the optimizer #77

Closed alphaville closed 5 years ago

alphaville commented 5 years ago

Currently we store the tolerance in the cache, but it seems to me that storing it in the optimizer would make more sense. For example, we have a setter method in panoc_optimizer which is as follows:

pub fn with_tolerance(
        mut self,
        tolerance: f64,
    ) -> Self {
        assert!(tolerance > 0.0, "tolerance must be larger than 0");
        self.panoc_engine.cache.tolerance = tolerance;
        self
    }

and it sets the tolerance in the cache object.

I am currently addressing issue #70 where we will need to introduce another tolerance value (namely, the akkt_tolerance). I think it makes more sense to have these tolerances be part of the optimizer.

alphaville commented 5 years ago

Never mind - I realised why we did it like this.