Skip to content

Rework Predicates and document intersects and nearest with cpp:function - #1430

Merged
aprokop merged 4 commits into
kokkos:masterfrom
dalg24:docs/predicates
Nov 4, 2026
Merged

aprokop merged 4 commits into
kokkos:masterfrom
dalg24:docs/predicates

Conversation

@dalg24

@dalg24 dalg24 commented Nov 3, 2026

Copy link
Copy Markdown
Member

Move intersects and nearest, together with their make_* helpers, under API-Reference/predicates/ as native cpp:function declarations, and rework the Predicates landing page. Fix the nearest signature (int k) and reference the predicates with :cpp:func: from the query pages.

Assisted-By: Claude:aws-gov.claude-sonnet-5-5

Comment on lines +54 to +57
the pages above document helper functions that generate the whole set at once,
e.g., ``ArborX::Experimental::make_intersects(geometries)``.
An equivalent ``ArborX::Experimental::make_ordered_intersects(geometries)``
exists for ordered spatial predicates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Either include make_nearest too, or drop make_ordered_intersects. Also, consider dropping ArborX:: namespace, we don't seem to use much in the documentation.

Defined in header `<ArborX_Predicates.hpp> <https://github.com/arborx/ArborX/blob/master/src/spatial/detail/ArborX_Predicates.hpp>`_

.. cpp:function:: template <typename Geometry> \
KOKKOS_INLINE_FUNCTION auto intersects(Geometry const &geometry)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This alignment is weird. What should be aligned is the rendered text.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Meaning you don't want the break line \ here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I do want to break the line, but I don't like that it renders like
Screenshot 2026-11-03 at 4 18 56 PM
instead of being flushed left.

It's not specific to this PR, so not blocking.

Comment on lines +46 to +47
.. cpp:function:: template <typename Primitives> \
auto Experimental::make_intersects(Primitives const &primitives)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same alignment issue.


This is equivalent to creating the set of predicates
``intersects(ArborX::Sphere(AccessTraits<Primitives>::get(primitives, i), r))``.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm surprised but this is correct. We don't explicitly restrict to point in the code, but it will break otherwise. Could consider using approx_expand_by_radius.

* :doc:`Predicates </API-Reference/Predicates>`
* :cpp:func:`nearest`
* :doc:`Callbacks </API-Reference/Callbacks>`
* :doc:`ArborX::BVH::query() </API-Reference/ArborX%3A%3ABoundingVolumeHierarchy%3A%3Aquery>`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why just BVH? Or why have BVH?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You mean we should just say query()?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, I wonder why we link to BVH::query at all, and not to the other queries (e.g., BruteForce), and whether we should mention it here at all.

@aprokop

aprokop commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@dalg24 What do you think of the make_* helpers in the context of #1369?

Move intersects and nearest, together with their make_* helpers, under
API-Reference/predicates/ as native cpp:function declarations, and rework
the Predicates landing page. Fix the nearest signature (int k) and
reference the predicates with :cpp:func: from the query pages.

Assisted-By: Claude:aws-gov.claude-sonnet-5-5
Signed-off-by: Damien L-G <dalg24@gmail.com>
Without a blank line before the nested list, the predicate names were
rendered inline in the preceding list item instead of as a list.

Assisted-By: Claude:aws-gov.claude-sonnet-5-5
Add the blank line before the nested list so that the predicate names
render as a list instead of inline in the preceding list item, as was
done for the current query() pages. Also separate the items of the list
in the DistributedTree page.
@aprokop

aprokop commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

OK, going to ignore alignments and #1369. It's good enough.

@aprokop
aprokop merged commit 1289086 into kokkos:master Nov 4, 2026
3 checks passed
@dalg24
dalg24 deleted the docs/predicates branch November 4, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants