We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fba371 commit 24555e1Copy full SHA for 24555e1
src/types.rs
@@ -1,6 +1,7 @@
1
2
pub use num_complex::Complex32 as c32;
3
pub use num_complex::Complex64 as c64;
4
+use num_complex::Complex;
5
use num_traits::Float;
6
use std::ops::*;
7
@@ -20,6 +21,10 @@ pub trait Absolute {
20
21
}
22
23
24
+pub trait Conjugate: Copy {
25
+ fn conj(self) -> Self;
26
+}
27
+
28
macro_rules! impl_traits {
29
($real:ty, $complex:ty) => {
30
@@ -59,6 +64,18 @@ impl Absolute for $complex {
59
64
60
65
61
66
67
+impl Conjugate for $real {
68
+ fn conj(self) -> Self {
69
+ self
70
+ }
71
72
73
+impl Conjugate for $complex {
74
75
+ Complex::conj(&self)
76
77
78
62
79
}} // impl_traits!
63
80
81
impl_traits!(f64, c64);
0 commit comments