Type Alias vector2math::simd::i8x2

source ·
pub type i8x2 = Simd<[i8; 2]>;
Available on crate feature simd only.
Expand description

A 16-bit vector with 2 i8 lanes.

Trait Implementations§

source§

impl Vector2 for i8x2

§

type Scalar = i8

The scalar type
source§

fn new(x: Self::Scalar, y: Self::Scalar) -> Self

Create a new vector from an x and y component
source§

fn x(&self) -> Self::Scalar

Get the x component
source§

fn y(&self) -> Self::Scalar

Get the y component
source§

fn with_x(self, x: i8) -> Self

Get this vector with a different x component
source§

fn with_y(self, y: i8) -> Self

Get this vector with a different y component
source§

fn square(s: Self::Scalar) -> Self

Create a new square vector
source§

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

Add this vector to another
source§

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

Subtract another vector from this one
source§

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

Multiply this vector component-wise by another
source§

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

Divide this vector component-wise by another
source§

fn add_assign(&mut self, other: Self)

Add another vector into this one
source§

fn sub_assign(&mut self, other: Self)

Subtract another vector into this one
source§

fn mul2_assign(&mut self, other: Self)

Multiply another vector component-wise into this one
source§

fn div2_assign(&mut self, other: Self)

Divide another vector component-wise into this one
source§

fn set_x(&mut self, x: Self::Scalar)

Set the x component
source§

fn set_y(&mut self, y: Self::Scalar)

Set the y component
source§

fn map_into<V>(self) -> Vwhere V: Vector2, V::Scalar: From<Self::Scalar>,

Map this vector to a vector of another type
source§

fn map_vec2(self) -> [Self::Scalar; 2]

Map this vector to a [Self::Scalar; 2] Read more
source§

fn map_dims<F>(self, f: F) -> Selfwhere F: FnMut(Self::Scalar) -> Self::Scalar,

Map the individual components of this vector
source§

fn map_with<V, F>(self, f: F) -> Vwhere V: Vector2, F: FnMut(Self::Scalar) -> V::Scalar,

Map this vector to a vector of another type using a function
source§

fn neg(self) -> Selfwhere Self::Scalar: Neg<Output = Self::Scalar>,

Negate the vector
source§

fn mul(self, by: Self::Scalar) -> Self

Multiply this vector by a scalar
source§

fn div(self, by: Self::Scalar) -> Self

Divide this vector by a scalar
source§

fn mul_assign(&mut self, by: Self::Scalar)

Multiply a scalar into this vector
source§

fn div_assign(&mut self, by: Self::Scalar)

Divide a scalar into this vector
source§

fn max_dim(self) -> Self::Scalar

Get the value of the dimension with the higher magnitude
source§

fn min_dim(self) -> Self::Scalar

Get the value of the dimension with the lower magnitude
source§

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

Get the dot product of this vector and another