Skip to main content

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