Skip to main content

NdarrayConvert

Trait NdarrayConvert 

Source
pub trait NdarrayConvert: Sized {
    type NdArray;

    // Required methods
    fn from_ndarray(array: &Self::NdArray) -> Self;
    fn to_ndarray(&self) -> Self::NdArray;
}

Required Associated Types§

Source

type NdArray

Concrete ndarray representation used by this container.

Required Methods§

Source

fn from_ndarray(array: &Self::NdArray) -> Self

Construct Self from an ndarray value. Details:

  • Purpose: Converts an owned or borrowed ndarray representation into the corresponding PiP math container while preserving shape and row-major logical element order.
  • Parameters:
    • array (&Self::NdArray): ndarray value whose dimensions and scalar entries should be imported.
Source

fn to_ndarray(&self) -> Self::NdArray

Convert Self into its ndarray representation. Details:

  • Purpose: Exports a PiP math container into an ndarray value with the same logical shape and scalar entries.
  • Parameters:
    • (none): Reads the source container without modifying it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§