MCPcopy Create free account
hub / github.com/PerroEngine/Perro / zip_each

Method zip_each

perro_source/core/perro_structs/src/structs/matrix/mod.rs:449–462  ·  view source on GitHub ↗
(
        &self,
        rhs: &Matrix<ROWS, COLS, U>,
        mut f: impl FnMut(usize, usize, &T, &U),
    )

Source from the content-addressed store, hash-verified

447
448 #[inline]
449 pub fn zip_each<U>(
450 &self,
451 rhs: &Matrix<ROWS, COLS, U>,
452 mut f: impl FnMut(usize, usize, &T, &U),
453 ) {
454 for row in 0..ROWS {
455 for col in 0..COLS {
456 // SAFETY: row/col come from matrix bounds for both same-shape matrices.
457 f(row, col, unsafe { self.get_unchecked(row, col) }, unsafe {
458 rhs.get_unchecked(row, col)
459 });
460 }
461 }
462 }
463
464 #[inline]
465 pub fn zip_each_mut<U>(

Calls 1

get_uncheckedMethod · 0.80