Swift Math contains a lot of mathematic functions based on C for Graphics (NVidia)
To use Swift Math in a SwiftPM project:
- Add the following line to the dependencies in your
Package.swift
file:
.package(url: "https://github.com/helbertgs/swift-math", from: "1.0.0"),
- Add
Math
as a dependency for your target:
.target(name: "MyTarget", dependencies: [
.product(name: "Math", package: "swift-math"),
"AnotherModule"
]),
- Add
import Math
in your source code.
The Swift Math package is source stable; version numbers follow Semantic Versioning.
The public API of the swift-math
package consists of non-underscored declarations that are marked either public
or usableFromInline
in modules re-exported by the top-level Math
module, excepting any API that involves a conformance to Differentiable (because Differentiable itself is not stable in Swift).
Interfaces that aren't part of the public API may continue to change in any release, including patch releases.
We'd like this package to quickly embrace Swift language and toolchain improvements that are relevant to its mandate. Accordingly, from time to time, we expect that new versions of this package will require clients to upgrade to a more recent Swift toolchain release. Requiring a new Swift release will only require a minor version bump.
Swift Math is a standalone library that is separate from the core Swift project Swift Math uses GitHub issues to track bugs and features. We use pull requests for development.
- Raise an issue with the [new module] tag.
- Raise a PR with an implementation sketch.
- Once you have some consensus, ask an admin to create a feature branch against which PRs can be raised.
- When the design has stabilized and is functional enough to be useful, raise a PR to merge the new module to master.
- Raise an issue with the [enhancement] tag.
- Raise a PR with your implementation, and discuss the implementation there.
- Once there is a consensus that the new feature is desirable and the design is suitable, it can be merged.
- Raise a PR with your change.
- Make sure to add test coverage for whatever changes you are making.