Skip to content

Immutable Convergency #9

@JP-Ellis

Description

@JP-Ellis

I've noticed that the root finding algorithms all take a mutable reference to the Convergency trait, which seems odd. In particular, I was hoping to have a const Convergency set for a module, but this is impossible to achieve because it must be mutable.

Are there any use case for a mutable convergency test other than in DebugConvergency? I would have thought that if DebugConvergency is the only reason why this is used, would it not be better to make it internally mutable through a RwLock (or similar)? As that is for debugging, the extra overhead should not be too much of a concern.

In fact, would it be better if the functions to use an associated type instead of &mut dyn Convergency? This would allow for mutable cases as well as immutable cases. I've created a small gist that shows what I mean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions