Skip to content
Merged
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.xcuserstate
/.swiftpm/xcode/package.xcworkspace/xcuserdata/plx.xcuserdatad/UserInterfaceState.xcuserstate
/Sources/HDXLSIMDSupport/Matrices/.DS_Store
.DS_Store
.build/
20 changes: 9 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
// swift-tools-version:5.7
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "HDXLSIMDSupport",
platforms: [
.iOS(.v15),
.macOS(.v12),
.tvOS(.v15),
.watchOS(.v9)
.iOS(.v18),
.macOS(.v15),
.tvOS(.v18),
.watchOS(.v11)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "HDXLSIMDSupport",
targets: ["HDXLSIMDSupport"])
targets: ["HDXLSIMDSupport"]
)
],
dependencies: [
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "HDXLSIMDSupport",
dependencies: []
Expand All @@ -31,8 +29,8 @@ let package = Package(
dependencies: ["HDXLSIMDSupport"]
)
],
swiftLanguageVersions: [
.v5
swiftLanguageModes: [
.v6
]
)

338 changes: 48 additions & 290 deletions README.md

Large diffs are not rendered by default.

30 changes: 5 additions & 25 deletions Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix2x2.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//
// Matrix2x2.swift
//

import Foundation
import simd
import SwiftUI
Expand Down Expand Up @@ -46,7 +42,7 @@ public struct Matrix2x2<Scalar:ExtendedSIMDScalar> :
@inlinable
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
get {
return passthroughValue.passthroughValue
passthroughValue.passthroughValue
}
set {
passthroughValue.passthroughValue = newValue
Expand All @@ -61,33 +57,15 @@ public struct Matrix2x2<Scalar:ExtendedSIMDScalar> :
)
)
}

@inlinable
public var description: String {
get {
return "Matrix2x2: \(String(describing: nativeSIMDRepresentation))"
}
}

@inlinable
public var debugDescription: String {
get {
return "Matrix2x2<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
}
}

@inlinable
public static var zero: Matrix2x2<Scalar> {
get {
return Matrix2x2<Scalar>()
}
Matrix2x2<Scalar>()
}

@inlinable
public var magnitudeSquared: Double {
get {
return Double(componentwiseMagnitudeSquared)
}
Double(componentwiseMagnitudeSquared)
}

@inlinable
Expand All @@ -98,3 +76,5 @@ public struct Matrix2x2<Scalar:ExtendedSIMDScalar> :
}

}

extension Matrix2x2: Sendable where Scalar.Matrix2x2Storage: Sendable { }
30 changes: 5 additions & 25 deletions Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix2x3.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//
// Matrix2x3.swift
//

import Foundation
import simd
import SwiftUI
Expand Down Expand Up @@ -49,7 +45,7 @@ public struct Matrix2x3<Scalar:ExtendedSIMDScalar> :
@inlinable
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
get {
return passthroughValue.passthroughValue
passthroughValue.passthroughValue
}
set {
passthroughValue.passthroughValue = newValue
Expand All @@ -65,32 +61,14 @@ public struct Matrix2x3<Scalar:ExtendedSIMDScalar> :
)
}

@inlinable
public var description: String {
get {
return "Matrix2x3: \(String(describing: nativeSIMDRepresentation))"
}
}

@inlinable
public var debugDescription: String {
get {
return "Matrix2x3<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
}
}

@inlinable
public static var zero: Matrix2x3<Scalar> {
get {
return Matrix2x3<Scalar>()
}
Matrix2x3<Scalar>()
}

@inlinable
public var magnitudeSquared: Double {
get {
return Double(componentwiseMagnitudeSquared)
}
Double(componentwiseMagnitudeSquared)
}

@inlinable
Expand All @@ -101,3 +79,5 @@ public struct Matrix2x3<Scalar:ExtendedSIMDScalar> :
}

}

extension Matrix2x3: Sendable where Scalar.Matrix2x3Storage: Sendable { }
32 changes: 6 additions & 26 deletions Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix2x4.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//
// Matrix2x4.swift
//

