Skip to main content

glam/usize/
usizevec4.rs

1// Generated from vec.rs.tera template. Edit the template, not the generated file.
2
3#[cfg(not(feature = "scalar-math"))]
4use crate::BVec4A;
5use crate::{BVec4, USizeVec2, USizeVec3};
6
7#[cfg(feature = "u8")]
8use crate::U8Vec4;
9
10#[cfg(feature = "u16")]
11use crate::U16Vec4;
12
13#[cfg(feature = "i8")]
14use crate::I8Vec4;
15
16#[cfg(feature = "i16")]
17use crate::I16Vec4;
18
19#[cfg(feature = "i32")]
20use crate::IVec4;
21
22#[cfg(feature = "i64")]
23use crate::I64Vec4;
24
25#[cfg(feature = "u32")]
26use crate::UVec4;
27
28#[cfg(feature = "u64")]
29use crate::U64Vec4;
30
31#[cfg(feature = "isize")]
32use crate::ISizeVec4;
33
34use core::fmt;
35use core::iter::{Product, Sum};
36use core::ops::*;
37
38#[cfg(feature = "zerocopy-08")]
39use zerocopy_derive_08::*;
40
41/// Creates a 4-dimensional vector.
42#[inline(always)]
43#[must_use]
44pub const fn usizevec4(x: usize, y: usize, z: usize, w: usize) -> USizeVec4 {
45    USizeVec4::new(x, y, z, w)
46}
47
48/// A 4-dimensional vector.
49#[derive(Clone, Copy, PartialEq, Eq, Hash)]
50#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
51#[cfg_attr(
52    feature = "zerocopy-08",
53    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
54)]
55#[cfg_attr(feature = "cuda", repr(align(16)))]
56#[repr(C)]
57#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
58pub struct USizeVec4 {
59    pub x: usize,
60    pub y: usize,
61    pub z: usize,
62    pub w: usize,
63}
64
65impl USizeVec4 {
66    /// All zeroes.
67    pub const ZERO: Self = Self::splat(0);
68
69    /// All ones.
70    pub const ONE: Self = Self::splat(1);
71
72    /// All `usize::MIN`.
73    pub const MIN: Self = Self::splat(usize::MIN);
74
75    /// All `usize::MAX`.
76    pub const MAX: Self = Self::splat(usize::MAX);
77
78    /// A unit vector pointing along the positive X axis.
79    pub const X: Self = Self::new(1, 0, 0, 0);
80
81    /// A unit vector pointing along the positive Y axis.
82    pub const Y: Self = Self::new(0, 1, 0, 0);
83
84    /// A unit vector pointing along the positive Z axis.
85    pub const Z: Self = Self::new(0, 0, 1, 0);
86
87    /// A unit vector pointing along the positive W axis.
88    pub const W: Self = Self::new(0, 0, 0, 1);
89
90    /// The unit axes.
91    pub const AXES: [Self; 4] = [Self::X, Self::Y, Self::Z, Self::W];
92
93    /// Creates a new vector.
94    #[inline(always)]
95    #[must_use]
96    pub const fn new(x: usize, y: usize, z: usize, w: usize) -> Self {
97        Self { x, y, z, w }
98    }
99
100    /// Creates a vector with all elements set to `v`.
101    #[inline]
102    #[must_use]
103    pub const fn splat(v: usize) -> Self {
104        Self::new(v, v, v, v)
105    }
106
107    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
108    #[inline]
109    #[must_use]
110    pub fn map<F>(self, mut f: F) -> Self
111    where
112        F: FnMut(usize) -> usize,
113    {
114        Self::new(f(self.x), f(self.y), f(self.z), f(self.w))
115    }
116
117    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
118    /// for each element of `self`.
119    ///
120    /// A true element in the mask uses the corresponding element from `if_true`, and false
121    /// uses the element from `if_false`.
122    #[inline]
123    #[must_use]
124    pub fn select(mask: BVec4, if_true: Self, if_false: Self) -> Self {
125        Self::new(
126            if mask.test(0) { if_true.x } else { if_false.x },
127            if mask.test(1) { if_true.y } else { if_false.y },
128            if mask.test(2) { if_true.z } else { if_false.z },
129            if mask.test(3) { if_true.w } else { if_false.w },
130        )
131    }
132
133    /// Creates a new vector from an array.
134    #[inline]
135    #[must_use]
136    pub const fn from_array(a: [usize; 4]) -> Self {
137        Self::new(a[0], a[1], a[2], a[3])
138    }
139
140    /// Converts `self` to `[x, y, z, w]`
141    #[inline]
142    #[must_use]
143    pub const fn to_array(&self) -> [usize; 4] {
144        [self.x, self.y, self.z, self.w]
145    }
146
147    /// Creates a vector from the first 4 values in `slice`.
148    ///
149    /// # Panics
150    ///
151    /// Panics if `slice` is less than 4 elements long.
152    #[inline]
153    #[must_use]
154    pub const fn from_slice(slice: &[usize]) -> Self {
155        assert!(slice.len() >= 4);
156        Self::new(slice[0], slice[1], slice[2], slice[3])
157    }
158
159    /// Writes the elements of `self` to the first 4 elements in `slice`.
160    ///
161    /// # Panics
162    ///
163    /// Panics if `slice` is less than 4 elements long.
164    #[inline]
165    pub fn write_to_slice(self, slice: &mut [usize]) {
166        slice[..4].copy_from_slice(&self.to_array());
167    }
168
169    /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`.
170    ///
171    /// Truncation to [`USizeVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()].
172    #[inline]
173    #[must_use]
174    pub fn truncate(self) -> USizeVec3 {
175        use crate::swizzles::Vec4Swizzles;
176        self.xyz()
177    }
178
179    /// Creates a 4D vector from `self` with the given value of `x`.
180    #[inline]
181    #[must_use]
182    pub fn with_x(mut self, x: usize) -> Self {
183        self.x = x;
184        self
185    }
186
187    /// Creates a 4D vector from `self` with the given value of `y`.
188    #[inline]
189    #[must_use]
190    pub fn with_y(mut self, y: usize) -> Self {
191        self.y = y;
192        self
193    }
194
195    /// Creates a 4D vector from `self` with the given value of `z`.
196    #[inline]
197    #[must_use]
198    pub fn with_z(mut self, z: usize) -> Self {
199        self.z = z;
200        self
201    }
202
203    /// Creates a 4D vector from `self` with the given value of `w`.
204    #[inline]
205    #[must_use]
206    pub fn with_w(mut self, w: usize) -> Self {
207        self.w = w;
208        self
209    }
210
211    /// Computes the dot product of `self` and `rhs`.
212    #[inline]
213    #[must_use]
214    pub fn dot(self, rhs: Self) -> usize {
215        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z) + (self.w * rhs.w)
216    }
217
218    /// Returns a vector where every component is the dot product of `self` and `rhs`.
219    #[inline]
220    #[must_use]
221    pub fn dot_into_vec(self, rhs: Self) -> Self {
222        Self::splat(self.dot(rhs))
223    }
224
225    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
226    ///
227    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
228    #[inline]
229    #[must_use]
230    pub fn min(self, rhs: Self) -> Self {
231        Self::new(
232            if self.x < rhs.x { self.x } else { rhs.x },
233            if self.y < rhs.y { self.y } else { rhs.y },
234            if self.z < rhs.z { self.z } else { rhs.z },
235            if self.w < rhs.w { self.w } else { rhs.w },
236        )
237    }
238
239    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
240    ///
241    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
242    #[inline]
243    #[must_use]
244    pub fn max(self, rhs: Self) -> Self {
245        Self::new(
246            if self.x > rhs.x { self.x } else { rhs.x },
247            if self.y > rhs.y { self.y } else { rhs.y },
248            if self.z > rhs.z { self.z } else { rhs.z },
249            if self.w > rhs.w { self.w } else { rhs.w },
250        )
251    }
252
253    /// Component-wise clamping of values, similar to [`usize::clamp`].
254    ///
255    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
256    ///
257    /// # Panics
258    ///
259    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
260    #[inline]
261    #[must_use]
262    pub fn clamp(self, min: Self, max: Self) -> Self {
263        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
264        self.max(min).min(max)
265    }
266
267    /// Returns the horizontal minimum of `self`.
268    ///
269    /// In other words this computes `min(x, y, ..)`.
270    #[inline]
271    #[must_use]
272    pub fn min_element(self) -> usize {
273        let min = |a, b| if a < b { a } else { b };
274        min(self.x, min(self.y, min(self.z, self.w)))
275    }
276
277    /// Returns the horizontal maximum of `self`.
278    ///
279    /// In other words this computes `max(x, y, ..)`.
280    #[inline]
281    #[must_use]
282    pub fn max_element(self) -> usize {
283        let max = |a, b| if a > b { a } else { b };
284        max(self.x, max(self.y, max(self.z, self.w)))
285    }
286
287    /// Returns the index of the first minimum element of `self`.
288    #[doc(alias = "argmin")]
289    #[inline]
290    #[must_use]
291    pub fn min_position(self) -> usize {
292        let mut min = self.x;
293        let mut index = 0;
294        if self.y < min {
295            min = self.y;
296            index = 1;
297        }
298        if self.z < min {
299            min = self.z;
300            index = 2;
301        }
302        if self.w < min {
303            index = 3;
304        }
305        index
306    }
307
308    /// Returns the index of the first maximum element of `self`.
309    #[doc(alias = "argmax")]
310    #[inline]
311    #[must_use]
312    pub fn max_position(self) -> usize {
313        let mut max = self.x;
314        let mut index = 0;
315        if self.y > max {
316            max = self.y;
317            index = 1;
318        }
319        if self.z > max {
320            max = self.z;
321            index = 2;
322        }
323        if self.w > max {
324            index = 3;
325        }
326        index
327    }
328
329    /// Returns the sum of all elements of `self`.
330    ///
331    /// In other words, this computes `self.x + self.y + ..`.
332    #[inline]
333    #[must_use]
334    pub fn element_sum(self) -> usize {
335        self.x + self.y + self.z + self.w
336    }
337
338    /// Returns the product of all elements of `self`.
339    ///
340    /// In other words, this computes `self.x * self.y * ..`.
341    #[inline]
342    #[must_use]
343    pub fn element_product(self) -> usize {
344        self.x * self.y * self.z * self.w
345    }
346
347    /// Returns a vector mask containing the result of a `==` comparison for each element of
348    /// `self` and `rhs`.
349    ///
350    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
351    /// elements.
352    #[inline]
353    #[must_use]
354    pub fn cmpeq(self, rhs: Self) -> BVec4 {
355        BVec4::new(
356            self.x.eq(&rhs.x),
357            self.y.eq(&rhs.y),
358            self.z.eq(&rhs.z),
359            self.w.eq(&rhs.w),
360        )
361    }
362
363    /// Returns a vector mask containing the result of a `!=` comparison for each element of
364    /// `self` and `rhs`.
365    ///
366    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
367    /// elements.
368    #[inline]
369    #[must_use]
370    pub fn cmpne(self, rhs: Self) -> BVec4 {
371        BVec4::new(
372            self.x.ne(&rhs.x),
373            self.y.ne(&rhs.y),
374            self.z.ne(&rhs.z),
375            self.w.ne(&rhs.w),
376        )
377    }
378
379    /// Returns a vector mask containing the result of a `>=` comparison for each element of
380    /// `self` and `rhs`.
381    ///
382    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
383    /// elements.
384    #[inline]
385    #[must_use]
386    pub fn cmpge(self, rhs: Self) -> BVec4 {
387        BVec4::new(
388            self.x.ge(&rhs.x),
389            self.y.ge(&rhs.y),
390            self.z.ge(&rhs.z),
391            self.w.ge(&rhs.w),
392        )
393    }
394
395    /// Returns a vector mask containing the result of a `>` comparison for each element of
396    /// `self` and `rhs`.
397    ///
398    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
399    /// elements.
400    #[inline]
401    #[must_use]
402    pub fn cmpgt(self, rhs: Self) -> BVec4 {
403        BVec4::new(
404            self.x.gt(&rhs.x),
405            self.y.gt(&rhs.y),
406            self.z.gt(&rhs.z),
407            self.w.gt(&rhs.w),
408        )
409    }
410
411    /// Returns a vector mask containing the result of a `<=` comparison for each element of
412    /// `self` and `rhs`.
413    ///
414    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
415    /// elements.
416    #[inline]
417    #[must_use]
418    pub fn cmple(self, rhs: Self) -> BVec4 {
419        BVec4::new(
420            self.x.le(&rhs.x),
421            self.y.le(&rhs.y),
422            self.z.le(&rhs.z),
423            self.w.le(&rhs.w),
424        )
425    }
426
427    /// Returns a vector mask containing the result of a `<` comparison for each element of
428    /// `self` and `rhs`.
429    ///
430    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
431    /// elements.
432    #[inline]
433    #[must_use]
434    pub fn cmplt(self, rhs: Self) -> BVec4 {
435        BVec4::new(
436            self.x.lt(&rhs.x),
437            self.y.lt(&rhs.y),
438            self.z.lt(&rhs.z),
439            self.w.lt(&rhs.w),
440        )
441    }
442
443    /// Computes the squared length of `self`.
444    #[doc(alias = "magnitude2")]
445    #[inline]
446    #[must_use]
447    pub fn length_squared(self) -> usize {
448        self.dot(self)
449    }
450
451    /// Computes the [manhattan distance] between two points.
452    ///
453    /// # Overflow
454    /// This method may overflow if the result is greater than [`usize::MAX`].
455    ///
456    /// See also [`checked_manhattan_distance`][USizeVec4::checked_manhattan_distance].
457    ///
458    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
459    #[inline]
460    #[must_use]
461    pub fn manhattan_distance(self, rhs: Self) -> usize {
462        self.x.abs_diff(rhs.x)
463            + self.y.abs_diff(rhs.y)
464            + self.z.abs_diff(rhs.z)
465            + self.w.abs_diff(rhs.w)
466    }
467
468    /// Computes the [manhattan distance] between two points.
469    ///
470    /// This will returns [`None`] if the result is greater than [`usize::MAX`].
471    ///
472    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
473    #[inline]
474    #[must_use]
475    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<usize> {
476        let d = self.x.abs_diff(rhs.x);
477        let d = d.checked_add(self.y.abs_diff(rhs.y))?;
478        let d = d.checked_add(self.z.abs_diff(rhs.z))?;
479        d.checked_add(self.w.abs_diff(rhs.w))
480    }
481
482    /// Computes the [chebyshev distance] between two points.
483    ///
484    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
485    #[inline]
486    #[must_use]
487    pub fn chebyshev_distance(self, rhs: Self) -> usize {
488        // Note: the compiler will eventually optimize out the loop
489        [
490            self.x.abs_diff(rhs.x),
491            self.y.abs_diff(rhs.y),
492            self.z.abs_diff(rhs.z),
493            self.w.abs_diff(rhs.w),
494        ]
495        .into_iter()
496        .max()
497        .unwrap()
498    }
499
500    /// Casts all elements of `self` to `f32`.
501    #[inline]
502    #[must_use]
503    pub fn as_vec4(self) -> crate::Vec4 {
504        crate::Vec4::new(self.x as f32, self.y as f32, self.z as f32, self.w as f32)
505    }
506
507    /// Casts all elements of `self` to `f64`.
508    #[cfg(feature = "f64")]
509    #[inline]
510    #[must_use]
511    pub fn as_dvec4(self) -> crate::DVec4 {
512        crate::DVec4::new(self.x as f64, self.y as f64, self.z as f64, self.w as f64)
513    }
514
515    /// Casts all elements of `self` to `i8`.
516    #[cfg(feature = "i8")]
517    #[inline]
518    #[must_use]
519    pub fn as_i8vec4(self) -> crate::I8Vec4 {
520        crate::I8Vec4::new(self.x as i8, self.y as i8, self.z as i8, self.w as i8)
521    }
522
523    /// Casts all elements of `self` to `u8`.
524    #[cfg(feature = "u8")]
525    #[inline]
526    #[must_use]
527    pub fn as_u8vec4(self) -> crate::U8Vec4 {
528        crate::U8Vec4::new(self.x as u8, self.y as u8, self.z as u8, self.w as u8)
529    }
530
531    /// Casts all elements of `self` to `i16`.
532    #[cfg(feature = "i16")]
533    #[inline]
534    #[must_use]
535    pub fn as_i16vec4(self) -> crate::I16Vec4 {
536        crate::I16Vec4::new(self.x as i16, self.y as i16, self.z as i16, self.w as i16)
537    }
538
539    /// Casts all elements of `self` to `u16`.
540    #[cfg(feature = "u16")]
541    #[inline]
542    #[must_use]
543    pub fn as_u16vec4(self) -> crate::U16Vec4 {
544        crate::U16Vec4::new(self.x as u16, self.y as u16, self.z as u16, self.w as u16)
545    }
546
547    /// Casts all elements of `self` to `i32`.
548    #[cfg(feature = "i32")]
549    #[inline]
550    #[must_use]
551    pub fn as_ivec4(self) -> crate::IVec4 {
552        crate::IVec4::new(self.x as i32, self.y as i32, self.z as i32, self.w as i32)
553    }
554
555    /// Casts all elements of `self` to `u32`.
556    #[cfg(feature = "u32")]
557    #[inline]
558    #[must_use]
559    pub fn as_uvec4(self) -> crate::UVec4 {
560        crate::UVec4::new(self.x as u32, self.y as u32, self.z as u32, self.w as u32)
561    }
562
563    /// Casts all elements of `self` to `i64`.
564    #[cfg(feature = "i64")]
565    #[inline]
566    #[must_use]
567    pub fn as_i64vec4(self) -> crate::I64Vec4 {
568        crate::I64Vec4::new(self.x as i64, self.y as i64, self.z as i64, self.w as i64)
569    }
570
571    /// Casts all elements of `self` to `u64`.
572    #[cfg(feature = "u64")]
573    #[inline]
574    #[must_use]
575    pub fn as_u64vec4(self) -> crate::U64Vec4 {
576        crate::U64Vec4::new(self.x as u64, self.y as u64, self.z as u64, self.w as u64)
577    }
578
579    /// Casts all elements of `self` to `isize`.
580    #[cfg(feature = "isize")]
581    #[inline]
582    #[must_use]
583    pub fn as_isizevec4(self) -> crate::ISizeVec4 {
584        crate::ISizeVec4::new(
585            self.x as isize,
586            self.y as isize,
587            self.z as isize,
588            self.w as isize,
589        )
590    }
591
592    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
593    ///
594    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
595    #[inline]
596    #[must_use]
597    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
598        let x = match self.x.checked_add(rhs.x) {
599            Some(v) => v,
600            None => return None,
601        };
602        let y = match self.y.checked_add(rhs.y) {
603            Some(v) => v,
604            None => return None,
605        };
606        let z = match self.z.checked_add(rhs.z) {
607            Some(v) => v,
608            None => return None,
609        };
610        let w = match self.w.checked_add(rhs.w) {
611            Some(v) => v,
612            None => return None,
613        };
614
615        Some(Self { x, y, z, w })
616    }
617
618    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
619    ///
620    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
621    #[inline]
622    #[must_use]
623    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
624        let x = match self.x.checked_sub(rhs.x) {
625            Some(v) => v,
626            None => return None,
627        };
628        let y = match self.y.checked_sub(rhs.y) {
629            Some(v) => v,
630            None => return None,
631        };
632        let z = match self.z.checked_sub(rhs.z) {
633            Some(v) => v,
634            None => return None,
635        };
636        let w = match self.w.checked_sub(rhs.w) {
637            Some(v) => v,
638            None => return None,
639        };
640
641        Some(Self { x, y, z, w })
642    }
643
644    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
645    ///
646    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
647    #[inline]
648    #[must_use]
649    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
650        let x = match self.x.checked_mul(rhs.x) {
651            Some(v) => v,
652            None => return None,
653        };
654        let y = match self.y.checked_mul(rhs.y) {
655            Some(v) => v,
656            None => return None,
657        };
658        let z = match self.z.checked_mul(rhs.z) {
659            Some(v) => v,
660            None => return None,
661        };
662        let w = match self.w.checked_mul(rhs.w) {
663            Some(v) => v,
664            None => return None,
665        };
666
667        Some(Self { x, y, z, w })
668    }
669
670    /// Returns a vector containing the wrapping division of `self` and `rhs`.
671    ///
672    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
673    #[inline]
674    #[must_use]
675    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
676        let x = match self.x.checked_div(rhs.x) {
677            Some(v) => v,
678            None => return None,
679        };
680        let y = match self.y.checked_div(rhs.y) {
681            Some(v) => v,
682            None => return None,
683        };
684        let z = match self.z.checked_div(rhs.z) {
685            Some(v) => v,
686            None => return None,
687        };
688        let w = match self.w.checked_div(rhs.w) {
689            Some(v) => v,
690            None => return None,
691        };
692
693        Some(Self { x, y, z, w })
694    }
695
696    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
697    ///
698    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
699    #[inline]
700    #[must_use]
701    pub const fn wrapping_add(self, rhs: Self) -> Self {
702        Self {
703            x: self.x.wrapping_add(rhs.x),
704            y: self.y.wrapping_add(rhs.y),
705            z: self.z.wrapping_add(rhs.z),
706            w: self.w.wrapping_add(rhs.w),
707        }
708    }
709
710    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
711    ///
712    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
713    #[inline]
714    #[must_use]
715    pub const fn wrapping_sub(self, rhs: Self) -> Self {
716        Self {
717            x: self.x.wrapping_sub(rhs.x),
718            y: self.y.wrapping_sub(rhs.y),
719            z: self.z.wrapping_sub(rhs.z),
720            w: self.w.wrapping_sub(rhs.w),
721        }
722    }
723
724    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
725    ///
726    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
727    #[inline]
728    #[must_use]
729    pub const fn wrapping_mul(self, rhs: Self) -> Self {
730        Self {
731            x: self.x.wrapping_mul(rhs.x),
732            y: self.y.wrapping_mul(rhs.y),
733            z: self.z.wrapping_mul(rhs.z),
734            w: self.w.wrapping_mul(rhs.w),
735        }
736    }
737
738    /// Returns a vector containing the wrapping division of `self` and `rhs`.
739    ///
740    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
741    #[inline]
742    #[must_use]
743    pub const fn wrapping_div(self, rhs: Self) -> Self {
744        Self {
745            x: self.x.wrapping_div(rhs.x),
746            y: self.y.wrapping_div(rhs.y),
747            z: self.z.wrapping_div(rhs.z),
748            w: self.w.wrapping_div(rhs.w),
749        }
750    }
751
752    /// Returns a vector containing the saturating addition of `self` and `rhs`.
753    ///
754    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
755    #[inline]
756    #[must_use]
757    pub const fn saturating_add(self, rhs: Self) -> Self {
758        Self {
759            x: self.x.saturating_add(rhs.x),
760            y: self.y.saturating_add(rhs.y),
761            z: self.z.saturating_add(rhs.z),
762            w: self.w.saturating_add(rhs.w),
763        }
764    }
765
766    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
767    ///
768    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
769    #[inline]
770    #[must_use]
771    pub const fn saturating_sub(self, rhs: Self) -> Self {
772        Self {
773            x: self.x.saturating_sub(rhs.x),
774            y: self.y.saturating_sub(rhs.y),
775            z: self.z.saturating_sub(rhs.z),
776            w: self.w.saturating_sub(rhs.w),
777        }
778    }
779
780    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
781    ///
782    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
783    #[inline]
784    #[must_use]
785    pub const fn saturating_mul(self, rhs: Self) -> Self {
786        Self {
787            x: self.x.saturating_mul(rhs.x),
788            y: self.y.saturating_mul(rhs.y),
789            z: self.z.saturating_mul(rhs.z),
790            w: self.w.saturating_mul(rhs.w),
791        }
792    }
793
794    /// Returns a vector containing the saturating division of `self` and `rhs`.
795    ///
796    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
797    #[inline]
798    #[must_use]
799    pub const fn saturating_div(self, rhs: Self) -> Self {
800        Self {
801            x: self.x.saturating_div(rhs.x),
802            y: self.y.saturating_div(rhs.y),
803            z: self.z.saturating_div(rhs.z),
804            w: self.w.saturating_div(rhs.w),
805        }
806    }
807
808    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
809    ///
810    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
811    #[cfg(feature = "isize")]
812    #[inline]
813    #[must_use]
814    pub const fn checked_add_signed(self, rhs: ISizeVec4) -> Option<Self> {
815        let x = match self.x.checked_add_signed(rhs.x) {
816            Some(v) => v,
817            None => return None,
818        };
819        let y = match self.y.checked_add_signed(rhs.y) {
820            Some(v) => v,
821            None => return None,
822        };
823        let z = match self.z.checked_add_signed(rhs.z) {
824            Some(v) => v,
825            None => return None,
826        };
827        let w = match self.w.checked_add_signed(rhs.w) {
828            Some(v) => v,
829            None => return None,
830        };
831
832        Some(Self { x, y, z, w })
833    }
834
835    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
836    ///
837    /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`.
838    #[cfg(feature = "isize")]
839    #[inline]
840    #[must_use]
841    pub const fn wrapping_add_signed(self, rhs: ISizeVec4) -> Self {
842        Self {
843            x: self.x.wrapping_add_signed(rhs.x),
844            y: self.y.wrapping_add_signed(rhs.y),
845            z: self.z.wrapping_add_signed(rhs.z),
846            w: self.w.wrapping_add_signed(rhs.w),
847        }
848    }
849
850    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
851    ///
852    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
853    #[cfg(feature = "isize")]
854    #[inline]
855    #[must_use]
856    pub const fn saturating_add_signed(self, rhs: ISizeVec4) -> Self {
857        Self {
858            x: self.x.saturating_add_signed(rhs.x),
859            y: self.y.saturating_add_signed(rhs.y),
860            z: self.z.saturating_add_signed(rhs.z),
861            w: self.w.saturating_add_signed(rhs.w),
862        }
863    }
864}
865
866impl Default for USizeVec4 {
867    #[inline(always)]
868    fn default() -> Self {
869        Self::ZERO
870    }
871}
872
873impl Div for USizeVec4 {
874    type Output = Self;
875    #[inline]
876    fn div(self, rhs: Self) -> Self {
877        Self::new(
878            self.x.div(rhs.x),
879            self.y.div(rhs.y),
880            self.z.div(rhs.z),
881            self.w.div(rhs.w),
882        )
883    }
884}
885
886impl Div<&Self> for USizeVec4 {
887    type Output = Self;
888    #[inline]
889    fn div(self, rhs: &Self) -> Self {
890        self.div(*rhs)
891    }
892}
893
894impl Div<&USizeVec4> for &USizeVec4 {
895    type Output = USizeVec4;
896    #[inline]
897    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
898        (*self).div(*rhs)
899    }
900}
901
902impl Div<USizeVec4> for &USizeVec4 {
903    type Output = USizeVec4;
904    #[inline]
905    fn div(self, rhs: USizeVec4) -> USizeVec4 {
906        (*self).div(rhs)
907    }
908}
909
910impl DivAssign for USizeVec4 {
911    #[inline]
912    fn div_assign(&mut self, rhs: Self) {
913        self.x.div_assign(rhs.x);
914        self.y.div_assign(rhs.y);
915        self.z.div_assign(rhs.z);
916        self.w.div_assign(rhs.w);
917    }
918}
919
920impl DivAssign<&Self> for USizeVec4 {
921    #[inline]
922    fn div_assign(&mut self, rhs: &Self) {
923        self.div_assign(*rhs);
924    }
925}
926
927impl Div<usize> for USizeVec4 {
928    type Output = Self;
929    #[inline]
930    fn div(self, rhs: usize) -> Self {
931        Self::new(
932            self.x.div(rhs),
933            self.y.div(rhs),
934            self.z.div(rhs),
935            self.w.div(rhs),
936        )
937    }
938}
939
940impl Div<&usize> for USizeVec4 {
941    type Output = Self;
942    #[inline]
943    fn div(self, rhs: &usize) -> Self {
944        self.div(*rhs)
945    }
946}
947
948impl Div<&usize> for &USizeVec4 {
949    type Output = USizeVec4;
950    #[inline]
951    fn div(self, rhs: &usize) -> USizeVec4 {
952        (*self).div(*rhs)
953    }
954}
955
956impl Div<usize> for &USizeVec4 {
957    type Output = USizeVec4;
958    #[inline]
959    fn div(self, rhs: usize) -> USizeVec4 {
960        (*self).div(rhs)
961    }
962}
963
964impl DivAssign<usize> for USizeVec4 {
965    #[inline]
966    fn div_assign(&mut self, rhs: usize) {
967        self.x.div_assign(rhs);
968        self.y.div_assign(rhs);
969        self.z.div_assign(rhs);
970        self.w.div_assign(rhs);
971    }
972}
973
974impl DivAssign<&usize> for USizeVec4 {
975    #[inline]
976    fn div_assign(&mut self, rhs: &usize) {
977        self.div_assign(*rhs);
978    }
979}
980
981impl Div<USizeVec4> for usize {
982    type Output = USizeVec4;
983    #[inline]
984    fn div(self, rhs: USizeVec4) -> USizeVec4 {
985        USizeVec4::new(
986            self.div(rhs.x),
987            self.div(rhs.y),
988            self.div(rhs.z),
989            self.div(rhs.w),
990        )
991    }
992}
993
994impl Div<&USizeVec4> for usize {
995    type Output = USizeVec4;
996    #[inline]
997    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
998        self.div(*rhs)
999    }
1000}
1001
1002impl Div<&USizeVec4> for &usize {
1003    type Output = USizeVec4;
1004    #[inline]
1005    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
1006        (*self).div(*rhs)
1007    }
1008}
1009
1010impl Div<USizeVec4> for &usize {
1011    type Output = USizeVec4;
1012    #[inline]
1013    fn div(self, rhs: USizeVec4) -> USizeVec4 {
1014        (*self).div(rhs)
1015    }
1016}
1017
1018impl Mul for USizeVec4 {
1019    type Output = Self;
1020    #[inline]
1021    fn mul(self, rhs: Self) -> Self {
1022        Self::new(
1023            self.x.mul(rhs.x),
1024            self.y.mul(rhs.y),
1025            self.z.mul(rhs.z),
1026            self.w.mul(rhs.w),
1027        )
1028    }
1029}
1030
1031impl Mul<&Self> for USizeVec4 {
1032    type Output = Self;
1033    #[inline]
1034    fn mul(self, rhs: &Self) -> Self {
1035        self.mul(*rhs)
1036    }
1037}
1038
1039impl Mul<&USizeVec4> for &USizeVec4 {
1040    type Output = USizeVec4;
1041    #[inline]
1042    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
1043        (*self).mul(*rhs)
1044    }
1045}
1046
1047impl Mul<USizeVec4> for &USizeVec4 {
1048    type Output = USizeVec4;
1049    #[inline]
1050    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
1051        (*self).mul(rhs)
1052    }
1053}
1054
1055impl MulAssign for USizeVec4 {
1056    #[inline]
1057    fn mul_assign(&mut self, rhs: Self) {
1058        self.x.mul_assign(rhs.x);
1059        self.y.mul_assign(rhs.y);
1060        self.z.mul_assign(rhs.z);
1061        self.w.mul_assign(rhs.w);
1062    }
1063}
1064
1065impl MulAssign<&Self> for USizeVec4 {
1066    #[inline]
1067    fn mul_assign(&mut self, rhs: &Self) {
1068        self.mul_assign(*rhs);
1069    }
1070}
1071
1072impl Mul<usize> for USizeVec4 {
1073    type Output = Self;
1074    #[inline]
1075    fn mul(self, rhs: usize) -> Self {
1076        Self::new(
1077            self.x.mul(rhs),
1078            self.y.mul(rhs),
1079            self.z.mul(rhs),
1080            self.w.mul(rhs),
1081        )
1082    }
1083}
1084
1085impl Mul<&usize> for USizeVec4 {
1086    type Output = Self;
1087    #[inline]
1088    fn mul(self, rhs: &usize) -> Self {
1089        self.mul(*rhs)
1090    }
1091}
1092
1093impl Mul<&usize> for &USizeVec4 {
1094    type Output = USizeVec4;
1095    #[inline]
1096    fn mul(self, rhs: &usize) -> USizeVec4 {
1097        (*self).mul(*rhs)
1098    }
1099}
1100
1101impl Mul<usize> for &USizeVec4 {
1102    type Output = USizeVec4;
1103    #[inline]
1104    fn mul(self, rhs: usize) -> USizeVec4 {
1105        (*self).mul(rhs)
1106    }
1107}
1108
1109impl MulAssign<usize> for USizeVec4 {
1110    #[inline]
1111    fn mul_assign(&mut self, rhs: usize) {
1112        self.x.mul_assign(rhs);
1113        self.y.mul_assign(rhs);
1114        self.z.mul_assign(rhs);
1115        self.w.mul_assign(rhs);
1116    }
1117}
1118
1119impl MulAssign<&usize> for USizeVec4 {
1120    #[inline]
1121    fn mul_assign(&mut self, rhs: &usize) {
1122        self.mul_assign(*rhs);
1123    }
1124}
1125
1126impl Mul<USizeVec4> for usize {
1127    type Output = USizeVec4;
1128    #[inline]
1129    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
1130        USizeVec4::new(
1131            self.mul(rhs.x),
1132            self.mul(rhs.y),
1133            self.mul(rhs.z),
1134            self.mul(rhs.w),
1135        )
1136    }
1137}
1138
1139impl Mul<&USizeVec4> for usize {
1140    type Output = USizeVec4;
1141    #[inline]
1142    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
1143        self.mul(*rhs)
1144    }
1145}
1146
1147impl Mul<&USizeVec4> for &usize {
1148    type Output = USizeVec4;
1149    #[inline]
1150    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
1151        (*self).mul(*rhs)
1152    }
1153}
1154
1155impl Mul<USizeVec4> for &usize {
1156    type Output = USizeVec4;
1157    #[inline]
1158    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
1159        (*self).mul(rhs)
1160    }
1161}
1162
1163impl Add for USizeVec4 {
1164    type Output = Self;
1165    #[inline]
1166    fn add(self, rhs: Self) -> Self {
1167        Self::new(
1168            self.x.add(rhs.x),
1169            self.y.add(rhs.y),
1170            self.z.add(rhs.z),
1171            self.w.add(rhs.w),
1172        )
1173    }
1174}
1175
1176impl Add<&Self> for USizeVec4 {
1177    type Output = Self;
1178    #[inline]
1179    fn add(self, rhs: &Self) -> Self {
1180        self.add(*rhs)
1181    }
1182}
1183
1184impl Add<&USizeVec4> for &USizeVec4 {
1185    type Output = USizeVec4;
1186    #[inline]
1187    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
1188        (*self).add(*rhs)
1189    }
1190}
1191
1192impl Add<USizeVec4> for &USizeVec4 {
1193    type Output = USizeVec4;
1194    #[inline]
1195    fn add(self, rhs: USizeVec4) -> USizeVec4 {
1196        (*self).add(rhs)
1197    }
1198}
1199
1200impl AddAssign for USizeVec4 {
1201    #[inline]
1202    fn add_assign(&mut self, rhs: Self) {
1203        self.x.add_assign(rhs.x);
1204        self.y.add_assign(rhs.y);
1205        self.z.add_assign(rhs.z);
1206        self.w.add_assign(rhs.w);
1207    }
1208}
1209
1210impl AddAssign<&Self> for USizeVec4 {
1211    #[inline]
1212    fn add_assign(&mut self, rhs: &Self) {
1213        self.add_assign(*rhs);
1214    }
1215}
1216
1217impl Add<usize> for USizeVec4 {
1218    type Output = Self;
1219    #[inline]
1220    fn add(self, rhs: usize) -> Self {
1221        Self::new(
1222            self.x.add(rhs),
1223            self.y.add(rhs),
1224            self.z.add(rhs),
1225            self.w.add(rhs),
1226        )
1227    }
1228}
1229
1230impl Add<&usize> for USizeVec4 {
1231    type Output = Self;
1232    #[inline]
1233    fn add(self, rhs: &usize) -> Self {
1234        self.add(*rhs)
1235    }
1236}
1237
1238impl Add<&usize> for &USizeVec4 {
1239    type Output = USizeVec4;
1240    #[inline]
1241    fn add(self, rhs: &usize) -> USizeVec4 {
1242        (*self).add(*rhs)
1243    }
1244}
1245
1246impl Add<usize> for &USizeVec4 {
1247    type Output = USizeVec4;
1248    #[inline]
1249    fn add(self, rhs: usize) -> USizeVec4 {
1250        (*self).add(rhs)
1251    }
1252}
1253
1254impl AddAssign<usize> for USizeVec4 {
1255    #[inline]
1256    fn add_assign(&mut self, rhs: usize) {
1257        self.x.add_assign(rhs);
1258        self.y.add_assign(rhs);
1259        self.z.add_assign(rhs);
1260        self.w.add_assign(rhs);
1261    }
1262}
1263
1264impl AddAssign<&usize> for USizeVec4 {
1265    #[inline]
1266    fn add_assign(&mut self, rhs: &usize) {
1267        self.add_assign(*rhs);
1268    }
1269}
1270
1271impl Add<USizeVec4> for usize {
1272    type Output = USizeVec4;
1273    #[inline]
1274    fn add(self, rhs: USizeVec4) -> USizeVec4 {
1275        USizeVec4::new(
1276            self.add(rhs.x),
1277            self.add(rhs.y),
1278            self.add(rhs.z),
1279            self.add(rhs.w),
1280        )
1281    }
1282}
1283
1284impl Add<&USizeVec4> for usize {
1285    type Output = USizeVec4;
1286    #[inline]
1287    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
1288        self.add(*rhs)
1289    }
1290}
1291
1292impl Add<&USizeVec4> for &usize {
1293    type Output = USizeVec4;
1294    #[inline]
1295    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
1296        (*self).add(*rhs)
1297    }
1298}
1299
1300impl Add<USizeVec4> for &usize {
1301    type Output = USizeVec4;
1302    #[inline]
1303    fn add(self, rhs: USizeVec4) -> USizeVec4 {
1304        (*self).add(rhs)
1305    }
1306}
1307
1308impl Sub for USizeVec4 {
1309    type Output = Self;
1310    #[inline]
1311    fn sub(self, rhs: Self) -> Self {
1312        Self::new(
1313            self.x.sub(rhs.x),
1314            self.y.sub(rhs.y),
1315            self.z.sub(rhs.z),
1316            self.w.sub(rhs.w),
1317        )
1318    }
1319}
1320
1321impl Sub<&Self> for USizeVec4 {
1322    type Output = Self;
1323    #[inline]
1324    fn sub(self, rhs: &Self) -> Self {
1325        self.sub(*rhs)
1326    }
1327}
1328
1329impl Sub<&USizeVec4> for &USizeVec4 {
1330    type Output = USizeVec4;
1331    #[inline]
1332    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
1333        (*self).sub(*rhs)
1334    }
1335}
1336
1337impl Sub<USizeVec4> for &USizeVec4 {
1338    type Output = USizeVec4;
1339    #[inline]
1340    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
1341        (*self).sub(rhs)
1342    }
1343}
1344
1345impl SubAssign for USizeVec4 {
1346    #[inline]
1347    fn sub_assign(&mut self, rhs: Self) {
1348        self.x.sub_assign(rhs.x);
1349        self.y.sub_assign(rhs.y);
1350        self.z.sub_assign(rhs.z);
1351        self.w.sub_assign(rhs.w);
1352    }
1353}
1354
1355impl SubAssign<&Self> for USizeVec4 {
1356    #[inline]
1357    fn sub_assign(&mut self, rhs: &Self) {
1358        self.sub_assign(*rhs);
1359    }
1360}
1361
1362impl Sub<usize> for USizeVec4 {
1363    type Output = Self;
1364    #[inline]
1365    fn sub(self, rhs: usize) -> Self {
1366        Self::new(
1367            self.x.sub(rhs),
1368            self.y.sub(rhs),
1369            self.z.sub(rhs),
1370            self.w.sub(rhs),
1371        )
1372    }
1373}
1374
1375impl Sub<&usize> for USizeVec4 {
1376    type Output = Self;
1377    #[inline]
1378    fn sub(self, rhs: &usize) -> Self {
1379        self.sub(*rhs)
1380    }
1381}
1382
1383impl Sub<&usize> for &USizeVec4 {
1384    type Output = USizeVec4;
1385    #[inline]
1386    fn sub(self, rhs: &usize) -> USizeVec4 {
1387        (*self).sub(*rhs)
1388    }
1389}
1390
1391impl Sub<usize> for &USizeVec4 {
1392    type Output = USizeVec4;
1393    #[inline]
1394    fn sub(self, rhs: usize) -> USizeVec4 {
1395        (*self).sub(rhs)
1396    }
1397}
1398
1399impl SubAssign<usize> for USizeVec4 {
1400    #[inline]
1401    fn sub_assign(&mut self, rhs: usize) {
1402        self.x.sub_assign(rhs);
1403        self.y.sub_assign(rhs);
1404        self.z.sub_assign(rhs);
1405        self.w.sub_assign(rhs);
1406    }
1407}
1408
1409impl SubAssign<&usize> for USizeVec4 {
1410    #[inline]
1411    fn sub_assign(&mut self, rhs: &usize) {
1412        self.sub_assign(*rhs);
1413    }
1414}
1415
1416impl Sub<USizeVec4> for usize {
1417    type Output = USizeVec4;
1418    #[inline]
1419    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
1420        USizeVec4::new(
1421            self.sub(rhs.x),
1422            self.sub(rhs.y),
1423            self.sub(rhs.z),
1424            self.sub(rhs.w),
1425        )
1426    }
1427}
1428
1429impl Sub<&USizeVec4> for usize {
1430    type Output = USizeVec4;
1431    #[inline]
1432    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
1433        self.sub(*rhs)
1434    }
1435}
1436
1437impl Sub<&USizeVec4> for &usize {
1438    type Output = USizeVec4;
1439    #[inline]
1440    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
1441        (*self).sub(*rhs)
1442    }
1443}
1444
1445impl Sub<USizeVec4> for &usize {
1446    type Output = USizeVec4;
1447    #[inline]
1448    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
1449        (*self).sub(rhs)
1450    }
1451}
1452
1453impl Rem for USizeVec4 {
1454    type Output = Self;
1455    #[inline]
1456    fn rem(self, rhs: Self) -> Self {
1457        Self::new(
1458            self.x.rem(rhs.x),
1459            self.y.rem(rhs.y),
1460            self.z.rem(rhs.z),
1461            self.w.rem(rhs.w),
1462        )
1463    }
1464}
1465
1466impl Rem<&Self> for USizeVec4 {
1467    type Output = Self;
1468    #[inline]
1469    fn rem(self, rhs: &Self) -> Self {
1470        self.rem(*rhs)
1471    }
1472}
1473
1474impl Rem<&USizeVec4> for &USizeVec4 {
1475    type Output = USizeVec4;
1476    #[inline]
1477    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
1478        (*self).rem(*rhs)
1479    }
1480}
1481
1482impl Rem<USizeVec4> for &USizeVec4 {
1483    type Output = USizeVec4;
1484    #[inline]
1485    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
1486        (*self).rem(rhs)
1487    }
1488}
1489
1490impl RemAssign for USizeVec4 {
1491    #[inline]
1492    fn rem_assign(&mut self, rhs: Self) {
1493        self.x.rem_assign(rhs.x);
1494        self.y.rem_assign(rhs.y);
1495        self.z.rem_assign(rhs.z);
1496        self.w.rem_assign(rhs.w);
1497    }
1498}
1499
1500impl RemAssign<&Self> for USizeVec4 {
1501    #[inline]
1502    fn rem_assign(&mut self, rhs: &Self) {
1503        self.rem_assign(*rhs);
1504    }
1505}
1506
1507impl Rem<usize> for USizeVec4 {
1508    type Output = Self;
1509    #[inline]
1510    fn rem(self, rhs: usize) -> Self {
1511        Self::new(
1512            self.x.rem(rhs),
1513            self.y.rem(rhs),
1514            self.z.rem(rhs),
1515            self.w.rem(rhs),
1516        )
1517    }
1518}
1519
1520impl Rem<&usize> for USizeVec4 {
1521    type Output = Self;
1522    #[inline]
1523    fn rem(self, rhs: &usize) -> Self {
1524        self.rem(*rhs)
1525    }
1526}
1527
1528impl Rem<&usize> for &USizeVec4 {
1529    type Output = USizeVec4;
1530    #[inline]
1531    fn rem(self, rhs: &usize) -> USizeVec4 {
1532        (*self).rem(*rhs)
1533    }
1534}
1535
1536impl Rem<usize> for &USizeVec4 {
1537    type Output = USizeVec4;
1538    #[inline]
1539    fn rem(self, rhs: usize) -> USizeVec4 {
1540        (*self).rem(rhs)
1541    }
1542}
1543
1544impl RemAssign<usize> for USizeVec4 {
1545    #[inline]
1546    fn rem_assign(&mut self, rhs: usize) {
1547        self.x.rem_assign(rhs);
1548        self.y.rem_assign(rhs);
1549        self.z.rem_assign(rhs);
1550        self.w.rem_assign(rhs);
1551    }
1552}
1553
1554impl RemAssign<&usize> for USizeVec4 {
1555    #[inline]
1556    fn rem_assign(&mut self, rhs: &usize) {
1557        self.rem_assign(*rhs);
1558    }
1559}
1560
1561impl Rem<USizeVec4> for usize {
1562    type Output = USizeVec4;
1563    #[inline]
1564    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
1565        USizeVec4::new(
1566            self.rem(rhs.x),
1567            self.rem(rhs.y),
1568            self.rem(rhs.z),
1569            self.rem(rhs.w),
1570        )
1571    }
1572}
1573
1574impl Rem<&USizeVec4> for usize {
1575    type Output = USizeVec4;
1576    #[inline]
1577    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
1578        self.rem(*rhs)
1579    }
1580}
1581
1582impl Rem<&USizeVec4> for &usize {
1583    type Output = USizeVec4;
1584    #[inline]
1585    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
1586        (*self).rem(*rhs)
1587    }
1588}
1589
1590impl Rem<USizeVec4> for &usize {
1591    type Output = USizeVec4;
1592    #[inline]
1593    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
1594        (*self).rem(rhs)
1595    }
1596}
1597
1598impl AsRef<[usize; 4]> for USizeVec4 {
1599    #[inline]
1600    fn as_ref(&self) -> &[usize; 4] {
1601        unsafe { &*(self as *const Self as *const [usize; 4]) }
1602    }
1603}
1604
1605impl AsMut<[usize; 4]> for USizeVec4 {
1606    #[inline]
1607    fn as_mut(&mut self) -> &mut [usize; 4] {
1608        unsafe { &mut *(self as *mut Self as *mut [usize; 4]) }
1609    }
1610}
1611
1612impl Sum for USizeVec4 {
1613    #[inline]
1614    fn sum<I>(iter: I) -> Self
1615    where
1616        I: Iterator<Item = Self>,
1617    {
1618        iter.fold(Self::ZERO, Self::add)
1619    }
1620}
1621
1622impl<'a> Sum<&'a Self> for USizeVec4 {
1623    #[inline]
1624    fn sum<I>(iter: I) -> Self
1625    where
1626        I: Iterator<Item = &'a Self>,
1627    {
1628        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
1629    }
1630}
1631
1632impl Product for USizeVec4 {
1633    #[inline]
1634    fn product<I>(iter: I) -> Self
1635    where
1636        I: Iterator<Item = Self>,
1637    {
1638        iter.fold(Self::ONE, Self::mul)
1639    }
1640}
1641
1642impl<'a> Product<&'a Self> for USizeVec4 {
1643    #[inline]
1644    fn product<I>(iter: I) -> Self
1645    where
1646        I: Iterator<Item = &'a Self>,
1647    {
1648        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
1649    }
1650}
1651
1652impl Not for USizeVec4 {
1653    type Output = Self;
1654    #[inline]
1655    fn not(self) -> Self {
1656        Self::new(self.x.not(), self.y.not(), self.z.not(), self.w.not())
1657    }
1658}
1659
1660impl Not for &USizeVec4 {
1661    type Output = USizeVec4;
1662    #[inline]
1663    fn not(self) -> USizeVec4 {
1664        (*self).not()
1665    }
1666}
1667
1668impl BitAnd for USizeVec4 {
1669    type Output = Self;
1670    #[inline]
1671    fn bitand(self, rhs: Self) -> Self::Output {
1672        Self::new(
1673            self.x.bitand(rhs.x),
1674            self.y.bitand(rhs.y),
1675            self.z.bitand(rhs.z),
1676            self.w.bitand(rhs.w),
1677        )
1678    }
1679}
1680
1681impl BitAnd<&Self> for USizeVec4 {
1682    type Output = Self;
1683    #[inline]
1684    fn bitand(self, rhs: &Self) -> Self {
1685        self.bitand(*rhs)
1686    }
1687}
1688
1689impl BitAnd<&USizeVec4> for &USizeVec4 {
1690    type Output = USizeVec4;
1691    #[inline]
1692    fn bitand(self, rhs: &USizeVec4) -> USizeVec4 {
1693        (*self).bitand(*rhs)
1694    }
1695}
1696
1697impl BitAnd<USizeVec4> for &USizeVec4 {
1698    type Output = USizeVec4;
1699    #[inline]
1700    fn bitand(self, rhs: USizeVec4) -> USizeVec4 {
1701        (*self).bitand(rhs)
1702    }
1703}
1704
1705impl BitAndAssign for USizeVec4 {
1706    #[inline]
1707    fn bitand_assign(&mut self, rhs: Self) {
1708        *self = self.bitand(rhs);
1709    }
1710}
1711
1712impl BitAndAssign<&Self> for USizeVec4 {
1713    #[inline]
1714    fn bitand_assign(&mut self, rhs: &Self) {
1715        self.bitand_assign(*rhs);
1716    }
1717}
1718
1719impl BitOr for USizeVec4 {
1720    type Output = Self;
1721    #[inline]
1722    fn bitor(self, rhs: Self) -> Self::Output {
1723        Self::new(
1724            self.x.bitor(rhs.x),
1725            self.y.bitor(rhs.y),
1726            self.z.bitor(rhs.z),
1727            self.w.bitor(rhs.w),
1728        )
1729    }
1730}
1731
1732impl BitOr<&Self> for USizeVec4 {
1733    type Output = Self;
1734    #[inline]
1735    fn bitor(self, rhs: &Self) -> Self {
1736        self.bitor(*rhs)
1737    }
1738}
1739
1740impl BitOr<&USizeVec4> for &USizeVec4 {
1741    type Output = USizeVec4;
1742    #[inline]
1743    fn bitor(self, rhs: &USizeVec4) -> USizeVec4 {
1744        (*self).bitor(*rhs)
1745    }
1746}
1747
1748impl BitOr<USizeVec4> for &USizeVec4 {
1749    type Output = USizeVec4;
1750    #[inline]
1751    fn bitor(self, rhs: USizeVec4) -> USizeVec4 {
1752        (*self).bitor(rhs)
1753    }
1754}
1755
1756impl BitOrAssign for USizeVec4 {
1757    #[inline]
1758    fn bitor_assign(&mut self, rhs: Self) {
1759        *self = self.bitor(rhs);
1760    }
1761}
1762
1763impl BitOrAssign<&Self> for USizeVec4 {
1764    #[inline]
1765    fn bitor_assign(&mut self, rhs: &Self) {
1766        self.bitor_assign(*rhs);
1767    }
1768}
1769
1770impl BitXor for USizeVec4 {
1771    type Output = Self;
1772    #[inline]
1773    fn bitxor(self, rhs: Self) -> Self::Output {
1774        Self::new(
1775            self.x.bitxor(rhs.x),
1776            self.y.bitxor(rhs.y),
1777            self.z.bitxor(rhs.z),
1778            self.w.bitxor(rhs.w),
1779        )
1780    }
1781}
1782
1783impl BitXor<&Self> for USizeVec4 {
1784    type Output = Self;
1785    #[inline]
1786    fn bitxor(self, rhs: &Self) -> Self {
1787        self.bitxor(*rhs)
1788    }
1789}
1790
1791impl BitXor<&USizeVec4> for &USizeVec4 {
1792    type Output = USizeVec4;
1793    #[inline]
1794    fn bitxor(self, rhs: &USizeVec4) -> USizeVec4 {
1795        (*self).bitxor(*rhs)
1796    }
1797}
1798
1799impl BitXor<USizeVec4> for &USizeVec4 {
1800    type Output = USizeVec4;
1801    #[inline]
1802    fn bitxor(self, rhs: USizeVec4) -> USizeVec4 {
1803        (*self).bitxor(rhs)
1804    }
1805}
1806
1807impl BitXorAssign for USizeVec4 {
1808    #[inline]
1809    fn bitxor_assign(&mut self, rhs: Self) {
1810        *self = self.bitxor(rhs);
1811    }
1812}
1813
1814impl BitXorAssign<&Self> for USizeVec4 {
1815    #[inline]
1816    fn bitxor_assign(&mut self, rhs: &Self) {
1817        self.bitxor_assign(*rhs);
1818    }
1819}
1820
1821impl BitAnd<usize> for USizeVec4 {
1822    type Output = Self;
1823    #[inline]
1824    fn bitand(self, rhs: usize) -> Self::Output {
1825        Self::new(
1826            self.x.bitand(rhs),
1827            self.y.bitand(rhs),
1828            self.z.bitand(rhs),
1829            self.w.bitand(rhs),
1830        )
1831    }
1832}
1833
1834impl BitAnd<&usize> for USizeVec4 {
1835    type Output = Self;
1836    #[inline]
1837    fn bitand(self, rhs: &usize) -> Self {
1838        self.bitand(*rhs)
1839    }
1840}
1841
1842impl BitAnd<&usize> for &USizeVec4 {
1843    type Output = USizeVec4;
1844    #[inline]
1845    fn bitand(self, rhs: &usize) -> USizeVec4 {
1846        (*self).bitand(*rhs)
1847    }
1848}
1849
1850impl BitAnd<usize> for &USizeVec4 {
1851    type Output = USizeVec4;
1852    #[inline]
1853    fn bitand(self, rhs: usize) -> USizeVec4 {
1854        (*self).bitand(rhs)
1855    }
1856}
1857
1858impl BitAndAssign<usize> for USizeVec4 {
1859    #[inline]
1860    fn bitand_assign(&mut self, rhs: usize) {
1861        *self = self.bitand(rhs);
1862    }
1863}
1864
1865impl BitAndAssign<&usize> for USizeVec4 {
1866    #[inline]
1867    fn bitand_assign(&mut self, rhs: &usize) {
1868        self.bitand_assign(*rhs);
1869    }
1870}
1871
1872impl BitOr<usize> for USizeVec4 {
1873    type Output = Self;
1874    #[inline]
1875    fn bitor(self, rhs: usize) -> Self::Output {
1876        Self::new(
1877            self.x.bitor(rhs),
1878            self.y.bitor(rhs),
1879            self.z.bitor(rhs),
1880            self.w.bitor(rhs),
1881        )
1882    }
1883}
1884
1885impl BitOr<&usize> for USizeVec4 {
1886    type Output = Self;
1887    #[inline]
1888    fn bitor(self, rhs: &usize) -> Self {
1889        self.bitor(*rhs)
1890    }
1891}
1892
1893impl BitOr<&usize> for &USizeVec4 {
1894    type Output = USizeVec4;
1895    #[inline]
1896    fn bitor(self, rhs: &usize) -> USizeVec4 {
1897        (*self).bitor(*rhs)
1898    }
1899}
1900
1901impl BitOr<usize> for &USizeVec4 {
1902    type Output = USizeVec4;
1903    #[inline]
1904    fn bitor(self, rhs: usize) -> USizeVec4 {
1905        (*self).bitor(rhs)
1906    }
1907}
1908
1909impl BitOrAssign<usize> for USizeVec4 {
1910    #[inline]
1911    fn bitor_assign(&mut self, rhs: usize) {
1912        *self = self.bitor(rhs);
1913    }
1914}
1915
1916impl BitOrAssign<&usize> for USizeVec4 {
1917    #[inline]
1918    fn bitor_assign(&mut self, rhs: &usize) {
1919        self.bitor_assign(*rhs);
1920    }
1921}
1922
1923impl BitXor<usize> for USizeVec4 {
1924    type Output = Self;
1925    #[inline]
1926    fn bitxor(self, rhs: usize) -> Self::Output {
1927        Self::new(
1928            self.x.bitxor(rhs),
1929            self.y.bitxor(rhs),
1930            self.z.bitxor(rhs),
1931            self.w.bitxor(rhs),
1932        )
1933    }
1934}
1935
1936impl BitXor<&usize> for USizeVec4 {
1937    type Output = Self;
1938    #[inline]
1939    fn bitxor(self, rhs: &usize) -> Self {
1940        self.bitxor(*rhs)
1941    }
1942}
1943
1944impl BitXor<&usize> for &USizeVec4 {
1945    type Output = USizeVec4;
1946    #[inline]
1947    fn bitxor(self, rhs: &usize) -> USizeVec4 {
1948        (*self).bitxor(*rhs)
1949    }
1950}
1951
1952impl BitXor<usize> for &USizeVec4 {
1953    type Output = USizeVec4;
1954    #[inline]
1955    fn bitxor(self, rhs: usize) -> USizeVec4 {
1956        (*self).bitxor(rhs)
1957    }
1958}
1959
1960impl BitXorAssign<usize> for USizeVec4 {
1961    #[inline]
1962    fn bitxor_assign(&mut self, rhs: usize) {
1963        *self = self.bitxor(rhs);
1964    }
1965}
1966
1967impl BitXorAssign<&usize> for USizeVec4 {
1968    #[inline]
1969    fn bitxor_assign(&mut self, rhs: &usize) {
1970        self.bitxor_assign(*rhs);
1971    }
1972}
1973
1974impl Shl<i8> for USizeVec4 {
1975    type Output = Self;
1976    #[inline]
1977    fn shl(self, rhs: i8) -> Self::Output {
1978        Self::new(
1979            self.x.shl(rhs),
1980            self.y.shl(rhs),
1981            self.z.shl(rhs),
1982            self.w.shl(rhs),
1983        )
1984    }
1985}
1986
1987impl Shl<&i8> for USizeVec4 {
1988    type Output = Self;
1989    #[inline]
1990    fn shl(self, rhs: &i8) -> Self {
1991        self.shl(*rhs)
1992    }
1993}
1994
1995impl Shl<&i8> for &USizeVec4 {
1996    type Output = USizeVec4;
1997    #[inline]
1998    fn shl(self, rhs: &i8) -> USizeVec4 {
1999        (*self).shl(*rhs)
2000    }
2001}
2002
2003impl Shl<i8> for &USizeVec4 {
2004    type Output = USizeVec4;
2005    #[inline]
2006    fn shl(self, rhs: i8) -> USizeVec4 {
2007        (*self).shl(rhs)
2008    }
2009}
2010
2011impl ShlAssign<i8> for USizeVec4 {
2012    #[inline]
2013    fn shl_assign(&mut self, rhs: i8) {
2014        *self = self.shl(rhs);
2015    }
2016}
2017
2018impl ShlAssign<&i8> for USizeVec4 {
2019    #[inline]
2020    fn shl_assign(&mut self, rhs: &i8) {
2021        self.shl_assign(*rhs);
2022    }
2023}
2024
2025impl Shr<i8> for USizeVec4 {
2026    type Output = Self;
2027    #[inline]
2028    fn shr(self, rhs: i8) -> Self::Output {
2029        Self::new(
2030            self.x.shr(rhs),
2031            self.y.shr(rhs),
2032            self.z.shr(rhs),
2033            self.w.shr(rhs),
2034        )
2035    }
2036}
2037
2038impl Shr<&i8> for USizeVec4 {
2039    type Output = Self;
2040    #[inline]
2041    fn shr(self, rhs: &i8) -> Self {
2042        self.shr(*rhs)
2043    }
2044}
2045
2046impl Shr<&i8> for &USizeVec4 {
2047    type Output = USizeVec4;
2048    #[inline]
2049    fn shr(self, rhs: &i8) -> USizeVec4 {
2050        (*self).shr(*rhs)
2051    }
2052}
2053
2054impl Shr<i8> for &USizeVec4 {
2055    type Output = USizeVec4;
2056    #[inline]
2057    fn shr(self, rhs: i8) -> USizeVec4 {
2058        (*self).shr(rhs)
2059    }
2060}
2061
2062impl ShrAssign<i8> for USizeVec4 {
2063    #[inline]
2064    fn shr_assign(&mut self, rhs: i8) {
2065        *self = self.shr(rhs);
2066    }
2067}
2068
2069impl ShrAssign<&i8> for USizeVec4 {
2070    #[inline]
2071    fn shr_assign(&mut self, rhs: &i8) {
2072        self.shr_assign(*rhs);
2073    }
2074}
2075
2076impl Shl<i16> for USizeVec4 {
2077    type Output = Self;
2078    #[inline]
2079    fn shl(self, rhs: i16) -> Self::Output {
2080        Self::new(
2081            self.x.shl(rhs),
2082            self.y.shl(rhs),
2083            self.z.shl(rhs),
2084            self.w.shl(rhs),
2085        )
2086    }
2087}
2088
2089impl Shl<&i16> for USizeVec4 {
2090    type Output = Self;
2091    #[inline]
2092    fn shl(self, rhs: &i16) -> Self {
2093        self.shl(*rhs)
2094    }
2095}
2096
2097impl Shl<&i16> for &USizeVec4 {
2098    type Output = USizeVec4;
2099    #[inline]
2100    fn shl(self, rhs: &i16) -> USizeVec4 {
2101        (*self).shl(*rhs)
2102    }
2103}
2104
2105impl Shl<i16> for &USizeVec4 {
2106    type Output = USizeVec4;
2107    #[inline]
2108    fn shl(self, rhs: i16) -> USizeVec4 {
2109        (*self).shl(rhs)
2110    }
2111}
2112
2113impl ShlAssign<i16> for USizeVec4 {
2114    #[inline]
2115    fn shl_assign(&mut self, rhs: i16) {
2116        *self = self.shl(rhs);
2117    }
2118}
2119
2120impl ShlAssign<&i16> for USizeVec4 {
2121    #[inline]
2122    fn shl_assign(&mut self, rhs: &i16) {
2123        self.shl_assign(*rhs);
2124    }
2125}
2126
2127impl Shr<i16> for USizeVec4 {
2128    type Output = Self;
2129    #[inline]
2130    fn shr(self, rhs: i16) -> Self::Output {
2131        Self::new(
2132            self.x.shr(rhs),
2133            self.y.shr(rhs),
2134            self.z.shr(rhs),
2135            self.w.shr(rhs),
2136        )
2137    }
2138}
2139
2140impl Shr<&i16> for USizeVec4 {
2141    type Output = Self;
2142    #[inline]
2143    fn shr(self, rhs: &i16) -> Self {
2144        self.shr(*rhs)
2145    }
2146}
2147
2148impl Shr<&i16> for &USizeVec4 {
2149    type Output = USizeVec4;
2150    #[inline]
2151    fn shr(self, rhs: &i16) -> USizeVec4 {
2152        (*self).shr(*rhs)
2153    }
2154}
2155
2156impl Shr<i16> for &USizeVec4 {
2157    type Output = USizeVec4;
2158    #[inline]
2159    fn shr(self, rhs: i16) -> USizeVec4 {
2160        (*self).shr(rhs)
2161    }
2162}
2163
2164impl ShrAssign<i16> for USizeVec4 {
2165    #[inline]
2166    fn shr_assign(&mut self, rhs: i16) {
2167        *self = self.shr(rhs);
2168    }
2169}
2170
2171impl ShrAssign<&i16> for USizeVec4 {
2172    #[inline]
2173    fn shr_assign(&mut self, rhs: &i16) {
2174        self.shr_assign(*rhs);
2175    }
2176}
2177
2178impl Shl<i32> for USizeVec4 {
2179    type Output = Self;
2180    #[inline]
2181    fn shl(self, rhs: i32) -> Self::Output {
2182        Self::new(
2183            self.x.shl(rhs),
2184            self.y.shl(rhs),
2185            self.z.shl(rhs),
2186            self.w.shl(rhs),
2187        )
2188    }
2189}
2190
2191impl Shl<&i32> for USizeVec4 {
2192    type Output = Self;
2193    #[inline]
2194    fn shl(self, rhs: &i32) -> Self {
2195        self.shl(*rhs)
2196    }
2197}
2198
2199impl Shl<&i32> for &USizeVec4 {
2200    type Output = USizeVec4;
2201    #[inline]
2202    fn shl(self, rhs: &i32) -> USizeVec4 {
2203        (*self).shl(*rhs)
2204    }
2205}
2206
2207impl Shl<i32> for &USizeVec4 {
2208    type Output = USizeVec4;
2209    #[inline]
2210    fn shl(self, rhs: i32) -> USizeVec4 {
2211        (*self).shl(rhs)
2212    }
2213}
2214
2215impl ShlAssign<i32> for USizeVec4 {
2216    #[inline]
2217    fn shl_assign(&mut self, rhs: i32) {
2218        *self = self.shl(rhs);
2219    }
2220}
2221
2222impl ShlAssign<&i32> for USizeVec4 {
2223    #[inline]
2224    fn shl_assign(&mut self, rhs: &i32) {
2225        self.shl_assign(*rhs);
2226    }
2227}
2228
2229impl Shr<i32> for USizeVec4 {
2230    type Output = Self;
2231    #[inline]
2232    fn shr(self, rhs: i32) -> Self::Output {
2233        Self::new(
2234            self.x.shr(rhs),
2235            self.y.shr(rhs),
2236            self.z.shr(rhs),
2237            self.w.shr(rhs),
2238        )
2239    }
2240}
2241
2242impl Shr<&i32> for USizeVec4 {
2243    type Output = Self;
2244    #[inline]
2245    fn shr(self, rhs: &i32) -> Self {
2246        self.shr(*rhs)
2247    }
2248}
2249
2250impl Shr<&i32> for &USizeVec4 {
2251    type Output = USizeVec4;
2252    #[inline]
2253    fn shr(self, rhs: &i32) -> USizeVec4 {
2254        (*self).shr(*rhs)
2255    }
2256}
2257
2258impl Shr<i32> for &USizeVec4 {
2259    type Output = USizeVec4;
2260    #[inline]
2261    fn shr(self, rhs: i32) -> USizeVec4 {
2262        (*self).shr(rhs)
2263    }
2264}
2265
2266impl ShrAssign<i32> for USizeVec4 {
2267    #[inline]
2268    fn shr_assign(&mut self, rhs: i32) {
2269        *self = self.shr(rhs);
2270    }
2271}
2272
2273impl ShrAssign<&i32> for USizeVec4 {
2274    #[inline]
2275    fn shr_assign(&mut self, rhs: &i32) {
2276        self.shr_assign(*rhs);
2277    }
2278}
2279
2280impl Shl<i64> for USizeVec4 {
2281    type Output = Self;
2282    #[inline]
2283    fn shl(self, rhs: i64) -> Self::Output {
2284        Self::new(
2285            self.x.shl(rhs),
2286            self.y.shl(rhs),
2287            self.z.shl(rhs),
2288            self.w.shl(rhs),
2289        )
2290    }
2291}
2292
2293impl Shl<&i64> for USizeVec4 {
2294    type Output = Self;
2295    #[inline]
2296    fn shl(self, rhs: &i64) -> Self {
2297        self.shl(*rhs)
2298    }
2299}
2300
2301impl Shl<&i64> for &USizeVec4 {
2302    type Output = USizeVec4;
2303    #[inline]
2304    fn shl(self, rhs: &i64) -> USizeVec4 {
2305        (*self).shl(*rhs)
2306    }
2307}
2308
2309impl Shl<i64> for &USizeVec4 {
2310    type Output = USizeVec4;
2311    #[inline]
2312    fn shl(self, rhs: i64) -> USizeVec4 {
2313        (*self).shl(rhs)
2314    }
2315}
2316
2317impl ShlAssign<i64> for USizeVec4 {
2318    #[inline]
2319    fn shl_assign(&mut self, rhs: i64) {
2320        *self = self.shl(rhs);
2321    }
2322}
2323
2324impl ShlAssign<&i64> for USizeVec4 {
2325    #[inline]
2326    fn shl_assign(&mut self, rhs: &i64) {
2327        self.shl_assign(*rhs);
2328    }
2329}
2330
2331impl Shr<i64> for USizeVec4 {
2332    type Output = Self;
2333    #[inline]
2334    fn shr(self, rhs: i64) -> Self::Output {
2335        Self::new(
2336            self.x.shr(rhs),
2337            self.y.shr(rhs),
2338            self.z.shr(rhs),
2339            self.w.shr(rhs),
2340        )
2341    }
2342}
2343
2344impl Shr<&i64> for USizeVec4 {
2345    type Output = Self;
2346    #[inline]
2347    fn shr(self, rhs: &i64) -> Self {
2348        self.shr(*rhs)
2349    }
2350}
2351
2352impl Shr<&i64> for &USizeVec4 {
2353    type Output = USizeVec4;
2354    #[inline]
2355    fn shr(self, rhs: &i64) -> USizeVec4 {
2356        (*self).shr(*rhs)
2357    }
2358}
2359
2360impl Shr<i64> for &USizeVec4 {
2361    type Output = USizeVec4;
2362    #[inline]
2363    fn shr(self, rhs: i64) -> USizeVec4 {
2364        (*self).shr(rhs)
2365    }
2366}
2367
2368impl ShrAssign<i64> for USizeVec4 {
2369    #[inline]
2370    fn shr_assign(&mut self, rhs: i64) {
2371        *self = self.shr(rhs);
2372    }
2373}
2374
2375impl ShrAssign<&i64> for USizeVec4 {
2376    #[inline]
2377    fn shr_assign(&mut self, rhs: &i64) {
2378        self.shr_assign(*rhs);
2379    }
2380}
2381
2382impl Shl<u8> for USizeVec4 {
2383    type Output = Self;
2384    #[inline]
2385    fn shl(self, rhs: u8) -> Self::Output {
2386        Self::new(
2387            self.x.shl(rhs),
2388            self.y.shl(rhs),
2389            self.z.shl(rhs),
2390            self.w.shl(rhs),
2391        )
2392    }
2393}
2394
2395impl Shl<&u8> for USizeVec4 {
2396    type Output = Self;
2397    #[inline]
2398    fn shl(self, rhs: &u8) -> Self {
2399        self.shl(*rhs)
2400    }
2401}
2402
2403impl Shl<&u8> for &USizeVec4 {
2404    type Output = USizeVec4;
2405    #[inline]
2406    fn shl(self, rhs: &u8) -> USizeVec4 {
2407        (*self).shl(*rhs)
2408    }
2409}
2410
2411impl Shl<u8> for &USizeVec4 {
2412    type Output = USizeVec4;
2413    #[inline]
2414    fn shl(self, rhs: u8) -> USizeVec4 {
2415        (*self).shl(rhs)
2416    }
2417}
2418
2419impl ShlAssign<u8> for USizeVec4 {
2420    #[inline]
2421    fn shl_assign(&mut self, rhs: u8) {
2422        *self = self.shl(rhs);
2423    }
2424}
2425
2426impl ShlAssign<&u8> for USizeVec4 {
2427    #[inline]
2428    fn shl_assign(&mut self, rhs: &u8) {
2429        self.shl_assign(*rhs);
2430    }
2431}
2432
2433impl Shr<u8> for USizeVec4 {
2434    type Output = Self;
2435    #[inline]
2436    fn shr(self, rhs: u8) -> Self::Output {
2437        Self::new(
2438            self.x.shr(rhs),
2439            self.y.shr(rhs),
2440            self.z.shr(rhs),
2441            self.w.shr(rhs),
2442        )
2443    }
2444}
2445
2446impl Shr<&u8> for USizeVec4 {
2447    type Output = Self;
2448    #[inline]
2449    fn shr(self, rhs: &u8) -> Self {
2450        self.shr(*rhs)
2451    }
2452}
2453
2454impl Shr<&u8> for &USizeVec4 {
2455    type Output = USizeVec4;
2456    #[inline]
2457    fn shr(self, rhs: &u8) -> USizeVec4 {
2458        (*self).shr(*rhs)
2459    }
2460}
2461
2462impl Shr<u8> for &USizeVec4 {
2463    type Output = USizeVec4;
2464    #[inline]
2465    fn shr(self, rhs: u8) -> USizeVec4 {
2466        (*self).shr(rhs)
2467    }
2468}
2469
2470impl ShrAssign<u8> for USizeVec4 {
2471    #[inline]
2472    fn shr_assign(&mut self, rhs: u8) {
2473        *self = self.shr(rhs);
2474    }
2475}
2476
2477impl ShrAssign<&u8> for USizeVec4 {
2478    #[inline]
2479    fn shr_assign(&mut self, rhs: &u8) {
2480        self.shr_assign(*rhs);
2481    }
2482}
2483
2484impl Shl<u16> for USizeVec4 {
2485    type Output = Self;
2486    #[inline]
2487    fn shl(self, rhs: u16) -> Self::Output {
2488        Self::new(
2489            self.x.shl(rhs),
2490            self.y.shl(rhs),
2491            self.z.shl(rhs),
2492            self.w.shl(rhs),
2493        )
2494    }
2495}
2496
2497impl Shl<&u16> for USizeVec4 {
2498    type Output = Self;
2499    #[inline]
2500    fn shl(self, rhs: &u16) -> Self {
2501        self.shl(*rhs)
2502    }
2503}
2504
2505impl Shl<&u16> for &USizeVec4 {
2506    type Output = USizeVec4;
2507    #[inline]
2508    fn shl(self, rhs: &u16) -> USizeVec4 {
2509        (*self).shl(*rhs)
2510    }
2511}
2512
2513impl Shl<u16> for &USizeVec4 {
2514    type Output = USizeVec4;
2515    #[inline]
2516    fn shl(self, rhs: u16) -> USizeVec4 {
2517        (*self).shl(rhs)
2518    }
2519}
2520
2521impl ShlAssign<u16> for USizeVec4 {
2522    #[inline]
2523    fn shl_assign(&mut self, rhs: u16) {
2524        *self = self.shl(rhs);
2525    }
2526}
2527
2528impl ShlAssign<&u16> for USizeVec4 {
2529    #[inline]
2530    fn shl_assign(&mut self, rhs: &u16) {
2531        self.shl_assign(*rhs);
2532    }
2533}
2534
2535impl Shr<u16> for USizeVec4 {
2536    type Output = Self;
2537    #[inline]
2538    fn shr(self, rhs: u16) -> Self::Output {
2539        Self::new(
2540            self.x.shr(rhs),
2541            self.y.shr(rhs),
2542            self.z.shr(rhs),
2543            self.w.shr(rhs),
2544        )
2545    }
2546}
2547
2548impl Shr<&u16> for USizeVec4 {
2549    type Output = Self;
2550    #[inline]
2551    fn shr(self, rhs: &u16) -> Self {
2552        self.shr(*rhs)
2553    }
2554}
2555
2556impl Shr<&u16> for &USizeVec4 {
2557    type Output = USizeVec4;
2558    #[inline]
2559    fn shr(self, rhs: &u16) -> USizeVec4 {
2560        (*self).shr(*rhs)
2561    }
2562}
2563
2564impl Shr<u16> for &USizeVec4 {
2565    type Output = USizeVec4;
2566    #[inline]
2567    fn shr(self, rhs: u16) -> USizeVec4 {
2568        (*self).shr(rhs)
2569    }
2570}
2571
2572impl ShrAssign<u16> for USizeVec4 {
2573    #[inline]
2574    fn shr_assign(&mut self, rhs: u16) {
2575        *self = self.shr(rhs);
2576    }
2577}
2578
2579impl ShrAssign<&u16> for USizeVec4 {
2580    #[inline]
2581    fn shr_assign(&mut self, rhs: &u16) {
2582        self.shr_assign(*rhs);
2583    }
2584}
2585
2586impl Shl<u32> for USizeVec4 {
2587    type Output = Self;
2588    #[inline]
2589    fn shl(self, rhs: u32) -> Self::Output {
2590        Self::new(
2591            self.x.shl(rhs),
2592            self.y.shl(rhs),
2593            self.z.shl(rhs),
2594            self.w.shl(rhs),
2595        )
2596    }
2597}
2598
2599impl Shl<&u32> for USizeVec4 {
2600    type Output = Self;
2601    #[inline]
2602    fn shl(self, rhs: &u32) -> Self {
2603        self.shl(*rhs)
2604    }
2605}
2606
2607impl Shl<&u32> for &USizeVec4 {
2608    type Output = USizeVec4;
2609    #[inline]
2610    fn shl(self, rhs: &u32) -> USizeVec4 {
2611        (*self).shl(*rhs)
2612    }
2613}
2614
2615impl Shl<u32> for &USizeVec4 {
2616    type Output = USizeVec4;
2617    #[inline]
2618    fn shl(self, rhs: u32) -> USizeVec4 {
2619        (*self).shl(rhs)
2620    }
2621}
2622
2623impl ShlAssign<u32> for USizeVec4 {
2624    #[inline]
2625    fn shl_assign(&mut self, rhs: u32) {
2626        *self = self.shl(rhs);
2627    }
2628}
2629
2630impl ShlAssign<&u32> for USizeVec4 {
2631    #[inline]
2632    fn shl_assign(&mut self, rhs: &u32) {
2633        self.shl_assign(*rhs);
2634    }
2635}
2636
2637impl Shr<u32> for USizeVec4 {
2638    type Output = Self;
2639    #[inline]
2640    fn shr(self, rhs: u32) -> Self::Output {
2641        Self::new(
2642            self.x.shr(rhs),
2643            self.y.shr(rhs),
2644            self.z.shr(rhs),
2645            self.w.shr(rhs),
2646        )
2647    }
2648}
2649
2650impl Shr<&u32> for USizeVec4 {
2651    type Output = Self;
2652    #[inline]
2653    fn shr(self, rhs: &u32) -> Self {
2654        self.shr(*rhs)
2655    }
2656}
2657
2658impl Shr<&u32> for &USizeVec4 {
2659    type Output = USizeVec4;
2660    #[inline]
2661    fn shr(self, rhs: &u32) -> USizeVec4 {
2662        (*self).shr(*rhs)
2663    }
2664}
2665
2666impl Shr<u32> for &USizeVec4 {
2667    type Output = USizeVec4;
2668    #[inline]
2669    fn shr(self, rhs: u32) -> USizeVec4 {
2670        (*self).shr(rhs)
2671    }
2672}
2673
2674impl ShrAssign<u32> for USizeVec4 {
2675    #[inline]
2676    fn shr_assign(&mut self, rhs: u32) {
2677        *self = self.shr(rhs);
2678    }
2679}
2680
2681impl ShrAssign<&u32> for USizeVec4 {
2682    #[inline]
2683    fn shr_assign(&mut self, rhs: &u32) {
2684        self.shr_assign(*rhs);
2685    }
2686}
2687
2688impl Shl<u64> for USizeVec4 {
2689    type Output = Self;
2690    #[inline]
2691    fn shl(self, rhs: u64) -> Self::Output {
2692        Self::new(
2693            self.x.shl(rhs),
2694            self.y.shl(rhs),
2695            self.z.shl(rhs),
2696            self.w.shl(rhs),
2697        )
2698    }
2699}
2700
2701impl Shl<&u64> for USizeVec4 {
2702    type Output = Self;
2703    #[inline]
2704    fn shl(self, rhs: &u64) -> Self {
2705        self.shl(*rhs)
2706    }
2707}
2708
2709impl Shl<&u64> for &USizeVec4 {
2710    type Output = USizeVec4;
2711    #[inline]
2712    fn shl(self, rhs: &u64) -> USizeVec4 {
2713        (*self).shl(*rhs)
2714    }
2715}
2716
2717impl Shl<u64> for &USizeVec4 {
2718    type Output = USizeVec4;
2719    #[inline]
2720    fn shl(self, rhs: u64) -> USizeVec4 {
2721        (*self).shl(rhs)
2722    }
2723}
2724
2725impl ShlAssign<u64> for USizeVec4 {
2726    #[inline]
2727    fn shl_assign(&mut self, rhs: u64) {
2728        *self = self.shl(rhs);
2729    }
2730}
2731
2732impl ShlAssign<&u64> for USizeVec4 {
2733    #[inline]
2734    fn shl_assign(&mut self, rhs: &u64) {
2735        self.shl_assign(*rhs);
2736    }
2737}
2738
2739impl Shr<u64> for USizeVec4 {
2740    type Output = Self;
2741    #[inline]
2742    fn shr(self, rhs: u64) -> Self::Output {
2743        Self::new(
2744            self.x.shr(rhs),
2745            self.y.shr(rhs),
2746            self.z.shr(rhs),
2747            self.w.shr(rhs),
2748        )
2749    }
2750}
2751
2752impl Shr<&u64> for USizeVec4 {
2753    type Output = Self;
2754    #[inline]
2755    fn shr(self, rhs: &u64) -> Self {
2756        self.shr(*rhs)
2757    }
2758}
2759
2760impl Shr<&u64> for &USizeVec4 {
2761    type Output = USizeVec4;
2762    #[inline]
2763    fn shr(self, rhs: &u64) -> USizeVec4 {
2764        (*self).shr(*rhs)
2765    }
2766}
2767
2768impl Shr<u64> for &USizeVec4 {
2769    type Output = USizeVec4;
2770    #[inline]
2771    fn shr(self, rhs: u64) -> USizeVec4 {
2772        (*self).shr(rhs)
2773    }
2774}
2775
2776impl ShrAssign<u64> for USizeVec4 {
2777    #[inline]
2778    fn shr_assign(&mut self, rhs: u64) {
2779        *self = self.shr(rhs);
2780    }
2781}
2782
2783impl ShrAssign<&u64> for USizeVec4 {
2784    #[inline]
2785    fn shr_assign(&mut self, rhs: &u64) {
2786        self.shr_assign(*rhs);
2787    }
2788}
2789
2790#[cfg(feature = "i32")]
2791impl Shl<IVec4> for USizeVec4 {
2792    type Output = Self;
2793    #[inline]
2794    fn shl(self, rhs: IVec4) -> Self {
2795        Self::new(
2796            self.x.shl(rhs.x),
2797            self.y.shl(rhs.y),
2798            self.z.shl(rhs.z),
2799            self.w.shl(rhs.w),
2800        )
2801    }
2802}
2803
2804#[cfg(feature = "i32")]
2805impl Shl<&IVec4> for USizeVec4 {
2806    type Output = Self;
2807    #[inline]
2808    fn shl(self, rhs: &IVec4) -> Self {
2809        self.shl(*rhs)
2810    }
2811}
2812
2813#[cfg(feature = "i32")]
2814impl Shl<&IVec4> for &USizeVec4 {
2815    type Output = USizeVec4;
2816    #[inline]
2817    fn shl(self, rhs: &IVec4) -> USizeVec4 {
2818        (*self).shl(*rhs)
2819    }
2820}
2821
2822#[cfg(feature = "i32")]
2823impl Shl<IVec4> for &USizeVec4 {
2824    type Output = USizeVec4;
2825    #[inline]
2826    fn shl(self, rhs: IVec4) -> USizeVec4 {
2827        (*self).shl(rhs)
2828    }
2829}
2830
2831#[cfg(feature = "i32")]
2832impl Shr<IVec4> for USizeVec4 {
2833    type Output = Self;
2834    #[inline]
2835    fn shr(self, rhs: IVec4) -> Self {
2836        Self::new(
2837            self.x.shr(rhs.x),
2838            self.y.shr(rhs.y),
2839            self.z.shr(rhs.z),
2840            self.w.shr(rhs.w),
2841        )
2842    }
2843}
2844
2845#[cfg(feature = "i32")]
2846impl Shr<&IVec4> for USizeVec4 {
2847    type Output = Self;
2848    #[inline]
2849    fn shr(self, rhs: &IVec4) -> Self {
2850        self.shr(*rhs)
2851    }
2852}
2853
2854#[cfg(feature = "i32")]
2855impl Shr<&IVec4> for &USizeVec4 {
2856    type Output = USizeVec4;
2857    #[inline]
2858    fn shr(self, rhs: &IVec4) -> USizeVec4 {
2859        (*self).shr(*rhs)
2860    }
2861}
2862
2863#[cfg(feature = "i32")]
2864impl Shr<IVec4> for &USizeVec4 {
2865    type Output = USizeVec4;
2866    #[inline]
2867    fn shr(self, rhs: IVec4) -> USizeVec4 {
2868        (*self).shr(rhs)
2869    }
2870}
2871
2872#[cfg(feature = "u32")]
2873impl Shl<UVec4> for USizeVec4 {
2874    type Output = Self;
2875    #[inline]
2876    fn shl(self, rhs: UVec4) -> Self {
2877        Self::new(
2878            self.x.shl(rhs.x),
2879            self.y.shl(rhs.y),
2880            self.z.shl(rhs.z),
2881            self.w.shl(rhs.w),
2882        )
2883    }
2884}
2885
2886#[cfg(feature = "u32")]
2887impl Shl<&UVec4> for USizeVec4 {
2888    type Output = Self;
2889    #[inline]
2890    fn shl(self, rhs: &UVec4) -> Self {
2891        self.shl(*rhs)
2892    }
2893}
2894
2895#[cfg(feature = "u32")]
2896impl Shl<&UVec4> for &USizeVec4 {
2897    type Output = USizeVec4;
2898    #[inline]
2899    fn shl(self, rhs: &UVec4) -> USizeVec4 {
2900        (*self).shl(*rhs)
2901    }
2902}
2903
2904#[cfg(feature = "u32")]
2905impl Shl<UVec4> for &USizeVec4 {
2906    type Output = USizeVec4;
2907    #[inline]
2908    fn shl(self, rhs: UVec4) -> USizeVec4 {
2909        (*self).shl(rhs)
2910    }
2911}
2912
2913#[cfg(feature = "u32")]
2914impl Shr<UVec4> for USizeVec4 {
2915    type Output = Self;
2916    #[inline]
2917    fn shr(self, rhs: UVec4) -> Self {
2918        Self::new(
2919            self.x.shr(rhs.x),
2920            self.y.shr(rhs.y),
2921            self.z.shr(rhs.z),
2922            self.w.shr(rhs.w),
2923        )
2924    }
2925}
2926
2927#[cfg(feature = "u32")]
2928impl Shr<&UVec4> for USizeVec4 {
2929    type Output = Self;
2930    #[inline]
2931    fn shr(self, rhs: &UVec4) -> Self {
2932        self.shr(*rhs)
2933    }
2934}
2935
2936#[cfg(feature = "u32")]
2937impl Shr<&UVec4> for &USizeVec4 {
2938    type Output = USizeVec4;
2939    #[inline]
2940    fn shr(self, rhs: &UVec4) -> USizeVec4 {
2941        (*self).shr(*rhs)
2942    }
2943}
2944
2945#[cfg(feature = "u32")]
2946impl Shr<UVec4> for &USizeVec4 {
2947    type Output = USizeVec4;
2948    #[inline]
2949    fn shr(self, rhs: UVec4) -> USizeVec4 {
2950        (*self).shr(rhs)
2951    }
2952}
2953
2954impl Index<usize> for USizeVec4 {
2955    type Output = usize;
2956    #[inline]
2957    fn index(&self, index: usize) -> &Self::Output {
2958        match index {
2959            0 => &self.x,
2960            1 => &self.y,
2961            2 => &self.z,
2962            3 => &self.w,
2963            _ => panic!("index out of bounds"),
2964        }
2965    }
2966}
2967
2968impl IndexMut<usize> for USizeVec4 {
2969    #[inline]
2970    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
2971        match index {
2972            0 => &mut self.x,
2973            1 => &mut self.y,
2974            2 => &mut self.z,
2975            3 => &mut self.w,
2976            _ => panic!("index out of bounds"),
2977        }
2978    }
2979}
2980
2981impl fmt::Display for USizeVec4 {
2982    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2983        write!(f, "[{}, {}, {}, {}]", self.x, self.y, self.z, self.w)
2984    }
2985}
2986
2987impl fmt::Debug for USizeVec4 {
2988    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
2989        fmt.debug_tuple(stringify!(USizeVec4))
2990            .field(&self.x)
2991            .field(&self.y)
2992            .field(&self.z)
2993            .field(&self.w)
2994            .finish()
2995    }
2996}
2997
2998impl From<[usize; 4]> for USizeVec4 {
2999    #[inline]
3000    fn from(a: [usize; 4]) -> Self {
3001        Self::new(a[0], a[1], a[2], a[3])
3002    }
3003}
3004
3005impl From<USizeVec4> for [usize; 4] {
3006    #[inline]
3007    fn from(v: USizeVec4) -> Self {
3008        [v.x, v.y, v.z, v.w]
3009    }
3010}
3011
3012impl From<(usize, usize, usize, usize)> for USizeVec4 {
3013    #[inline]
3014    fn from(t: (usize, usize, usize, usize)) -> Self {
3015        Self::new(t.0, t.1, t.2, t.3)
3016    }
3017}
3018
3019impl From<USizeVec4> for (usize, usize, usize, usize) {
3020    #[inline]
3021    fn from(v: USizeVec4) -> Self {
3022        (v.x, v.y, v.z, v.w)
3023    }
3024}
3025
3026impl From<(USizeVec3, usize)> for USizeVec4 {
3027    #[inline]
3028    fn from((v, w): (USizeVec3, usize)) -> Self {
3029        Self::new(v.x, v.y, v.z, w)
3030    }
3031}
3032
3033impl From<(usize, USizeVec3)> for USizeVec4 {
3034    #[inline]
3035    fn from((x, v): (usize, USizeVec3)) -> Self {
3036        Self::new(x, v.x, v.y, v.z)
3037    }
3038}
3039
3040impl From<(USizeVec2, usize, usize)> for USizeVec4 {
3041    #[inline]
3042    fn from((v, z, w): (USizeVec2, usize, usize)) -> Self {
3043        Self::new(v.x, v.y, z, w)
3044    }
3045}
3046
3047impl From<(USizeVec2, USizeVec2)> for USizeVec4 {
3048    #[inline]
3049    fn from((v, u): (USizeVec2, USizeVec2)) -> Self {
3050        Self::new(v.x, v.y, u.x, u.y)
3051    }
3052}
3053
3054#[cfg(feature = "u8")]
3055impl From<U8Vec4> for USizeVec4 {
3056    #[inline]
3057    fn from(v: U8Vec4) -> Self {
3058        Self::new(
3059            usize::from(v.x),
3060            usize::from(v.y),
3061            usize::from(v.z),
3062            usize::from(v.w),
3063        )
3064    }
3065}
3066
3067#[cfg(feature = "u16")]
3068impl From<U16Vec4> for USizeVec4 {
3069    #[inline]
3070    fn from(v: U16Vec4) -> Self {
3071        Self::new(
3072            usize::from(v.x),
3073            usize::from(v.y),
3074            usize::from(v.z),
3075            usize::from(v.w),
3076        )
3077    }
3078}
3079
3080#[cfg(feature = "i8")]
3081impl TryFrom<I8Vec4> for USizeVec4 {
3082    type Error = core::num::TryFromIntError;
3083
3084    #[inline]
3085    fn try_from(v: I8Vec4) -> Result<Self, Self::Error> {
3086        Ok(Self::new(
3087            usize::try_from(v.x)?,
3088            usize::try_from(v.y)?,
3089            usize::try_from(v.z)?,
3090            usize::try_from(v.w)?,
3091        ))
3092    }
3093}
3094
3095#[cfg(feature = "i16")]
3096impl TryFrom<I16Vec4> for USizeVec4 {
3097    type Error = core::num::TryFromIntError;
3098
3099    #[inline]
3100    fn try_from(v: I16Vec4) -> Result<Self, Self::Error> {
3101        Ok(Self::new(
3102            usize::try_from(v.x)?,
3103            usize::try_from(v.y)?,
3104            usize::try_from(v.z)?,
3105            usize::try_from(v.w)?,
3106        ))
3107    }
3108}
3109
3110#[cfg(feature = "i32")]
3111impl TryFrom<IVec4> for USizeVec4 {
3112    type Error = core::num::TryFromIntError;
3113
3114    #[inline]
3115    fn try_from(v: IVec4) -> Result<Self, Self::Error> {
3116        Ok(Self::new(
3117            usize::try_from(v.x)?,
3118            usize::try_from(v.y)?,
3119            usize::try_from(v.z)?,
3120            usize::try_from(v.w)?,
3121        ))
3122    }
3123}
3124
3125#[cfg(feature = "i64")]
3126impl TryFrom<I64Vec4> for USizeVec4 {
3127    type Error = core::num::TryFromIntError;
3128
3129    #[inline]
3130    fn try_from(v: I64Vec4) -> Result<Self, Self::Error> {
3131        Ok(Self::new(
3132            usize::try_from(v.x)?,
3133            usize::try_from(v.y)?,
3134            usize::try_from(v.z)?,
3135            usize::try_from(v.w)?,
3136        ))
3137    }
3138}
3139
3140#[cfg(feature = "u32")]
3141impl TryFrom<UVec4> for USizeVec4 {
3142    type Error = core::num::TryFromIntError;
3143
3144    #[inline]
3145    fn try_from(v: UVec4) -> Result<Self, Self::Error> {
3146        Ok(Self::new(
3147            usize::try_from(v.x)?,
3148            usize::try_from(v.y)?,
3149            usize::try_from(v.z)?,
3150            usize::try_from(v.w)?,
3151        ))
3152    }
3153}
3154
3155#[cfg(feature = "u64")]
3156impl TryFrom<U64Vec4> for USizeVec4 {
3157    type Error = core::num::TryFromIntError;
3158
3159    #[inline]
3160    fn try_from(v: U64Vec4) -> Result<Self, Self::Error> {
3161        Ok(Self::new(
3162            usize::try_from(v.x)?,
3163            usize::try_from(v.y)?,
3164            usize::try_from(v.z)?,
3165            usize::try_from(v.w)?,
3166        ))
3167    }
3168}
3169
3170#[cfg(feature = "isize")]
3171impl TryFrom<ISizeVec4> for USizeVec4 {
3172    type Error = core::num::TryFromIntError;
3173
3174    #[inline]
3175    fn try_from(v: ISizeVec4) -> Result<Self, Self::Error> {
3176        Ok(Self::new(
3177            usize::try_from(v.x)?,
3178            usize::try_from(v.y)?,
3179            usize::try_from(v.z)?,
3180            usize::try_from(v.w)?,
3181        ))
3182    }
3183}
3184
3185impl From<BVec4> for USizeVec4 {
3186    #[inline]
3187    fn from(v: BVec4) -> Self {
3188        Self::new(
3189            usize::from(v.x),
3190            usize::from(v.y),
3191            usize::from(v.z),
3192            usize::from(v.w),
3193        )
3194    }
3195}
3196
3197#[cfg(not(feature = "scalar-math"))]
3198impl From<BVec4A> for USizeVec4 {
3199    #[inline]
3200    fn from(v: BVec4A) -> Self {
3201        let bool_array: [bool; 4] = v.into();
3202        Self::new(
3203            usize::from(bool_array[0]),
3204            usize::from(bool_array[1]),
3205            usize::from(bool_array[2]),
3206            usize::from(bool_array[3]),
3207        )
3208    }
3209}