pub struct ProductManifold { /* private fields */ }Expand description
Product manifold: M = E^e × H^h × S^s
Implementations§
Source§impl ProductManifold
impl ProductManifold
Sourcepub fn new(
euclidean_dim: usize,
hyperbolic_dim: usize,
spherical_dim: usize,
) -> Self
pub fn new( euclidean_dim: usize, hyperbolic_dim: usize, spherical_dim: usize, ) -> Self
Create a new product manifold
§Arguments
euclidean_dim- Dimension of Euclidean componenthyperbolic_dim- Dimension of hyperbolic component (Poincaré ball)spherical_dim- Dimension of spherical component
Sourcepub fn from_config(config: ProductManifoldConfig) -> Self
pub fn from_config(config: ProductManifoldConfig) -> Self
Create from configuration
Sourcepub fn config(&self) -> &ProductManifoldConfig
pub fn config(&self) -> &ProductManifoldConfig
Get configuration
Sourcepub fn euclidean_component<'a>(&self, point: &'a [f64]) -> &'a [f64]
pub fn euclidean_component<'a>(&self, point: &'a [f64]) -> &'a [f64]
Extract Euclidean component from point
Sourcepub fn hyperbolic_component<'a>(&self, point: &'a [f64]) -> &'a [f64]
pub fn hyperbolic_component<'a>(&self, point: &'a [f64]) -> &'a [f64]
Extract hyperbolic component from point
Sourcepub fn spherical_component<'a>(&self, point: &'a [f64]) -> &'a [f64]
pub fn spherical_component<'a>(&self, point: &'a [f64]) -> &'a [f64]
Extract spherical component from point
Sourcepub fn project(&self, point: &[f64]) -> Result<Vec<f64>>
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
Sourcepub fn distance(&self, x: &[f64], y: &[f64]) -> Result<f64>
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)²
Sourcepub fn exp_map(&self, x: &[f64], v: &[f64]) -> Result<Vec<f64>>
pub fn exp_map(&self, x: &[f64], v: &[f64]) -> Result<Vec<f64>>
Exponential map at point x with tangent vector v
Source§impl ProductManifold
Batch operations on product manifolds
impl ProductManifold
Batch operations on product manifolds
Sourcepub fn pairwise_distances(&self, points: &[Vec<f64>]) -> Result<Vec<Vec<f64>>>
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
Sourcepub fn knn(
&self,
query: &[f64],
points: &[Vec<f64>],
k: usize,
) -> Result<Vec<(usize, f64)>>
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
Sourcepub fn geodesic(&self, x: &[f64], y: &[f64], t: f64) -> Result<Vec<f64>>
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
Sourcepub fn geodesic_path(
&self,
x: &[f64],
y: &[f64],
num_points: usize,
) -> Result<Vec<Vec<f64>>>
pub fn geodesic_path( &self, x: &[f64], y: &[f64], num_points: usize, ) -> Result<Vec<Vec<f64>>>
Sample points along geodesic
Sourcepub fn parallel_transport(
&self,
x: &[f64],
y: &[f64],
v: &[f64],
) -> Result<Vec<f64>>
pub fn parallel_transport( &self, x: &[f64], y: &[f64], v: &[f64], ) -> Result<Vec<f64>>
Parallel transport vector v from x to y
Trait Implementations§
Source§impl Clone for ProductManifold
impl Clone for ProductManifold
Source§fn clone(&self) -> ProductManifold
fn clone(&self) -> ProductManifold
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more