Skip to main content

ComplexTensor

Struct ComplexTensor 

Source
pub struct ComplexTensor {
    pub shape: Vec<usize>,
    pub rows: usize,
    pub cols: usize,
    /* private fields */
}

Fields§

§shape: Vec<usize>§rows: usize§cols: usize

Implementations§

Source§

impl ComplexTensor

Source

pub fn new(data: Vec<(f64, f64)>, shape: Vec<usize>) -> Result<Self, String>

Source

pub fn from_f32( data: Vec<(f32, f32)>, shape: Vec<usize>, ) -> Result<Self, String>

Source

pub fn from_f64_values_with_dtype( data: Vec<(f64, f64)>, shape: Vec<usize>, dtype: NumericDType, ) -> Result<Self, String>

Reconstructs floating complex values in the requested floating class.

Source

pub fn from_complex_storage( storage: ComplexStorage, shape: Vec<usize>, ) -> Result<Self, String>

Source

pub fn new_integer( storage: IntegerComplexStorage, shape: Vec<usize>, ) -> Result<Self, String>

Source

pub fn new_2d( data: Vec<(f64, f64)>, rows: usize, cols: usize, ) -> Result<Self, String>

Source

pub fn zeros(shape: Vec<usize>) -> Self

Source

pub fn complex_storage(&self) -> &ComplexStorage

Source

pub fn into_complex_storage(self) -> ComplexStorage

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn numeric_dtype(&self) -> NumericDType

Source

pub fn as_f64_slice(&self) -> Option<&[(f64, f64)]>

Source

pub fn as_f32_slice(&self) -> Option<&[(f32, f32)]>

Source

pub fn materialize_f64(&self) -> Vec<(f64, f64)>

Explicitly materializes complex values in the f64 computation domain.

Integer components outside the exact binary64 range may lose precision.

Source

pub fn integer_storage(&self) -> Option<&IntegerComplexStorage>

Source

pub fn numeric_value_at( &self, index: usize, ) -> Option<(NumericScalar, NumericScalar)>

Read one complex element without routing integer components through floating point.

Source

pub fn set_f64_assignment_at( &mut self, index: usize, real: f64, imag: f64, ) -> Result<(), String>

Assigns one complex floating scalar using the destination component class.

Source

pub fn format_element(&self, index: usize) -> String

Formats one element using its exact integer components when present.

Trait Implementations§

Source§

impl Clone for ComplexTensor

Source§

fn clone(&self) -> ComplexTensor

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 Debug for ComplexTensor

Source§

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

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

impl Display for ComplexTensor

Source§

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

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

impl PartialEq for ComplexTensor

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ComplexTensor

Auto Trait Implementations§

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<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 = !

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.