1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
use ComplexVector;
use crate::;
/// Panics if two complex vectors are not approximately equal to each other
///
/// # Panics
///
/// 1. Will panic if the dimensions are different
/// 2. Will panic if NAN, INFINITY, or NEG_INFINITY is found
/// 3. Will panic if the absolute difference of components is greater than the tolerance
///
/// # Examples
///
/// ## Accepts small error
///
/// ```
/// use russell_lab::*;
///
/// fn main() {
/// let a = ComplexVector::from(&[cpx!(3.0000001, 2.0000001), cpx!(1.0, 2.0)]);
/// let b = ComplexVector::from(&[cpx!(3.0, 2.0), cpx!(1.0, 2.0)]);
/// complex_vec_approx_eq(&a, &b, 1e-6);
/// }
/// ```
///
/// ## Panics on different values
///
/// ### Real part
///
/// ```should_panic
/// use russell_lab::*;
///
/// fn main() {
/// let a = ComplexVector::from(&[cpx!(1.0, 3.0), cpx!(1.0, 2.0)]);
/// let b = ComplexVector::from(&[cpx!(2.0, 3.0), cpx!(1.0, 2.0)]);
/// complex_vec_approx_eq(&a, &b, 1e-6);
/// }
/// ```
///
/// ### Imaginary part
///
/// ```should_panic
/// use russell_lab::*;
///
/// fn main() {
/// let a = ComplexVector::from(&[cpx!(1.0, 3.0), cpx!(1.0, 2.0)]);
/// let b = ComplexVector::from(&[cpx!(1.0, 4.0), cpx!(1.0, 2.0)]);
/// complex_vec_approx_eq(&a, &b, 1e-6);
/// }
/// ```
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////