oxiphysics_core/complex/complexmatn_traits.rs
1//! # ComplexMatN - Trait Implementations
2//!
3//! This module contains trait implementations for `ComplexMatN`.
4//!
5//! ## Implemented Traits
6//!
7//! - `IndexMut`
8//! - `Index`
9//!
10//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
11
12#[allow(unused_imports)]
13use super::functions::*;
14use super::types::{Complex, ComplexMatN};
15
16impl std::ops::IndexMut<(usize, usize)> for ComplexMatN {
17 fn index_mut(&mut self, (r, c): (usize, usize)) -> &mut Complex {
18 &mut self.data[r * self.n + c]
19 }
20}
21
22impl std::ops::Index<(usize, usize)> for ComplexMatN {
23 type Output = Complex;
24 fn index(&self, (r, c): (usize, usize)) -> &Complex {
25 &self.data[r * self.n + c]
26 }
27}