MCPcopy Create free account
hub / github.com/Axect/Peroxide / index

Method index

src/complex/matrix.rs:1485–1494  ·  view source on GitHub ↗
(&self, pair: (usize, usize))

Source from the content-addressed store, hash-verified

1483 type Output = C64;
1484
1485 fn index(&self, pair: (usize, usize)) -> &C64 {
1486 let p = self.ptr();
1487 let i = pair.0;
1488 let j = pair.1;
1489 assert!(i < self.row && j < self.col, "Index out of range");
1490 match self.shape {
1491 Shape::Row => unsafe { &*p.add(i * self.col + j) },
1492 Shape::Col => unsafe { &*p.add(i + j * self.row) },
1493 }
1494 }
1495}
1496
1497/// IndexMut for Complex Matrix (Assign)

Callers

nothing calls this directly

Calls 2

ptrMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected