pub struct HyperbolicRegion { /* private fields */ }Expand description
Hyperbolic region in the Poincaré disk.
A region in hyperbolic space, used for locality-sensitive hashing.
Implementations§
Source§impl HyperbolicRegion
impl HyperbolicRegion
Sourcepub fn new(center: HyperbolicPoint, radius: FixedPoint) -> Self
pub fn new(center: HyperbolicPoint, radius: FixedPoint) -> Self
Create a new hyperbolic region.
Sourcepub fn contains(
&self,
point: &HyperbolicPoint,
_poincare_disk: &PoincareDisk,
) -> bool
pub fn contains( &self, point: &HyperbolicPoint, _poincare_disk: &PoincareDisk, ) -> bool
Check if a point is contained in this region.
Compares in SQUARED-ratio proxy space: d <= radius is exactly
r²(d) <= r²(radius) (both transforms strictly monotone), and the
proxy needs one dot product against the cached center norm instead
of the exact kernel’s sqrt + atanh (~32 us -> ~1 us per check).
find_bucket walks every bucket through this on a containment miss,
which made it 86% of insert cost before the proxy.
Sourcepub fn center(&self) -> &HyperbolicPoint
pub fn center(&self) -> &HyperbolicPoint
Get the center of the region.
Sourcepub fn radius(&self) -> FixedPoint
pub fn radius(&self) -> FixedPoint
Get the radius of the region.
Sourcepub fn validation_mask(&self) -> &FixedVector
pub fn validation_mask(&self) -> &FixedVector
Get the validation mask.
Sourcepub fn quick_validate(&self, point: &HyperbolicPoint) -> bool
pub fn quick_validate(&self, point: &HyperbolicPoint) -> bool
Quick validation check against a point. Uses a generous threshold (positive similarity) as a fast heuristic.
Trait Implementations§
Source§impl Clone for HyperbolicRegion
impl Clone for HyperbolicRegion
Source§fn clone(&self) -> HyperbolicRegion
fn clone(&self) -> HyperbolicRegion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HyperbolicRegion
impl RefUnwindSafe for HyperbolicRegion
impl Send for HyperbolicRegion
impl Sync for HyperbolicRegion
impl Unpin for HyperbolicRegion
impl UnsafeUnpin for HyperbolicRegion
impl UnwindSafe for HyperbolicRegion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more