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
//! Literal construction macros for [`Vector`](crate::Vector) and [`Matrix`](crate::Matrix).
/// Builds a [`Vector`](crate::Vector) from a comma-separated list of components.
///
/// ```
/// use multicalc::{vector, Vector};
/// let v = vector![1.0, 2.0, 3.0];
/// assert_eq!(v, Vector::new([1.0, 2.0, 3.0]));
/// ```
///
/// Supports repeat syntax:
///
/// ```
/// use multicalc::{vector, Vector};
/// let v = vector![1.0; 3];
/// assert_eq!(v, Vector::new([1.0, 1.0, 1.0]));
/// ```
/// Builds a [`Matrix`](crate::Matrix) from bracketed row literals.
///
/// ```
/// use multicalc::{matrix, Matrix};
/// let m = matrix![[1.0, 2.0], [3.0, 4.0]];
/// assert_eq!(m, Matrix::new([[1.0, 2.0], [3.0, 4.0]]));
/// ```
///
/// Uneven row lengths are rejected at compile time:
///
/// ```compile_fail
/// use multicalc::matrix;
/// let _ = matrix![[1.0, 2.0], [3.0]];
/// ```
///
/// Supports repeat syntax:
///
/// ```
/// use multicalc::{matrix, Matrix};
/// let m = matrix![[1.0; 2]; 2];
/// assert_eq!(m, Matrix::new([[1.0, 1.0], [1.0, 1.0]]));
/// ```
;
=> ;
=> ;
}