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
+18-53Lines changed: 18 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,29 +2,22 @@
2
2
3
3
## Introduction
4
4
5
-
Swift Numerics provides a set of modules that support numerical computing in
6
-
Swift. These modules fall broadly into two categories:
5
+
Swift Numerics provides a set of modules that support numerical computing in Swift. These modules fall broadly into two categories:
7
6
8
-
- API that is too specialized to go into the standard library, but which is
9
-
sufficiently general to be centralized in a single common package.
10
-
- API that is under active development toward possible future inclusion in the
11
-
standard library.
7
+
- API that is too specialized to go into the standard library, but which is sufficiently general to be centralized in a single common package.
8
+
- API that is under active development toward possible future inclusion in the standard library.
12
9
13
-
There is some overlap between these two categories, and API that begins in the
14
-
first category may migrate into the second as it matures and more users start
15
-
using Swift Numerics.
10
+
There is some overlap between these two categories, and an API that begins in the first category may migrate into the second as it matures and more users start using Swift Numerics.
16
11
17
-
Swift Numerics modules are fine-grained. For example, if you need support for
18
-
Complex numbers, you can import ComplexModule¹ as a standalone module:
12
+
Swift Numerics modules are fine-grained. For example, if you need support for Complex numbers, you can import ComplexModule¹ as a standalone module:
19
13
20
14
```swift
21
15
importComplexModule
22
16
23
17
let z = Complex<Double>.i
24
18
```
25
19
26
-
There is also a top-level `Numerics` module that re-exports the complete public
27
-
interface of Swift Numerics:
20
+
There is also a top-level `Numerics` module that re-exports the complete public interface of Swift Numerics:
28
21
29
22
```swift
30
23
importNumerics
@@ -36,23 +29,15 @@ Swift Numerics modules have minimal dependencies on other projects.
36
29
37
30
The current modules assume only the availability of the Swift and C standard libraries and the runtime support provided by compiler-rt.
38
31
39
-
Future expansion may assume the availability of other standard interfaces, such
and [LAPACK (Linear Algebra Package)](https://en.wikipedia.org/wiki/LAPACK). But
43
-
modules with more specialized dependencies (or dependencies that are not
44
-
available on all platforms supported by Swift) belong in a separate package.
32
+
Future expansion may assume the availability of other standard interfaces, such as [BLAS (Basic Linear Algebra Subprograms)](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) and [LAPACK (Linear Algebra Package)](https://en.wikipedia.org/wiki/LAPACK). But modules with more specialized dependencies (or dependencies that are not available on all platforms supported by Swift) belong in a separate package.
45
33
46
-
Because we intend to make it possible to adopt Swift Numerics modules in the
47
-
standard library at some future point, Swift Numerics uses the same license and
48
-
contribution guidelines as the Swift project.
34
+
Because we intend to make it possible to adopt Swift Numerics modules in the standard library at some future point, Swift Numerics uses the same license and contribution guidelines as the Swift project.
49
35
50
36
## Using Swift Numerics in your project
51
37
52
38
To use Swift Numerics in a SwiftPM project:
53
39
54
-
1. Add the following line to the
55
-
dependencies in your `Package.swift` file:
40
+
1. Add the following line to the dependencies in your `Package.swift` file:
@@ -71,30 +56,22 @@ dependencies in your `Package.swift` file:
71
56
72
57
## Contributing to Swift Numerics
73
58
74
-
Swift Numerics is a standalone library that is separate from the core Swift
75
-
project. In practice, it will act as a staging ground for some APIs that may
76
-
eventually be incorporated into the Swift Standard Library. When that happens,
77
-
such changes will be proposed to the Swift Standard Library using the
78
-
established evolution process of the Swift project.
59
+
Swift Numerics is a standalone library that is separate from the core Swift project. In practice, it will act as a staging ground for some APIs that may eventually be incorporated into the Swift Standard Library. When that happens, such changes will be proposed to the Swift Standard Library using the established evolution process of the Swift project.
79
60
80
-
Swift Numerics uses GitHub issues to track bugs and features. We use pull
81
-
requests for development.
61
+
Swift Numerics uses GitHub issues to track bugs and features. We use pull requests for development.
82
62
83
63
### How to propose a new module
84
64
85
65
1. Raise an issue with the [new module] tag.
86
66
2. Raise a PR with an implementation sketch.
87
-
3. Once you have some consensus, ask an admin to create a feature branch against
88
-
which PRs can be raised.
89
-
4. When the design has stabilized and is functional enough to be useful, raise a
90
-
PR to merge the new module to master.
67
+
3. Once you have some consensus, ask an admin to create a feature branch against which PRs can be raised.
68
+
4. When the design has stabilized and is functional enough to be useful, raise a PR to merge the new module to master.
91
69
92
70
### How to propose a new feature for an existing module
93
71
94
72
1. Raise an issue with the [enhancement] tag.
95
73
2. Raise a PR with your implementation, and discuss the implementation there.
96
-
3. Once there is a consensus that the new feature is desirable and the design is
97
-
suitable, it can be merged.
74
+
3. Once there is a consensus that the new feature is desirable and the design is suitable, it can be merged.
98
75
99
76
### How to fix a bug, or make smaller improvements
100
77
@@ -103,9 +80,7 @@ requests for development.
103
80
104
81
### Forums
105
82
106
-
Questions about how to use Swift Numerics modules, or issues that are not
107
-
clearly bugs can be discussed in the ["Swift Numerics" section of the Swift
Questions about how to use Swift Numerics modules, or issues that are not clearly bugs can be discussed in the ["Swift Numerics" section of the Swift forums](https://forums.swift.org/c/related-projects/swift-numerics).
¹ Swift is currently unable to use the fully-qualified name for types when a
125
-
type and module have the same name (discussion here:
126
-
https://forums.swift.org/t/pitch-fully-qualified-name-syntax/28482). This would
127
-
prevent users of Swift Numerics who don't need generic types from doing things,
128
-
such as:
99
+
¹ Swift is currently unable to use the fully-qualified name for types when a type and module have the same name (discussion here: https://forums.swift.org/t/pitch-fully-qualified-name-syntax/28482). This would prevent users of Swift Numerics who don't need generic types from doing things, such as:
129
100
130
101
```swift
131
102
importComplex
132
103
// I know I only ever want Complex<Double>, so I shouldn't need the generic parameter.
133
104
typealiasComplex= Complex.Complex<Double> // This doesn't work, because name lookup fails.
134
105
```
135
106
136
-
For this reason, modules that would have this ambiguity are suffixed with
137
-
`Module` within Swift Numerics:
107
+
For this reason, modules that would have this ambiguity are suffixed with `Module` within Swift Numerics:
The `Real` module does not contain a `Real` type, but does contain a `Real`
148
-
protocol, and users may want to define their own `Real` type (and possibly
149
-
re-export the `Real` module) - that why why the suffix is also applied there.
150
-
New modules have to evaluate this decision carefully, but can err on the side of
151
-
adding the suffix. It's expected that most users will simply `import Numerics`,
152
-
so this isn't an issue for them.
117
+
The `Real` module does not contain a `Real` type, but does contain a `Real` protocol, and users may want to define their own `Real` type (and possibly re-export the `Real` module) - that is why the suffix is also applied there. New modules have to evaluate this decision carefully, but can err on the side of adding the suffix. It's expected that most users will simply `import Numerics`, so this isn't an issue for them.
0 commit comments