You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51-22Lines changed: 51 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ The `LANumeric` protocol denotes the type of numbers on which *LANumerics* opera
55
55
*`Complex<Float>`
56
56
*`Complex<Double>`
57
57
58
-
Most functionality of *LANumerics* is generic in `LANumeric`, e.g. solving a system of linear equations or computing the singular value decomposition of a matrix.
58
+
Most functionality of *LANumerics* is generic in `LANumeric`, e.g. constructing matrices and computing with them, solving a system of linear equations, or computing the singular value decomposition of a matrix.
59
59
60
60
## Constructing Matrices
61
61
@@ -107,63 +107,92 @@ It is also legal to create matrices with zero columns and/or rows, like `Matrix(
107
107
108
108
## SIMD Support
109
109
110
-
Swift supports `simd` vector and matrix operations. *LANumerics* plays nice with `simd` by providing conversion functions to and from `simd` vectors and matrices. For example,
110
+
Swift supports `simd` vector and matrix operations. *LANumerics* plays nice with `simd` by providing conversion functions to and from `simd` vectors and matrices. For example, starting from
111
111
```swift
112
112
importsimd
113
113
importLANumerics
114
114
115
115
let m =Matrix(rows: [[1, 2, 3], [4, 5, 6]])
116
116
print("m: \(m)")
117
-
let s = m.simd3x2
118
-
print("------------")
119
-
print("as simd: \(s)")
120
-
print("------------")
121
-
print(Matrix(s) == m)
122
117
```
123
-
results in the output
118
+
with output
124
119
```
125
120
m: 2x3-matrix:
126
121
⎛1.0 2.0 3.0⎞
127
122
⎝4.0 5.0 6.0⎠
128
-
------------
129
-
as simd: simd_double3x2(columns: (SIMD2<Double>(1.0, 4.0), SIMD2<Double>(2.0, 5.0), SIMD2<Double>(3.0, 6.0)))
0 commit comments