Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Tree::reduce function #833

Closed
jenetics opened this issue Mar 25, 2022 · 1 comment
Closed

Implement Tree::reduce function #833

jenetics opened this issue Mar 25, 2022 · 1 comment
Assignees
Milestone

Comments

@jenetics
Copy link
Owner

jenetics commented Mar 25, 2022

The Program::eval method in the io.jenetics.prog module allows to evaluate operations trees, Tree<? extends Op<T>, ?>. This concept can be generalized by a folding function in the Tree interface. The signature of the fold method could look like this:

interface Folder<U, T> {
    U fold(final T root, final List<U> children);
}
interface Tree<V, T extends Tree<V, T>> {
    <U> U reduce(final Folder<U, V> folder);
}
@jenetics jenetics added this to the v7.1.0 milestone Mar 25, 2022
@jenetics jenetics self-assigned this Mar 25, 2022
@jenetics jenetics changed the title Implement Tree::fold function Implement Tree::reduce function Mar 25, 2022
jenetics added a commit that referenced this issue Mar 25, 2022
@jenetics
Copy link
Owner Author

Merged into r7.1.0.

jenetics added a commit that referenced this issue Mar 28, 2022
jenetics added a commit that referenced this issue Mar 28, 2022
jenetics added a commit that referenced this issue Mar 28, 2022
jenetics added a commit that referenced this issue Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant