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
//! Trait definitions for FWHT operations
//!
//! This module defines the core trait that provides a uniform interface
//! for Fast Walsh-Hadamard Transform operations across different container types.
/// Trait for types that support Fast Walsh-Hadamard Transform operations
///
/// This trait provides a uniform interface for applying FWHT to different
/// container types like `Vec<T>`, `[T; N]`, and `ndarray::Array1<T>`.
///
/// # Examples
///
/// ```
/// use fwht::FWHT;
///
/// let mut data = vec![1.0, 1.0, 1.0, 0.0];
/// data.fwht_mut().unwrap();
/// assert_eq!(data, vec![3.0, 1.0, 1.0, -1.0]);
///
/// let data2 = vec![1.0, 1.0, 1.0, 0.0];
/// let result = data2.fwht().unwrap();
/// assert_eq!(result, vec![3.0, 1.0, 1.0, -1.0]);
/// assert_eq!(data2, vec![1.0, 1.0, 1.0, 0.0]);
/// ```