basic_dsp_vector/vector_types/checks_and_results.rs
1/// Enumeration of all error reasons
2#[derive(Copy, Clone, PartialEq, Debug)]
3pub enum ErrorReason {
4 /// The operations requires all inputs to have the same size,
5 /// in most cases this means that the following must be true:
6 /// `self.len()` == `argument.len()`
7 InputMustHaveTheSameSize,
8
9 /// The operations requires all inputs to have the same meta data.
10 /// For a vector this means that the following must be true:
11 /// `self.is_complex()` == `argument.is_complex()` &&
12 /// `self.domain()` == `argument.domain()` &&
13 /// `self.delta()`== `argument.domain()`;
14 /// Consider to convert one of the inputs so that this condition is true.
15 /// The necessary operations may include FFT/IFFT, complex/real conversion and resampling.
16 InputMetaDataMustAgree,
17
18 /// The operation requires the input to be complex.
19 InputMustBeComplex,
20
21 /// The operation requires the input to be real.
22 InputMustBeReal,
23
24 /// The operation requires the input to be in time domain.
25 InputMustBeInTimeDomain,
26
27 /// The operation requires the input to be in frequency domain.
28 InputMustBeInFrequencyDomain,
29
30 /// The arguments have an invalid length to perform the operation. The
31 /// operations documentation should have more information about the requirements.
32 /// Please open a defect if this isn't the case.
33 InvalidArgumentLength,
34
35 /// The operations is only valid if the data input contains half of a symmetric spectrum.
36 /// The symmetry definition follows soon however more important is that the element at 0 Hz
37 /// which happens to be the first vector element must be real. The error message is raised
38 /// if this
39 /// is violated, the rest of the definition is only listed here for completeness snce it can't
40 /// be checked.
41 /// The required symmetry for a vector is that for every point
42 /// `vector[x].conj() == vector[-x]`(pseudocode)
43 /// where `x` is the x-axis position relative to 0 Hz and `conj` is the complex conjugate.
44 InputMustBeConjSymmetric,
45
46 /// `self.points()` must be an odd number.
47 InputMustHaveAnOddLength,
48
49 /// The function passed as argument must be symmetric
50 ArgumentFunctionMustBeSymmetric,
51
52 /// The number of arguments passed into a combined operation methods doesn't match
53 /// with the number of arguments specified previously via the `add_op` methods.
54 InvalidNumberOfArgumentsForCombinedOp,
55
56 /// The operation isn't specified for an empty vector.
57 InputMustNotBeEmpty,
58
59 /// Given input must have an even length.
60 InputMustHaveAnEvenLength,
61
62 /// The arguments would require that the type allocates larger memory. But the
63 /// type can't do that.
64 TypeCanNotResize,
65}