swift-numerics
swift-numerics copied to clipboard
Advanced mathematical types and functions for Swift
@stephentyrone Here is my implementation for the issue. Please let me know if I missed something.
As of now, `Quaternion`s provide a number of different representations to access the encoded rotational/transformational properties, alongside a function to directly act on (rotate) an arbitrary 3 dimensional vector. Two...
This extends https://github.com/apple/swift-numerics/pull/206 and adds the remaining quaternionic elementary functions; making `Quaternion` fully conform to `ElementaryFunctions`. 🎉 Most of the functions draw inspiration from the implementation details of the corresponding...
As of now, `Quaternion` conforms to the `AlgebraicField` protocol defined in `RealModule`. However quaternions are a non-commutative, associative algebra over the real numbers and thus, this is incorrect. Their structure...
Implements adding,subtracting,negating,multiplyingWithSaturation on FixedWidthInteger, which seems like a plausible MVP for saturating arithmetic. Still need to write tests. No attempt to make these map to HW instructions yet. I gave...
I wonder if we might rather define our trig functions in terms of an `Angle` type: ```swift public struct Angle { public var radians: T public init(radians: T) { self.radians...
Implement IEEE 754 Decimal128 (and possibly Decimal64 as well, though it's less important). This has a dependency on [fixed-width integer types](https://github.com/apple/swift-numerics/issues/4) because we want to be able to leverage UInt128...
Add a ShapedArray type and/or protocol suitable for use as the common currency type for vectors / linear algebra / image processing / tensors, like ndarray is for numpy. This...
This commit adds the following implementation hooks to the AlgebraicField protocol: static func _relaxedAdd(_:Self, _:Self) -> Self static func _relaxedMul(_:Self, _:Self) -> Self These are equivalent to + and *,...
Fixes #5 This is the step 2 "Sketch" PR. It's actually very complete, but obviously perhaps not ideal in style and documentation (since there is none of the latter). Probably...