Skip to main content

c64

Type Alias c64 

Source
pub type c64 = Complex<f32>;
Expand description

A complex number made of two f32s (complex64).

Aliased Type§

#[repr(C)]
pub struct c64 { pub re: f32, pub im: f32, }

Fields§

§re: f32

The real part.

§im: f32

The imaginary part.

Trait Implementations§

Source§

impl BufferElement for c64

Source§

fn wrap(v: Vec<Self>) -> Buffer

Wraps a vector.
Source§

fn view(b: &Buffer) -> Option<&[Self]>

Views a buffer’s elements, if they have this type.
Source§

impl Element for c64

Source§

fn to_bits(self) -> u64

The bits of the real part in the low half and those of the imaginary part in the high half (c128 has more bits than fit, and panics).

Source§

const DTYPE: DType = DType::C64

The element type.
Source§

type Real = f32

The type of the real and imaginary parts of a complex type, or the type itself for other types (the type of abs).
Source§

fn re(self) -> f32

The real part (the value itself for other types than complex).
Source§

fn im(self) -> f32

The imaginary part (zero for other types than complex).
Source§

fn from_parts(re: f32, im: f32) -> Self

The complex number with the given parts (for other types than complex, the real part; the imaginary part is ignored).
Source§

fn to_value(self) -> Value

Widens the value without loss.
Source§

fn from_value(v: Value) -> Self

Converts a value, with the semantics of XLA’s convert (see cast).
Source§

fn write_bytes(self, out: &mut Vec<u8>)

Writes the native-endian bytes of the value.
Source§

fn read_bytes(bytes: &[u8]) -> Self

Reads a value from native-endian bytes of the right length.
Source§

fn from_bits(bits: u64) -> Self

The value of a bit pattern in the low bits (the rest is ignored).
Source§

impl Ops for c64

Source§

fn unary(op: UnaryOp, x: Self) -> Self

Applies a unary operation.
Source§

fn binary(op: BinaryOp, x: Self, y: Self) -> Self

Applies a binary operation.
Source§

fn is_finite(x: Self) -> bool

Returns whether the value is neither infinite nor NaN (always true for integers and booleans).
Source§

fn lowest() -> Self

The smallest value (negative infinity for floats): the identity of max.
Source§

fn highest() -> Self

The largest value (positive infinity for floats): the identity of min.
Source§

fn ternary(op: TernaryOp, x: Self, y: Self, z: Self) -> Self

Applies a ternary operation (only floats support them).