Skip to content

Commit f95f0cf

Browse files
authored
Swift-Numerics try to improve preformance (#846)
* Try to improve preformance * Implement for more exercises * Update space age aswell * Add complex numbers * Fix space-age template
1 parent e8f5096 commit f95f0cf

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

exercises/concept/freelancer-rates/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ let package = Package(
2424
dependencies: []),
2525
.testTarget(
2626
name: "FreelancerRatesTests",
27-
dependencies: ["FreelancerRates", .product(name: "Numerics", package: "swift-numerics"),]),
27+
dependencies: ["FreelancerRates", .product(name: "RealModule", package: "swift-numerics"),]),
2828
]
2929
)

exercises/concept/freelancer-rates/Tests/FreelancerRatesTests/FreelancerRatesTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Testing
22
import Foundation
3-
import Numerics
3+
import RealModule
44

55
@testable import FreelancerRates
66

exercises/concept/lasagna-master/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ let package = Package(
2424
dependencies: []),
2525
.testTarget(
2626
name: "LasagnaMasterTests",
27-
dependencies: ["LasagnaMaster", .product(name: "Numerics", package: "swift-numerics")]),
27+
dependencies: ["LasagnaMaster", .product(name: "RealModule", package: "swift-numerics")]),
2828
]
2929
)

exercises/concept/lasagna-master/Tests/LasagnaMasterTests/LasagnaMasterTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Testing
22
import Foundation
3-
import Numerics
3+
import RealModule
44

55
@testable import LasagnaMaster
66

exercises/concept/pizza-slices/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ let package = Package(
2424
dependencies: []),
2525
.testTarget(
2626
name: "PizzaSlicesTests",
27-
dependencies: ["PizzaSlices", .product(name: "Numerics", package: "swift-numerics"),]),
27+
dependencies: ["PizzaSlices", .product(name: "RealModule", package: "swift-numerics"),]),
2828
]
2929
)

exercises/concept/pizza-slices/Tests/PizzaSlicesTests/PizzaSlicesTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Testing
22
import Foundation
3-
import Numerics
3+
import RealModule
44

55
@testable import PizzaSlices
66

exercises/practice/complex-numbers/.docs/instructions.append.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
You will have to implement your own equality operator for the `ComplexNumber` object.
44
This will pose the challenge of comparing two floating point numbers.
55
It might be useful to use the method `isApproximatelyEqual(to:absoluteTolerance:)` which can be found in the [Numerics][swift-numberics] library.
6+
Due to preformance issues will you only have access to the `RealModule` part.
7+
To import it simply write: `import RealModule` at the top of the file.
68
A given tolerance of `0.00001` should be enough to pass the tests.
79
The library is already imported in the project so it is just to import it in your file.
810

exercises/practice/complex-numbers/.meta/Sources/ComplexNumbers/ComplexNumbersExample.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import Numerics
2+
import RealModule
33

44
struct ComplexNumbers: Equatable {
55

exercises/practice/complex-numbers/Package.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ let package = Package(
1616
.target(
1717
name: "ComplexNumbers",
1818
dependencies: [
19-
.product(name: "Numerics", package: "swift-numerics")
19+
.product(name: "RealModule", package: "swift-numerics")
2020
]),
2121
.testTarget(
2222
name: "ComplexNumbersTests",
2323
dependencies: [
24-
"ComplexNumbers",
25-
.product(name: "Numerics", package: "swift-numerics"),
24+
"ComplexNumbers"
2625
]),
2726
]
2827
)

exercises/practice/space-age/.meta/template.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Testing
22
import Foundation
3-
import Numerics
3+
import RealModule
44
@testable import {{exercise|camelCase}}
55

66
let RUNALL = Bool(ProcessInfo.processInfo.environment["RUNALL", default: "false"]) ?? false

0 commit comments

Comments
 (0)