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 Mar 28, 2024
1 parent 1cfc539 commit e5ec825
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,4 +1,5 @@
use num::{One, Zero};
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 @@ -545,7 +546,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, T, R1: Dim, C1: Dim, R2: Dim, C2: Dim, SA, SB> Mul<&'b Matrix<T, R2, C2, SB>>
Expand Down

0 comments on commit e5ec825

Please sign in to comment.