import Foundation
import simd
import SwiftUI
Expand Down Expand Up @@ -49,7 +45,7 @@ public struct Matrix2x4<Scalar:ExtendedSIMDScalar> :
@inlinable
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
get {
return passthroughValue.passthroughValue
passthroughValue.passthroughValue
}
set {
passthroughValue.passthroughValue = newValue
Expand All @@ -65,39 +61,23 @@ public struct Matrix2x4<Scalar:ExtendedSIMDScalar> :
)
}

@inlinable
public var description: String {
get {
return "Matrix2x4: \(String(describing: nativeSIMDRepresentation))"
}
}

@inlinable
public var debugDescription: String {
get {
return "Matrix2x4<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
}
}

@inlinable
public static var zero: Matrix2x4<Scalar> {
get {
return Matrix2x4<Scalar>()
}
Matrix2x4<Scalar>()
}

@inlinable
public var magnitudeSquared: Double {
get {
return Double(componentwiseMagnitudeSquared)
}
Double(componentwiseMagnitudeSquared)
}

@inlinable
public mutating func scale(by factor: Double) {
self.formMultiplication(
formMultiplication(
by: Scalar(factor)
)
}

}

extension Matrix2x4: Sendable where Scalar.Matrix2x4Storage: Sendable { }
32 changes: 6 additions & 26 deletions Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix3x2.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//
// Matrix3x2.swift
//

import Foundation
import simd
import SwiftUI
Expand Down Expand Up @@ -50,7 +46,7 @@ public struct Matrix3x2<Scalar:ExtendedSIMDScalar> :
@inlinable
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
get {
return passthroughValue.passthroughValue
passthroughValue.passthroughValue
}
set {
passthroughValue.passthroughValue = newValue
Expand All @@ -66,39 +62,23 @@ public struct Matrix3x2<Scalar:ExtendedSIMDScalar> :
)
}

@inlinable
public var description: String {
get {
return "Matrix3x2: \(String(describing: nativeSIMDRepresentation))"
}
}

@inlinable
public var debugDescription: String {
get {
return "Matrix3x2<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
}
}

@inlinable
public static var zero: Matrix3x2<Scalar> {
get {
return Matrix3x2<Scalar>()
}
Matrix3x2<Scalar>()
}

@inlinable
public var magnitudeSquared: Double {
get {
return Double(componentwiseMagnitudeSquared)
}
Double(componentwiseMagnitudeSquared)
}

@inlinable
public mutating func scale(by factor: Double) {
self.formMultiplication(
formMultiplication(
by: Scalar(factor)
)
}

}

extension Matrix3x2: Sendable where Scalar.Matrix3x2Storage: Sendable { }
30 changes: 5 additions & 25 deletions Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix3x3.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//
// Matrix3x3.swift
//

import Foundation
import simd
import SwiftUI
Expand Down Expand Up @@ -48,7 +44,7 @@ public struct Matrix3x3<Scalar:ExtendedSIMDScalar> :
@inlinable
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
get {
return passthroughValue.passthroughValue
passthroughValue.passthroughValue
}
set {
passthroughValue.passthroughValue = newValue
Expand All @@ -63,33 +59,15 @@ public struct Matrix3x3<Scalar:ExtendedSIMDScalar> :
)
)
}

@inlinable
public var description: String {
get {
return "Matrix3x3: \(String(describing: nativeSIMDRepresentation))"
}
}

@inlinable
public var debugDescription: String {
get {
return "Matrix3x3<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
}
}

@inlinable
public static var zero: Matrix3x3<Scalar> {
get {
return Matrix3x3<Scalar>()
}
Matrix3x3<Scalar>()
}

@inlinable
public var magnitudeSquared: Double {
get {
return Double(componentwiseMagnitudeSquared)
}
Double(componentwiseMagnitudeSquared)
}

@inlinable
Expand All @@ -100,3 +78,5 @@ public struct Matrix3x3<Scalar:ExtendedSIMDScalar> :
}

}

extension Matrix3x3: Sendable where Scalar.Matrix3x3Storage: Sendable { }
Loading
Loading