From bd2ca20729adceee21bf31a52cbbdaf3906bde5a Mon Sep 17 00:00:00 2001 From: Arthur Guiot Date: Mon, 11 May 2020 11:31:45 -0400 Subject: [PATCH] Matrix now work on iOS, watchOS and tvOS Signed-off-by: Arthur Guiot --- Sources/Euler/Geometry/Vector.swift | 2 ++ Sources/Euler/Matrices/MOperations.swift | 2 +- Sources/Euler/Matrices/MProperties.swift | 2 +- Sources/Euler/Matrices/Matrix.swift | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Euler/Geometry/Vector.swift b/Sources/Euler/Geometry/Vector.swift index ce4a342..e08f480 100644 --- a/Sources/Euler/Geometry/Vector.swift +++ b/Sources/Euler/Geometry/Vector.swift @@ -48,10 +48,12 @@ public struct Vector: Equatable { self.dims = multipleDimensions self.origin = origin ?? Point(multipleDimensions: Array(repeating: .zero, count: multipleDimensions.count)) } + #if !os(Linux) /// Converts a Vector into a Matrix public var matrix: Matrix { return Matrix(self.dims.map { $0.asDouble() ?? Double.infinity }, isColumnVector: true) } + #endif /// Origin point translated by the vector public var translated: Point { let dims = zip(origin.dims, self.dims).map { $0 + $1 } diff --git a/Sources/Euler/Matrices/MOperations.swift b/Sources/Euler/Matrices/MOperations.swift index bd2b1b8..2a51225 100644 --- a/Sources/Euler/Matrices/MOperations.swift +++ b/Sources/Euler/Matrices/MOperations.swift @@ -4,7 +4,7 @@ // // Created by Arthur Guiot on 2020-02-07. // -#if os(macOS) +#if !os(Linux) import Foundation import Accelerate diff --git a/Sources/Euler/Matrices/MProperties.swift b/Sources/Euler/Matrices/MProperties.swift index 26ed13e..3672ace 100644 --- a/Sources/Euler/Matrices/MProperties.swift +++ b/Sources/Euler/Matrices/MProperties.swift @@ -4,7 +4,7 @@ // // Created by Arthur Guiot on 2020-02-07. // -#if os(macOS) +#if !os(Linux) import Foundation import Accelerate diff --git a/Sources/Euler/Matrices/Matrix.swift b/Sources/Euler/Matrices/Matrix.swift index 7c47cdb..617bdc0 100644 --- a/Sources/Euler/Matrices/Matrix.swift +++ b/Sources/Euler/Matrices/Matrix.swift @@ -4,7 +4,7 @@ // // Created by Arthur Guiot on 2020-02-07. // -#if os(macOS) +#if !os(Linux) import Foundation import Accelerate