Skip to content

unrespected bounds #169

@AdrienCorenflos

Description

@AdrienCorenflos

Hi,

There is a (subtle) bug in EMD_1d: the indices i and j are allowed to reach n and m, therefore these lines have unkown behaviour (the resulting values w_i and w_j are dereferenced from the next memory slot in the machine, therefore it could be any value or even fail depending on compiler).

An easy fix would be to change the while condition to a while True and add break condiditions within the if-else branches.

w_i = u_weights[i]

w_j = v_weights[j]

I'll send a pull request if you are happy with this alternative

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions