argmin_math/ndarray_m/
div.rs1use crate::ArgminDiv;
9use ndarray::{Array1, Array2};
10use num_complex::Complex;
11
12macro_rules! make_div {
13 ($t:ty) => {
14 impl ArgminDiv<$t, Array1<$t>> for Array1<$t> {
15 #[inline]
16 fn div(&self, other: &$t) -> Array1<$t> {
17 self / *other
18 }
19 }
20
21 impl ArgminDiv<Array1<$t>, Array1<$t>> for $t {
22 #[inline]
23 fn div(&self, other: &Array1<$t>) -> Array1<$t> {
24 *self / other
25 }
26 }
27
28 impl ArgminDiv<Array1<$t>, Array1<$t>> for Array1<$t> {
29 #[inline]
30 fn div(&self, other: &Array1<$t>) -> Array1<$t> {
31 self / other
32 }
33 }
34
35 impl ArgminDiv<Array2<$t>, Array2<$t>> for Array2<$t> {
36 #[inline]
37 fn div(&self, other: &Array2<$t>) -> Array2<$t> {
38 self / other
39 }
40 }
41 };
42}
43
44make_div!(i8);
45make_div!(u8);
46make_div!(i16);
47make_div!(u16);
48make_div!(i32);
49make_div!(u32);
50make_div!(i64);
51make_div!(u64);
52make_div!(f32);
53make_div!(f64);
54make_div!(Complex<f32>);
55make_div!(Complex<f64>);
56
57#[cfg(test)]
61use crate as argmin_math;
62include!(concat!(
63 env!("CARGO_MANIFEST_DIR"),
64 "/ndarray-tests-src/div.rs"
65));