Skip to main content

RPlus

Struct RPlus 

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

An element of ℝ⁺, the multiplicative group of positive reals

Represented as a positive real number x > 0.

§Representation

We store the value directly (not logarithm) for intuitive interpretation. The logarithm is computed when needed for Lie algebra operations.

§Examples

use lie_groups::{LieGroup, RPlus};

// Create elements
let g = RPlus::from_value(2.0);
let h = RPlus::from_value(3.0);

// Group multiplication
let product = g.compose(&h);
assert!((product.value() - 6.0).abs() < 1e-10);

// Inverse
let g_inv = g.inverse();
assert!((g_inv.value() - 0.5).abs() < 1e-10);

Implementations§

Source§

impl RPlus

Source

pub fn from_value(value: f64) -> Self

Create ℝ⁺ element from a positive real number

§Panics

Panics if value <= 0.

§Examples
use lie_groups::RPlus;

let g = RPlus::from_value(2.5);
assert!((g.value() - 2.5).abs() < 1e-10);
Source

pub fn from_value_clamped(value: f64) -> Self

Create ℝ⁺ element, clamping to positive range

For robustness when value might be near zero or negative due to numerical errors. Clamps to a small positive value.

§Examples
use lie_groups::RPlus;

let g = RPlus::from_value_clamped(-0.1);
assert!(g.value() > 0.0);
Source

pub fn value(&self) -> f64

Get the positive real value

Source

pub fn from_log(log_value: f64) -> Self

Create from logarithm (exponential map)

Given x ∈ ℝ (Lie algebra), returns eˣ ∈ ℝ⁺.

§Examples
use lie_groups::RPlus;

let g = RPlus::from_log(0.0);  // e⁰ = 1
assert!((g.value() - 1.0).abs() < 1e-10);

let h = RPlus::from_log(1.0);  // e¹ ≈ 2.718
assert!((h.value() - std::f64::consts::E).abs() < 1e-10);
Source

pub fn scaling(magnitude: f64) -> Self

Scaling perturbation for optimization

Returns a small scaling factor for gradient descent updates.

§Arguments
  • magnitude - Step size in log-space
Source

pub fn random<R: Rng>(rng: &mut R, log_mean: f64, log_std: f64) -> Self

Random ℝ⁺ element (log-normal distribution)

Requires the rand feature (enabled by default). Samples from log-normal with given mean and std in log-space.

§Panics

Panics if log_std is negative or NaN.

Trait Implementations§

Source§

impl Clone for RPlus

Source§

fn clone(&self) -> RPlus

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 RPlus

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for RPlus

Display implementation

Source§

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

Formats the value using the given formatter. Read more
Source§

impl LieGroup for RPlus

Source§

const MATRIX_DIM: usize = 1

Matrix dimension in the fundamental representation. Read more
Source§

type Algebra = RPlusAlgebra

Associated Lie algebra type. Read more
Source§

fn identity() -> Self

The identity element e ∈ G. Read more
Source§

fn compose(&self, other: &Self) -> Self

Group composition (multiplication): g₁ · g₂ Read more
Source§

fn inverse(&self) -> Self

Group inverse: g⁻¹ Read more
Source§

fn conjugate_transpose(&self) -> Self

Adjoint representation element (for matrix groups: conjugate transpose). Read more
Source§

fn adjoint_action(&self, algebra_element: &RPlusAlgebra) -> RPlusAlgebra

Adjoint representation: Ad_g: 𝔤 → 𝔤 Read more
Source§

fn distance_to_identity(&self) -> f64

Geodesic distance from identity: d(g, e) Read more
Source§

fn exp(tangent: &RPlusAlgebra) -> Self

Exponential map: 𝔤 → G Read more
Source§

fn log(&self) -> LogResult<RPlusAlgebra>

Logarithm map: G → 𝔤 (inverse of exponential) Read more
Source§

fn distance(&self, other: &Self) -> f64

Distance between two group elements: d(g, h) Read more
Source§

fn is_near_identity(&self, tolerance: f64) -> bool

Check if this element is approximately the identity. Read more
Source§

fn trace_identity() -> f64

Trace of the identity element Read more
Source§

fn reorthogonalize(&self) -> Self

Project element back onto the group manifold using Gram-Schmidt orthogonalization. Read more
Source§

fn geodesic(&self, other: &Self, t: f64) -> Option<Self>

Geodesic interpolation between two group elements. Read more
Source§

impl Mul<&RPlus> for &RPlus

Group multiplication: g₁ · g₂ (real multiplication)

Source§

type Output = RPlus

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &RPlus) -> RPlus

Performs the * operation. Read more
Source§

impl Mul<&RPlus> for RPlus

Source§

type Output = RPlus

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &RPlus) -> RPlus

Performs the * operation. Read more
Source§

impl MulAssign<&RPlus> for RPlus

Source§

fn mul_assign(&mut self, rhs: &RPlus)

Performs the *= operation. Read more
Source§

impl PartialEq for RPlus

Source§

fn eq(&self, other: &RPlus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Abelian for RPlus

ℝ⁺ is abelian: a · b = b · a for all positive reals.

Source§

impl Copy for RPlus

Source§

impl StructuralPartialEq for RPlus

Auto Trait Implementations§

§

impl Freeze for RPlus

§

impl RefUnwindSafe for RPlus

§

impl Send for RPlus

§

impl Sync for RPlus

§

impl Unpin for RPlus

§

impl UnsafeUnpin for RPlus

§

impl UnwindSafe for RPlus

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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

Source§

impl<T, Right> ClosedMul<Right> for T
where T: Mul<Right, Output = T> + MulAssign<Right>,

Source§

impl<T, Right> ClosedMulAssign<Right> for T
where T: ClosedMul<Right> + MulAssign<Right>,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,