Skip to main content

Vector

Struct Vector 

Source
pub struct Vector<P: Scalar, N: Size> { /* private fields */ }
Expand description

A contiguous list of elements that supports auto-vectorized operations.

Implementations§

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn new(val: P) -> Self

Create a new vector of size 1 using the given value.

Source

pub fn __expand_new( scope: &mut Scope, val: NativeExpand<P>, ) -> NativeExpand<Vector<P, N>>

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn vector_size(&self) -> VectorSize

Get the length of the current vector.

Source§

impl<P: Numeric, N: Size> Vector<P, N>

Source

pub fn min_value() -> Self

Source

pub fn max_value() -> Self

Source

pub fn from_int(val: i64) -> Self

Create a new constant numeric.

Note: since this must work for both integer and float only the less expressive of both can be created (int) If a number with decimals is needed, use Float::new.

This method panics when unexpanded. For creating an element with a val, use the new method of the sub type.

Source

pub fn __expand_min_value(scope: &mut Scope) -> <Self as CubeType>::ExpandType

Source

pub fn __expand_max_value(scope: &mut Scope) -> <Self as CubeType>::ExpandType

Source

pub fn __expand_from_int( scope: &mut Scope, val: <i64 as CubeType>::ExpandType, ) -> <Self as CubeType>::ExpandType

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn fill(self, value: P) -> Self

Fill the vector with the given value.

If you want to fill the vector with different values, consider using the index API instead.

let mut vector = Vector::<u32>::empty(2);
vector[0] = 1;
vector[1] = 2;
Source

pub fn __expand_fill( scope: &mut Scope, this: <Self as CubeType>::ExpandType, value: <P as CubeType>::ExpandType, ) -> <Self as CubeType>::ExpandType

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn empty() -> Self

Source

pub fn __expand_empty(scope: &mut Scope) -> <Self as CubeType>::ExpandType

Source§

impl<P: Scalar + Zeroable, N: Size> Vector<P, N>

Source

pub fn zeroed() -> Self

Source

pub fn __expand_zeroed(scope: &mut Scope) -> <Self as CubeType>::ExpandType

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn size(&self) -> VectorSize

Get the number of individual elements a vector contains.

The size is available at comptime and may be used in combination with the comptime macro.

// The if statement is going to be executed at comptime.
if comptime!(vector.size() == 1) {
}
Source

pub fn __expand_size( scope: &mut Scope, element: NativeExpand<Vector<P, N>>, ) -> VectorSize

Expand function of size.

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn equal(self, other: Self) -> Vector<bool, N>

Return a new vector with the element-wise comparison of the first vector being equal to the second vector.

Source

pub fn __expand_equal( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Vector<bool, N> as CubeType>::ExpandType

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn not_equal(self, other: Self) -> Vector<bool, N>

Return a new vector with the element-wise comparison of the first vector being not equal to the second vector.

Source

pub fn __expand_not_equal( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Vector<bool, N> as CubeType>::ExpandType

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn less_than(self, other: Self) -> Vector<bool, N>

Return a new vector with the element-wise comparison of the first vector being less than the second vector.

Source

pub fn __expand_less_than( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Vector<bool, N> as CubeType>::ExpandType

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn greater_than(self, other: Self) -> Vector<bool, N>

Return a new vector with the element-wise comparison of the first vector being greater than the second vector.

Source

pub fn __expand_greater_than( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Vector<bool, N> as CubeType>::ExpandType

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn less_equal(self, other: Self) -> Vector<bool, N>

Return a new vector with the element-wise comparison of the first vector being less than or equal to the second vector.

Source

pub fn __expand_less_equal( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Vector<bool, N> as CubeType>::ExpandType

Source§

impl<P: Scalar, N: Size> Vector<P, N>

Source

pub fn greater_equal(self, other: Self) -> Vector<bool, N>

Return a new vector with the element-wise comparison of the first vector being greater than or equal to the second vector.

Source

pub fn __expand_greater_equal( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Vector<bool, N> as CubeType>::ExpandType

Source§

impl<N: Size> Vector<bool, N>

Source

pub fn and(self, other: Self) -> Vector<bool, N>

Return a new vector with the element-wise and of the vectors

Source

pub fn __expand_and( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Vector<bool, N> as CubeType>::ExpandType

Source§

impl<N: Size> Vector<bool, N>

Source

pub fn or(self, other: Self) -> Vector<bool, N>

Return a new vector with the element-wise and of the vectors

Source

pub fn __expand_or( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Vector<bool, N> as CubeType>::ExpandType

Source§

impl<P: CountOnes + Scalar, N: Size> Vector<P, N>

Source

pub fn count_ones(self) -> Vector<u32, N>

Source

pub fn __expand_count_ones( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <Vector<u32, N> as CubeType>::ExpandType

Trait Implementations§

Source§

impl<P: Scalar + Abs, N: Size> Abs for Vector<P, N>

Source§

fn abs(self) -> Self

Source§

fn __expand_abs(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P, N: Size> Add<f32> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, _rhs: f32) -> Self::Output

Performs the + operation. Read more
Source§

impl<P, N: Size> Add<f64> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, _rhs: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl<P, N: Size> Add<i32> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, _rhs: i32) -> Self::Output

Performs the + operation. Read more
Source§

impl<P, N: Size> Add<i64> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, _rhs: i64) -> Self::Output

Performs the + operation. Read more
Source§

impl<P, N: Size> Add<usize> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, _rhs: usize) -> Self::Output

Performs the + operation. Read more
Source§

impl<P, N: Size> Add for Vector<P, N>
where P: Scalar + Add<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<P, N: Size> AddAssign for Vector<P, N>
where P: Scalar + AddAssign,

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<P: Scalar + ArcCos, N: Size> ArcCos for Vector<P, N>

Source§

fn acos(self) -> Self

Source§

fn __expand_acos(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + ArcCosh, N: Size> ArcCosh for Vector<P, N>

Source§

fn acosh(self) -> Self

Source§

fn __expand_acosh( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + ArcSin, N: Size> ArcSin for Vector<P, N>

Source§

fn asin(self) -> Self

Source§

fn __expand_asin(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + ArcSinh, N: Size> ArcSinh for Vector<P, N>

Source§

fn asinh(self) -> Self

Source§

fn __expand_asinh( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + ArcTan, N: Size> ArcTan for Vector<P, N>

Source§

fn atan(self) -> Self

Source§

fn __expand_atan(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + ArcTan2, N: Size> ArcTan2 for Vector<P, N>

Source§

fn atan2(self, _rhs: Self) -> Self

Source§

fn __expand_atan2( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + ArcTanh, N: Size> ArcTanh for Vector<P, N>

Source§

fn atanh(self) -> Self

Source§

fn __expand_atanh( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P, N: Size> BitAnd for Vector<P, N>
where P: Scalar + BitAnd<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<P, N: Size> BitAndAssign for Vector<P, N>
where P: Scalar + BitAndAssign,

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl<P, N: Size> BitOr for Vector<P, N>
where P: Scalar + BitOr<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<P, N: Size> BitOrAssign for Vector<P, N>
where P: Scalar + BitOrAssign,

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl<P, N: Size> BitXor for Vector<P, N>
where P: Scalar + BitXor<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<P, N: Size> BitXorAssign for Vector<P, N>
where P: Scalar + BitXorAssign,

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl<P: Scalar + Ceil, N: Size> Ceil for Vector<P, N>

Source§

fn ceil(self) -> Self

Source§

fn __expand_ceil(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar, N: Size> Clone for Vector<P, N>

Source§

fn clone(&self) -> Self

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<P: Scalar + Cos, N: Size> Cos for Vector<P, N>

Source§

fn cos(self) -> Self

Source§

fn __expand_cos(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + Cosh, N: Size> Cosh for Vector<P, N>

Source§

fn cosh(self) -> Self

Source§

fn __expand_cosh(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<E: Scalar, N: Size> CubeIndex for Vector<E, N>

Source§

type Output = E

Source§

type Idx = usize

Source§

fn cube_idx(&self, _i: Self::Idx) -> &Self::Output

Source§

fn expand_index( scope: &mut Scope, array: Self::ExpandType, index: <Self::Idx as CubeType>::ExpandType, ) -> <Self::Output as CubeType>::ExpandType

Source§

fn expand_index_unchecked( scope: &mut Scope, array: Self::ExpandType, index: <Self::Idx as CubeType>::ExpandType, ) -> <Self::Output as CubeType>::ExpandType

Source§

impl<E: Scalar, N: Size> CubeIndexMut for Vector<E, N>

Source§

fn cube_idx_mut( &mut self, _i: <Self as CubeIndex>::Idx, ) -> &mut <Self as CubeIndex>::Output

Source§

fn expand_index_mut( scope: &mut Scope, array: Self::ExpandType, index: <Self::Idx as CubeType>::ExpandType, value: <Self::Output as CubeType>::ExpandType, )

Source§

impl<P: Scalar + CubeNot, N: Size> CubeNot for Vector<P, N>

Source§

fn __expand_not(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar, N: Size> CubePrimitive for Vector<P, N>

Source§

type Scalar = P

Source§

type Size = N

Source§

type WithScalar<S: Scalar> = Vector<S, N>

Source§

fn as_type(scope: &Scope) -> Type

Return the element type to use on GPU.
Source§

fn as_type_native() -> Option<Type>

Native or static element type.
Source§

fn from_const_value(value: ConstantValue) -> Self

Source§

fn as_type_native_unchecked() -> Type

Native or static element type.
Source§

fn size() -> Option<usize>

Only native element types have a size.
Source§

fn size_bits() -> Option<usize>

Only native element types have a size.
Source§

fn size_bits_unchecked() -> usize

Only native element types have a size.
Source§

fn from_expand_elem(elem: ManagedVariable) -> Self::ExpandType

Source§

fn into_lit_unchecked(self) -> Self

Source§

fn supported_uses<R: Runtime>(client: &ComputeClient<R>) -> EnumSet<TypeUsage>

Source§

fn type_size() -> usize

Source§

fn type_size_bits() -> usize

Source§

fn packing_factor() -> usize

Source§

fn vector_size() -> usize

Source§

fn __expand_type_size(scope: &Scope) -> usize

Source§

fn __expand_type_size_bits(scope: &Scope) -> usize

Source§

fn __expand_packing_factor(scope: &Scope) -> usize

Source§

fn __expand_vector_size(scope: &Scope) -> usize

Source§

impl<P: Scalar, N: Size> CubeType for &Vector<P, N>

Source§

impl<P: Scalar, N: Size> CubeType for &mut Vector<P, N>

Source§

impl<P: Scalar, N: Size> CubeType for Vector<P, N>

Source§

impl<P: Debug + Scalar, N: Debug + Size> Debug for Vector<P, N>

Source§

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

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

impl<T: Scalar + Default, N: Size> Default for Vector<T, N>

Source§

fn default() -> Self

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

impl<P: Scalar + Degrees, N: Size> Degrees for Vector<P, N>

Source§

fn to_degrees(self) -> Self

Source§

fn __expand_to_degrees( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P, N: Size> Div<f32> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, _rhs: f32) -> Self::Output

Performs the / operation. Read more
Source§

impl<P, N: Size> Div<f64> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, _rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl<P, N: Size> Div<i32> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, _rhs: i32) -> Self::Output

Performs the / operation. Read more
Source§

impl<P, N: Size> Div<i64> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, _rhs: i64) -> Self::Output

Performs the / operation. Read more
Source§

impl<P, N: Size> Div<usize> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, _rhs: usize) -> Self::Output

Performs the / operation. Read more
Source§

impl<P, N: Size> Div for Vector<P, N>
where P: Scalar + Div<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<P, N: Size> DivAssign for Vector<P, N>
where P: Scalar + DivAssign,

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<T: Dot + Scalar, N: Size> Dot for Vector<T, N>

Source§

fn dot(self, _rhs: Self) -> Self::Scalar

Source§

fn __expand_dot( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self::Scalar>

Source§

impl<P: Scalar + Erf, N: Size> Erf for Vector<P, N>

Source§

fn erf(self) -> Self

Source§

fn __expand_erf(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + Exp, N: Size> Exp for Vector<P, N>

Source§

fn exp(self) -> Self

Source§

fn __expand_exp(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: FindFirstSet + Scalar, N: Size> FindFirstSet for Vector<P, N>

Source§

impl<T: FloatOps + Scalar, N: Size> FloatOps for Vector<T, N>

Source§

fn min(self, other: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

fn __expand_min( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Self as CubeType>::ExpandType

Source§

fn __expand_max( scope: &mut Scope, this: <Self as CubeType>::ExpandType, other: <Self as CubeType>::ExpandType, ) -> <Self as CubeType>::ExpandType

Source§

fn __expand_clamp( scope: &mut Scope, this: <Self as CubeType>::ExpandType, min: <Self as CubeType>::ExpandType, max: <Self as CubeType>::ExpandType, ) -> <Self as CubeType>::ExpandType

Source§

impl<P: Scalar + Floor, N: Size> Floor for Vector<P, N>

Source§

fn floor(self) -> Self

Source§

fn __expand_floor( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<T: Scalar + Into<ConstantValue>, N: Size> From<Vector<T, N>> for ConstantValue

Source§

fn from(value: Vector<T, N>) -> Self

Converts to this type from the input type.
Source§

impl<T: Hypot + Scalar, N: Size> Hypot for Vector<T, N>

Source§

fn hypot(self, _rhs: Self) -> Self

Source§

fn __expand_hypot( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + Into<NativeExpand<P>>, N: Size> Into<NativeExpand<Vector<P, N>>> for Vector<P, N>

Source§

fn into(self) -> NativeExpand<Self>

Converts this type into the (usually inferred) input type.
Source§

impl<T: Scalar + IntoRuntime, N: Size> IntoRuntime for Vector<T, N>

Source§

fn __expand_runtime_method(self, scope: &mut Scope) -> Self::ExpandType

Source§

fn runtime(self) -> Self

Source§

impl<P: Scalar + InverseSqrt, N: Size> InverseSqrt for Vector<P, N>

Source§

fn inverse_sqrt(self) -> Self

Source§

fn __expand_inverse_sqrt( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + IsInf, N: Size> IsInf for Vector<P, N>

Source§

fn is_inf(self) -> Self::WithScalar<bool>

Source§

fn __expand_is_inf( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self::WithScalar<bool>>

Source§

impl<P: Scalar + IsNan, N: Size> IsNan for Vector<P, N>

Source§

fn is_nan(self) -> Self::WithScalar<bool>

Source§

fn __expand_is_nan( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self::WithScalar<bool>>

Source§

impl<P: LeadingZeros + Scalar, N: Size> LeadingZeros for Vector<P, N>

Source§

impl<P: Scalar + Log, N: Size> Log for Vector<P, N>

Source§

fn ln(self) -> Self

Source§

fn __expand_ln(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + Log1p, N: Size> Log1p for Vector<P, N>

Source§

fn log1p(self) -> Self

Source§

fn __expand_log1p( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + Magnitude, N: Size> Magnitude for Vector<P, N>

Source§

fn magnitude(self) -> Self

Source§

fn __expand_magnitude( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self::Scalar>

Source§

impl<P, N: Size> Mul<f32> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, _rhs: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl<P, N: Size> Mul<f64> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, _rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl<P, N: Size> Mul<i32> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, _rhs: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl<P, N: Size> Mul<i64> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, _rhs: i64) -> Self::Output

Performs the * operation. Read more
Source§

impl<P, N: Size> Mul<usize> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, _rhs: usize) -> Self::Output

Performs the * operation. Read more
Source§

impl<P, N: Size> Mul for Vector<P, N>
where P: Scalar + Mul<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<P, N: Size> MulAssign for Vector<P, N>
where P: Scalar + MulAssign,

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<T: MulHi + Scalar, N: Size> MulHi for Vector<T, N>

Source§

fn mul_hi(self, _rhs: Self) -> Self

Source§

fn __expand_mul_hi( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar, N: Size> NativeAssign for Vector<P, N>

Source§

impl<P: Scalar + Neg<Output = P>, N: Size> Neg for Vector<P, N>

Source§

type Output = Vector<P, N>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<P: Scalar + Normalize, N: Size> Normalize for Vector<P, N>

Source§

fn normalize(self) -> Self

Source§

fn __expand_normalize( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Not<Output = P> + Scalar, N: Size> Not for Vector<P, N>

Source§

type Output = Vector<P, N>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<P: Scalar + NumCast, N: Size> NumCast for Vector<P, N>

Source§

fn from<T: ToPrimitive>(n: T) -> Option<Self>

Creates a number from another value that can be converted into a primitive via the ToPrimitive trait. If the source value cannot be represented by the target type, then None is returned. Read more
Source§

impl<T: Scalar + One, N: Size> One for Vector<T, N>

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl<P: Scalar + Ord, N: Size> Ord for Vector<P, N>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<P, N: Size> PartialEq for Vector<P, N>
where P: Scalar + PartialEq,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<P, N: Size> PartialOrd for Vector<P, N>
where P: Scalar + PartialOrd,

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<P: Scalar + Powf, N: Size> Powf for Vector<P, N>

Source§

fn powf(self, _rhs: Self) -> Self

Source§

fn __expand_powf( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + Powi<I>, I: Scalar, N: Size> Powi<Vector<I, N>> for Vector<P, N>

Source§

fn powi(self, _rhs: Rhs) -> Self

Source§

fn __expand_powi( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Rhs>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + Radians, N: Size> Radians for Vector<P, N>

Source§

fn to_radians(self) -> Self

Source§

fn __expand_to_radians( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + Recip, N: Size> Recip for Vector<P, N>

Source§

fn recip(self) -> Self

Source§

fn __expand_recip( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + Remainder, N: Size> Remainder for Vector<P, N>

Source§

fn rem(self, _rhs: Self) -> Self

Source§

fn __expand_rem( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + ReverseBits, N: Size> ReverseBits for Vector<P, N>

Source§

fn reverse_bits(self) -> Self

Source§

fn __expand_reverse_bits( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<T: Rhypot + Scalar, N: Size> Rhypot for Vector<T, N>

Source§

fn rhypot(self, _rhs: Self) -> Self

Source§

fn __expand_rhypot( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + Round, N: Size> Round for Vector<P, N>

Source§

fn round(self) -> Self

Source§

fn __expand_round( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + SaturatingAdd, N: Size> SaturatingAdd for Vector<P, N>

Source§

fn saturating_add(self, _rhs: Self) -> Self

Source§

fn __expand_saturating_add( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P: Scalar + SaturatingSub, N: Size> SaturatingSub for Vector<P, N>

Source§

fn saturating_sub(self, _rhs: Self) -> Self

Source§

fn __expand_saturating_sub( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<P, N: Size> Shl for Vector<P, N>
where P: Scalar + Shl<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Self) -> Self::Output

Performs the << operation. Read more
Source§

impl<P, N: Size> ShlAssign for Vector<P, N>
where P: Scalar + ShlAssign,

Source§

fn shl_assign(&mut self, rhs: Self)

Performs the <<= operation. Read more
Source§

impl<P, N: Size> Shr for Vector<P, N>
where P: Scalar + Shr<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Self) -> Self::Output

Performs the >> operation. Read more
Source§

impl<P, N: Size> ShrAssign for Vector<P, N>
where P: Scalar + ShrAssign,

Source§

fn shr_assign(&mut self, rhs: Self)

Performs the >>= operation. Read more
Source§

impl<P: Scalar + Sin, N: Size> Sin for Vector<P, N>

Source§

fn sin(self) -> Self

Source§

fn __expand_sin(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + Sinh, N: Size> Sinh for Vector<P, N>

Source§

fn sinh(self) -> Self

Source§

fn __expand_sinh(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + Sqrt, N: Size> Sqrt for Vector<P, N>

Source§

fn sqrt(self) -> Self

Source§

fn __expand_sqrt(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P, N: Size> Sub<f32> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, _rhs: f32) -> Self::Output

Performs the - operation. Read more
Source§

impl<P, N: Size> Sub<f64> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, _rhs: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl<P, N: Size> Sub<i32> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, _rhs: i32) -> Self::Output

Performs the - operation. Read more
Source§

impl<P, N: Size> Sub<i64> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, _rhs: i64) -> Self::Output

Performs the - operation. Read more
Source§

impl<P, N: Size> Sub<usize> for Vector<P, N>
where P: Scalar,

Source§

type Output = Vector<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, _rhs: usize) -> Self::Output

Performs the - operation. Read more
Source§

impl<P, N: Size> Sub for Vector<P, N>
where P: Scalar + Sub<P, Output = P>,

Source§

type Output = Vector<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<P, N: Size> SubAssign for Vector<P, N>
where P: Scalar + SubAssign,

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<P: Scalar + Tan, N: Size> Tan for Vector<P, N>

Source§

fn tan(self) -> Self

Source§

fn __expand_tan(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + Tanh, N: Size> Tanh for Vector<P, N>

Source§

fn tanh(self) -> Self

Source§

fn __expand_tanh(scope: &mut Scope, x: NativeExpand<Self>) -> NativeExpand<Self>

Source§

impl<P: Scalar + NumCast, N: Size> ToPrimitive for Vector<P, N>

Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl<P: TrailingZeros + Scalar, N: Size> TrailingZeros for Vector<P, N>

Source§

impl<P: Scalar + Trunc, N: Size> Trunc for Vector<P, N>

Source§

fn trunc(self) -> Self

Source§

fn __expand_trunc( scope: &mut Scope, x: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<T: Scalar + Zero, N: Size> Zero for Vector<T, N>

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<P: Scalar, N: Size> Copy for Vector<P, N>

Source§

impl<P: Scalar, N: Size> Eq for Vector<P, N>

Auto Trait Implementations§

§

impl<P, N> Freeze for Vector<P, N>
where P: Freeze,

§

impl<P, N> RefUnwindSafe for Vector<P, N>

§

impl<P, N> Send for Vector<P, N>

§

impl<P, N> Sync for Vector<P, N>

§

impl<P, N> Unpin for Vector<P, N>
where P: Unpin, N: Unpin,

§

impl<P, N> UnsafeUnpin for Vector<P, N>
where P: UnsafeUnpin,

§

impl<P, N> UnwindSafe for Vector<P, N>
where P: UnwindSafe, N: 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> Assign for T
where T: CubePrimitive,

Source§

fn expand_assign(&mut self, _scope: &mut Scope, value: T)

Assign value to self in scope.
Source§

fn init_mut(&self, _scope: &mut Scope) -> T

Create a new mutable variable of this type in scope.
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<P> Cast for P
where P: CubePrimitive,

Source§

fn cast_from<From>(_value: From) -> P
where From: CubePrimitive,

Source§

fn __expand_cast_from<From: CubePrimitive>( scope: &mut Scope, value: NativeExpand<From>, ) -> <Self as CubeType>::ExpandType

Source§

impl<C> CloneExpand for C
where C: Clone,

Source§

fn __expand_clone_method(&self, _scope: &mut Scope) -> C

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> CubeAdd for T
where T: Add<Output = T> + CubePrimitive,

Source§

fn __expand_add( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<T> CubeAddAssign for T

Source§

fn __expand_add_assign( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, )

Source§

impl<P> CubeDebug for P
where P: CubePrimitive,

Source§

fn set_debug_name(&self, scope: &mut Scope, name: &'static str)

Set the debug name of this type’s expansion. Should do nothing for types that don’t appear at runtime
Source§

impl<T> CubeDiv for T
where T: Div<Output = T> + CubePrimitive,

Source§

fn __expand_mul( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<T> CubeDivAssign for T

Source§

fn __expand_div_assign( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, )

Source§

impl<T> CubeMul for T
where T: Mul<Output = T> + CubePrimitive,

Source§

fn __expand_mul( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<T> CubeMulAssign for T

Source§

fn __expand_mul_assign( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, )

Source§

impl<T> CubeOrd for T
where T: Ord + CubePrimitive,

Source§

fn __expand_cmp( scope: &mut Scope, lhs: Self::ExpandType, rhs: Self::ExpandType, ) -> OrderingExpand

Source§

fn __expand_min( scope: &mut Scope, lhs: Self::ExpandType, rhs: Self::ExpandType, ) -> Self::ExpandType

Source§

fn __expand_max( scope: &mut Scope, lhs: Self::ExpandType, rhs: Self::ExpandType, ) -> Self::ExpandType

Source§

fn __expand_clamp( scope: &mut Scope, lhs: Self::ExpandType, min: Self::ExpandType, max: Self::ExpandType, ) -> Self::ExpandType

Source§

impl<T> CubeSub for T
where T: Sub<Output = T> + CubePrimitive,

Source§

fn __expand_sub( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, ) -> NativeExpand<Self>

Source§

impl<T> CubeSubAssign for T

Source§

fn __expand_sub_assign( scope: &mut Scope, lhs: NativeExpand<Self>, rhs: NativeExpand<Self>, )

Source§

impl<T> DefaultExpand for T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> OneExpand for T
where T: CubeType + One + IntoRuntime,

Source§

fn __expand_one(scope: &mut Scope) -> <T as CubeType>::ExpandType

Source§

impl<P> Reinterpret for P
where P: CubePrimitive,

Source§

fn reinterpret<From: CubePrimitive>(value: From) -> Self

Reinterpret the bits of another primitive as this primitive without conversion.
Source§

fn reinterpret_vectorization<From: CubePrimitive>() -> usize

Calculates the expected vectorization for the reinterpret target
Source§

fn __expand_reinterpret<From: CubePrimitive>( scope: &mut Scope, value: NativeExpand<From>, ) -> <Self as CubeType>::ExpandType

Source§

fn __expand_reinterpret_vectorization<From: CubePrimitive>( scope: &mut Scope, ) -> usize

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> ZeroExpand for T
where T: CubeType + Zero + IntoRuntime,

Source§

fn __expand_zero(scope: &mut Scope) -> <T as CubeType>::ExpandType