Skip to content

Scalar reductions return zero instead of failing #286

Description

@trsxvz

include/MGIS/Function/Algorithms.ixx:632-634 and 655-657.

Finding. These functions return std::optional<real> and, when the evaluator fails its check, they return false;. That converts to an engaged optional holding zero, not to an empty one.

Effect. On an invalid evaluator the message is registered but the caller receives a valid result of zero. Reproduced: the optional is engaged and the failure handler does not fire, so a norm, a maximum or an integral silently yields zero.

Fix. Return an empty optional.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions