Skip to content

Commit e5ec825

Browse files
author
Terence
committed
Allow multiplying matrix by Complex<> on the left
This simply inserts `Complex<f32>` and `Complex<f64>` into the `left_scalar_mul_impl!` macro alongside the primitives' trait impls.
1 parent 1cfc539 commit e5ec825

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/base/ops.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use num::{One, Zero};
2+
use num_complex::Complex;
23
use std::iter;
34
use std::ops::{
45
Add, AddAssign, Div, DivAssign, Index, IndexMut, Mul, MulAssign, Neg, Sub, SubAssign,
@@ -545,7 +546,22 @@ macro_rules! left_scalar_mul_impl(
545546
)*}
546547
);
547548

548-
left_scalar_mul_impl!(u8, u16, u32, u64, usize, i8, i16, i32, i64, isize, f32, f64);
549+
left_scalar_mul_impl!(
550+
u8,
551+
u16,
552+
u32,
553+
u64,
554+
usize,
555+
i8,
556+
i16,
557+
i32,
558+
i64,
559+
isize,
560+
f32,
561+
f64,
562+
Complex<f32>,
563+
Complex<f64>
564+
);
549565

550566
// Matrix × Matrix
551567
impl<'a, 'b, T, R1: Dim, C1: Dim, R2: Dim, C2: Dim, SA, SB> Mul<&'b Matrix<T, R2, C2, SB>>

0 commit comments

Comments
 (0)