Skip to content

Implementation of PELT pruning #1

@sensille

Description

@sensille

Hi,

while trying to understand active_arraylist I stumbled upon the fact that the pruning loop only removes every second element when multiple consecutive elements should be pruned. Currently the implementation is

iter = active_arrlist_endidx;
while active_arrlist(iter) > 1
    lb = active_arrlist(iter);
    if F(lb-1) + state_cell{lb, 1} > F(rb)
         active_arrlist(iter) = active_arrlist(lb);
    end
    iter = lb;
end

while it should be

iter = active_arrlist_endidx;
while active_arrlist(iter) > 1
    lb = active_arrlist(iter);
    if F(lb-1) + state_cell{lb, 1} > F(rb)
         active_arrlist(iter) = active_arrlist(lb);
    else
         iter = lb;
    end
end

Not sure if it changes the result of the calculation, but at least it wastes cycles.

What do you think?

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