Skip to content

Remove unwraps in the code #661

Description

@wlwatkins

Hi,

Would it be possible to remove unwraps in the code.

I'm hitting the unwrap here and thus can catch it
argmin-0.11.0\src\solver\neldermead\mod.rs - line 329

    fn init(
        &mut self,
        problem: &mut Problem<O>,
        state: IterState<P, (), (), (), (), F>,
    ) -> Result<(IterState<P, (), (), (), (), F>, Option<KV>), Error> {
        self.params
            .iter_mut()
            .for_each(|(p, c)| *c = problem.cost(p).unwrap()); // Replace with "?"

        self.sort_param_vecs();

        Ok((
            state.param(self.params[0].0.clone()).cost(self.params[0].1),
            None,
        ))
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions