Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

search

Binary search of a run of queries in a sorted column: the pick of a value from a cumulative distribution, the segment of an arc length.

SpecializeOptionsMeaning
Tf32, i32the scalar the column and the queries hold
SIDElower, upperwhich boundary a query answers

lower answers the first place whose value is not below the query, upper the first place whose value is above it, and both answer the length of the column when no place qualifies. The greatest place whose value is not above a query is upper - 1; with the cumulative sums of a run of weights, upper of a draw in [0, total) is the index of the weight it lands in.

The column bound as sorted is the sorted run, every element of it. One thread per query; the dispatch size n is the number of queries.

Exact: a search reads the column and nothing else, so the same inputs give the same answers on every dispatch.

core.sample.surface picks a primitive by area with upper; attribute.normalize and geometry.shared search with lower.