Skip to content

Commit

Permalink
Allow multiplying matrix by Complex<> on the left
Browse files Browse the repository at this point in the history
This simply inserts `Complex<f32>` and `Complex<f64>` into the
`left_scalar_mul_impl!` macro alongside the primitives' trait
impls.
  • Loading branch information
Terence committed Dec 24, 2023
1 parent 7a95644 commit c95cef8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/base/ops.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use num_complex::Complex;
use std::iter;
use std::ops::{Add, AddAssign, Div, DivAssign, Index, IndexMut, Mul, MulAssign, Neg, Sub,
SubAssign};
Expand Down Expand Up @@ -493,7 +494,22 @@ macro_rules! left_scalar_mul_impl(
)*}
);

left_scalar_mul_impl!(u8, u16, u32, u64, usize, i8, i16, i32, i64, isize, f32, f64);
left_scalar_mul_impl!(
u8,
u16,
u32,
u64,
usize,
i8,
i16,
i32,
i64,
isize,
f32,
f64,
Complex<f32>,
Complex<f64>
);

// Matrix × Matrix
impl<'a, 'b, N, R1: Dim, C1: Dim, R2: Dim, C2: Dim, SA, SB> Mul<&'b Matrix<N, R2, C2, SB>>
Expand Down

0 comments on commit c95cef8

Please sign in to comment.