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
//! Native complex floating point types whose real and imaginary parts are stored contiguously.
//!
//! The types [`c32`] and [`c64`] respectively have the same layout as [`num_complex::Complex32`]
//! and [`num_complex::Complex64`].
//!
//! They differ in the way they are treated by the `faer` library: When stored in a matrix,
//! `Mat<c32>` and `Mat<c64>` internally contain a single container of contiguously stored
//! `c32` and `c64` values, whereas `Mat<num_complex::Complex32>` and
//! `Mat<num_complex::Complex64>` internally contain two containers, separately storing the real
//! and imaginary parts of the complex values.
//!
//! Matrix operations using `c32` and `c64` are usually more efficient and should be preferred in
//! most cases. `num_complex::Complex` matrices have better support for generic data types.
//!
//! The drawing below represents a simplified layout of the `Mat` structure for each of `c32` and
//! `num_complex::Complex32`.
//!
//! ```notcode
//! ┌──────────────────┐
//! │ Mat<c32> │
//! ├──────────────────┤
//! │ ptr: *mut c32 ─ ─│─ ─ ─ ─ ┐
//! │ nrows: usize │ ┌─────────┐
//! │ ncols: usize │ │ z0: c32 │
//! │ ... │ │ z1: c32 │
//! └──────────────────┘ │ z2: c32 │
//! │ ... │
//! └─────────┘
//!
//! ┌───────────────────────┐
//! │ Mat<Complex32> │
//! ├───────────────────────┤
//! │ ptr_real: *mut f32 ─ ─│─ ─ ─ ─ ┐
//! │ ptr_imag: *mut f32 ─ ─│─ ─ ─ ─ ┼ ─ ─ ─ ─ ─ ─ ─ ┐
//! │ nrows: usize │ ┌──────────┐ ┌──────────┐
//! │ ncols: usize │ │ re0: f32 │ │ im0: f32 │
//! │ ... │ │ re1: f32 │ │ im1: f32 │
//! └───────────────────────┘ │ re2: f32 │ │ im2: f32 │
//! │ ... │ │ ... │
//! └──────────┘ └──────────┘
//! ```
pub use c32;
pub use c32conj;
pub use c64;
pub use c64conj;