Skip to main content

CausalMultiFieldWitness

Struct CausalMultiFieldWitness 

Source
pub struct CausalMultiFieldWitness<T>(/* private fields */);
Expand description

HKT witness for CausalMultiField<T>.

The type parameter T specifies the concrete coefficient type (e.g., f64, f32). All HKT operations assume the generic type parameters match T.

Implementations§

Source§

impl<T> CausalMultiFieldWitness<T>

Source

pub fn new() -> Self

Creates a new witness.

Trait Implementations§

Source§

impl<T> Applicative<CausalMultiFieldWitness<T>> for CausalMultiFieldWitness<T>

Source§

fn apply<A, C, Func>( _ff: CausalMultiField<Func>, _fa: CausalMultiField<A>, ) -> CausalMultiField<C>

Applies a field of functions to a field of values.

§Note

This is not meaningful for CausalMultiField because we can’t store functions in a tensor. Use fmap for function application.

Source§

impl<T: Clone> Clone for CausalMultiFieldWitness<T>

Source§

fn clone(&self) -> CausalMultiFieldWitness<T>

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<T> CoMonad<CausalMultiFieldWitness<T>> for CausalMultiFieldWitness<T>

Source§

fn extract<A>(fa: &CausalMultiField<A>) -> A

Extracts the “focus” value from the field.

Returns the first coefficient (scalar part at origin).

Source§

fn extend<A, C, Func>(fa: &CausalMultiField<A>, f: Func) -> CausalMultiField<C>

Extends a local computation to the entire field.

Applies the function to the field and broadcasts the result.

Source§

fn duplicate<A>( fa: &<F as HKT>::Type<A>, ) -> <F as HKT>::Type<<F as HKT>::Type<A>>
where A: Satisfies<<F as HKT>::Constraint> + Clone, <F as HKT>::Type<A>: Satisfies<<F as HKT>::Constraint> + Clone,

Duplicates the comonadic context. Read more
Source§

impl<T: Debug> Debug for CausalMultiFieldWitness<T>

Source§

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

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

impl<T: Default> Default for CausalMultiFieldWitness<T>

Source§

fn default() -> CausalMultiFieldWitness<T>

Returns the “default value” for a type. Read more
Source§

impl<T> Functor<CausalMultiFieldWitness<T>> for CausalMultiFieldWitness<T>

Source§

fn fmap<A, C, Func>(fa: CausalMultiField<A>, f: Func) -> CausalMultiField<C>
where A: Satisfies<NoConstraint>, C: Satisfies<NoConstraint>, Func: FnMut(A) -> C,

Maps a function over the field coefficients.

§Safety — ACKNOWLEDGED GAT Limitation

This method uses unsafe pointer casting to work around Rust’s current GAT limitations. This will be resolved when the new trait solver (-Ztrait-solver=next) stabilizes.

SAFETY CONTRACT: The caller MUST ensure A and C are the same as T.

Source§

impl<T> HKT for CausalMultiFieldWitness<T>

Source§

type Constraint = NoConstraint

The constraint on inner types. Use NoConstraint for fully polymorphic.
Source§

type Type<A> = CausalMultiField<A>

The Generic Associated Type (GAT) that represents the type constructor. The <T> is the “hole” in the type constructor (e.g., Option<T>). Read more
Source§

impl<T> Monad<CausalMultiFieldWitness<T>> for CausalMultiFieldWitness<T>

Source§

fn bind<A, C, Func>(ma: CausalMultiField<A>, f: Func) -> CausalMultiField<C>

Monadic bind for CausalMultiField.

Note: This extracts the first coefficient, applies f, and returns the result. For proper field composition, use matrix multiplication via * operator.

Source§

fn join<A>(m_m_a: <F as HKT>::Type<<F as HKT>::Type<A>>) -> <F as HKT>::Type<A>
where A: Satisfies<<F as HKT>::Constraint>, <F as HKT>::Type<A>: Satisfies<<F as HKT>::Constraint>,

Flatten a nested structure into a single layer. Read more
Source§

impl<T> Pure<CausalMultiFieldWitness<T>> for CausalMultiFieldWitness<T>

Source§

fn pure<A>(value: A) -> CausalMultiField<A>

Creates a field with all coefficients set to the given value.

Note: Uses default metric (4D Lorentzian), shape [1,1,1], and unit grid spacing. For specific configurations, use CausalMultiField::zeros() or other factory methods.

Source§

impl<T: Copy> Copy for CausalMultiFieldWitness<T>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T, F> AliasCoMonad<F> for T
where T: CoMonad<F>, F: HKT,

Source§

fn observe<A>(fa: &<F as HKT>::Type<A>) -> A
where A: Satisfies<<F as HKT>::Constraint> + Clone,

Alias for extract. Gets the value at the current focus.
Source§

fn propagate<A, B, Func>( fa: &<F as HKT>::Type<A>, f: Func, ) -> <F as HKT>::Type<B>
where A: Satisfies<<F as HKT>::Constraint> + Clone, B: Satisfies<<F as HKT>::Constraint>, Func: FnMut(&<F as HKT>::Type<A>) -> B,

Alias for extend. Propagates a computation across the context.
Source§

impl<T, F> AliasFunctor<F> for T
where T: Functor<F>, F: HKT,

Source§

fn transform<A, B, Func>( m_a: <F as HKT>::Type<A>, f: Func, ) -> <F as HKT>::Type<B>
where A: Satisfies<<F as HKT>::Constraint>, B: Satisfies<<F as HKT>::Constraint>, Func: FnMut(A) -> B,

Alias for fmap. Transforms the value inside a container.
Source§

impl<T, F> AliasMonad<F> for T
where T: Monad<F>, F: HKT,

Source§

fn chain<A, B, Func>(m_a: <F as HKT>::Type<A>, f: Func) -> <F as HKT>::Type<B>
where A: Satisfies<<F as HKT>::Constraint>, B: Satisfies<<F as HKT>::Constraint>, Func: FnMut(A) -> <F as HKT>::Type<B>,

Alias for bind. Chains a computation, flattening the result.
Source§

fn flatten<A>( m_m_a: <F as HKT>::Type<<F as HKT>::Type<A>>, ) -> <F as HKT>::Type<A>
where A: Satisfies<<F as HKT>::Constraint>, <F as HKT>::Type<A>: Satisfies<<F as HKT>::Constraint>,

Alias for join. Flattens a nested container.
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<T> Satisfies<NoConstraint> for T