ProductManifold

Struct ProductManifold 

Source
pub struct ProductManifold { /* private fields */ }
Expand description

Product manifold: M = E^e × H^h × S^s

Implementations§

Source§

impl ProductManifold

Source

pub fn new( euclidean_dim: usize, hyperbolic_dim: usize, spherical_dim: usize, ) -> Self

Create a new product manifold

§Arguments
  • euclidean_dim - Dimension of Euclidean component
  • hyperbolic_dim - Dimension of hyperbolic component (Poincaré ball)
  • spherical_dim - Dimension of spherical component
Source

pub fn from_config(config: ProductManifoldConfig) -> Self

Create from configuration

Source

pub fn config(&self) -> &ProductManifoldConfig

Get configuration

Source

pub fn dim(&self) -> usize

Total dimension

Source

pub fn euclidean_component<'a>(&self, point: &'a [f64]) -> &'a [f64]

Extract Euclidean component from point

Source

pub fn hyperbolic_component<'a>(&self, point: &'a [f64]) -> &'a [f64]

Extract hyperbolic component from point

Source

pub fn spherical_component<'a>(&self, point: &'a [f64]) -> &'a [f64]

Extract spherical component from point

Source

pub fn project(&self, point: &[f64]) -> Result<Vec<f64>>

Project point onto the product manifold

  • Euclidean: no projection needed
  • Hyperbolic: project into Poincaré ball
  • Spherical: normalize to unit sphere
Source

pub fn distance(&self, x: &[f64], y: &[f64]) -> Result<f64>

Compute distance in product manifold

d(x, y)² = w_e d_E(x_e, y_e)² + w_h d_H(x_h, y_h)² + w_s d_S(x_s, y_s)²

Source

pub fn exp_map(&self, x: &[f64], v: &[f64]) -> Result<Vec<f64>>

Exponential map at point x with tangent vector v

Source

pub fn log_map(&self, x: &[f64], y: &[f64]) -> Result<Vec<f64>>

Logarithmic map at point x toward point y

Source

pub fn frechet_mean( &self, points: &[Vec<f64>], weights: Option<&[f64]>, ) -> Result<Vec<f64>>

Compute Fréchet mean on product manifold

Source§

impl ProductManifold

Batch operations on product manifolds

Source

pub fn pairwise_distances(&self, points: &[Vec<f64>]) -> Result<Vec<Vec<f64>>>

Compute pairwise distances between all points Uses parallel computation when ‘parallel’ feature is enabled

Source

pub fn knn( &self, query: &[f64], points: &[Vec<f64>], k: usize, ) -> Result<Vec<(usize, f64)>>

Find k-nearest neighbors Uses parallel computation when ‘parallel’ feature is enabled

Source

pub fn geodesic(&self, x: &[f64], y: &[f64], t: f64) -> Result<Vec<f64>>

Geodesic interpolation between two points

Returns point at fraction t along geodesic from x to y

Source

pub fn geodesic_path( &self, x: &[f64], y: &[f64], num_points: usize, ) -> Result<Vec<Vec<f64>>>

Sample points along geodesic

Source

pub fn parallel_transport( &self, x: &[f64], y: &[f64], v: &[f64], ) -> Result<Vec<f64>>

Parallel transport vector v from x to y

Source

pub fn variance(&self, points: &[Vec<f64>], mean: Option<&[f64]>) -> Result<f64>

Compute variance of points on manifold

Source

pub fn project_gradient( &self, point: &[f64], gradient: &[f64], ) -> Result<Vec<f64>>

Project gradient to tangent space at point

For product manifolds, this projects each component appropriately

Trait Implementations§

Source§

impl Clone for ProductManifold

Source§

fn clone(&self) -> ProductManifold

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProductManifold

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V