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

Generalization to 3D #96

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Conversation

amboschman
Copy link
Collaborator

Selection of polytope type (lines 105-109) is now done via a conditional statement: is there a more elegant way to do this?

end
end
bounds = [(xmin[i], xmax[i]) for i in 1:D]
point_iterator = Iterators.product([bounds[i] for i in 1:D]...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't you just use here Iterators.product(bounds...) ?

bounds = [(xmin[i], xmax[i]) for i in 1:D]
point_iterator = Iterators.product([bounds[i] for i in 1:D]...)
bounding_box_node_coords[bounding_box_node_ids[agg]] =
reduce(vcat,[Point(p...) for p in point_iterator])
Copy link
Member

@amartinhuertas amartinhuertas Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a less memory hungry version of

reduce(vcat,[Point(p...) for p in point_iterator])

would be to use

reshape([Point(p...) for p in point_iterator],2^D)

Again ... not a big deal ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks!

Copy link
Member

@amartinhuertas amartinhuertas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @amboschman ... great work! Just minor comments for improvement (mainly so that we also get familiarized with the workflow).

implemented suggested changes (by Alberto on Generalization to 3D #96)
Copy link
Member

@amartinhuertas amartinhuertas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@amartinhuertas amartinhuertas merged commit 07c174e into bulk_penalty_stab Sep 2, 2024
8 checks passed
@amboschman amboschman deleted the bulk_penalty_stab3D branch September 2, 2024 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants