Skip to main content

PeriodicTransform

Struct PeriodicTransform 

Source
pub struct PeriodicTransform<T = f64, B = NalgebraProvider>
where T: RealScalar, B: LinearAlgebra<T>,
{ /* private fields */ }
Expand description

Component-wise periodic coordinate transform for optimization.

Periodic coordinates are represented internally on the real line and canonically wrapped into half-open external intervals. This repeated lift is not a proper target for MCMC sampling.

Implementations§

Source§

impl<T, B> PeriodicTransform<T, B>
where T: RealScalar, B: LinearAlgebra<T>,

Source

pub fn new<I>(intervals: I) -> GaneshResult<Self>
where I: IntoIterator<Item = Option<(T, T)>>,

Construct from one optional periodic interval per coordinate.

None leaves a coordinate unchanged. Periodic intervals are canonicalized to [lower, upper).

§Errors

Returns a configuration error for an empty list, no periodic coordinates, non-finite endpoints, or intervals whose endpoints are not ordered.

Source

pub fn intervals(&self) -> &[Option<(T, T)>]

Return the optional periodic interval for each coordinate.

Trait Implementations§

Source§

impl<T, B> Clone for PeriodicTransform<T, B>
where T: RealScalar + Clone, B: LinearAlgebra<T> + Clone,

Source§

fn clone(&self) -> PeriodicTransform<T, B>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T, B> Debug for PeriodicTransform<T, B>
where T: RealScalar + Debug, B: LinearAlgebra<T> + Debug,

Source§

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

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

impl<T, B> Transform<T, B> for PeriodicTransform<T, B>
where T: RealScalar, B: LinearAlgebra<T>,

Source§

fn to_external(&self, internal: &Vector<T, B>) -> Vector<T, B>

Convert internal coordinates to user-facing external coordinates.
Source§

fn to_internal(&self, external: &Vector<T, B>) -> Vector<T, B>

Convert external coordinates to internal coordinates.
Source§

fn to_external_jacobian(&self, internal: &Vector<T, B>) -> Matrix<T, B>

Jacobian of to_external at internal.
Source§

fn to_external_component_hessian( &self, _component: usize, internal: &Vector<T, B>, ) -> Matrix<T, B>

Hessian of external component component at internal.
Source§

fn then<X>(self, outer: X) -> TransformChain<Self, X>
where Self: Sized, X: Transform<T, B>,

Apply this transform first and outer second.
Source§

fn parameter_bounds(&self) -> Option<&[ScalarBound<T>]>

Return user-facing parameter bounds when this transform represents bounds.
Source§

fn pullback_gradient( &self, internal: &Vector<T, B>, external_gradient: &Vector<T, B>, ) -> Vector<T, B>

Pull an external-space gradient back to internal coordinates.
Source§

fn pullback_hessian( &self, internal: &Vector<T, B>, external_gradient: &Vector<T, B>, external_hessian: &Matrix<T, B>, ) -> Matrix<T, B>

Pull an external-space Hessian back to internal coordinates.

Auto Trait Implementations§

§

impl<T, B> Freeze for PeriodicTransform<T, B>

§

impl<T, B> RefUnwindSafe for PeriodicTransform<T, B>

§

impl<T, B> Send for PeriodicTransform<T, B>

§

impl<T, B> Sync for PeriodicTransform<T, B>

§

impl<T, B> Unpin for PeriodicTransform<T, B>
where B: Unpin, T: Unpin,

§

impl<T, B> UnsafeUnpin for PeriodicTransform<T, B>

§

impl<T, B> UnwindSafe for PeriodicTransform<T, B>
where B: UnwindSafe, T: UnwindSafe,

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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, 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.