From da20356543747ca331feaa4e32385d01f7821bf7 Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Fri, 30 Aug 2019 12:42:30 +0200 Subject: [PATCH] Reorganized files --- .../{ => Auxiliary Functions}/Auxiliary.swift | 0 .../Convolution.swift | 0 .../{ => Digital Signal Processing}/FFT.swift | 0 Sources/Surge/Exponential/Exponential.swift | 73 ++++++++ .../{ => General Arithmetic}/Arithmetic.swift | 0 .../{ => General Arithmetic}/Power.swift | 0 Sources/Surge/Hyperbolic.swift | 177 ------------------ .../Surge/{ => Linear Algebra}/Matrix.swift | 0 .../Surge/{ => Linear Algebra}/Scalar.swift | 0 .../Surge/{ => Linear Algebra}/Vector.swift | 0 .../Logarithm.swift} | 52 ----- .../Surge/{ => Statistics}/Statistics.swift | 0 .../{ => Trigonometry}/Trigonometric.swift | 156 +++++++++++++++ .../Array+Extensions.swift} | 0 .../ArraySlice+Extensions.swift} | 0 .../{ => Utilities}/OperatorPrecedences.swift | 0 Sources/Surge/{ => Utilities}/Pointers.swift | 0 .../Surge/{ => Utilities}/UnsafeMemory.swift | 0 .../{ => Utilities}/UnsafeMutableMemory.swift | 0 Surge.xcodeproj/project.pbxproj | 162 +++++++++++----- 20 files changed, 346 insertions(+), 274 deletions(-) rename Sources/Surge/{ => Auxiliary Functions}/Auxiliary.swift (100%) rename Sources/Surge/{ => Digital Signal Processing}/Convolution.swift (100%) rename Sources/Surge/{ => Digital Signal Processing}/FFT.swift (100%) create mode 100644 Sources/Surge/Exponential/Exponential.swift rename Sources/Surge/{ => General Arithmetic}/Arithmetic.swift (100%) rename Sources/Surge/{ => General Arithmetic}/Power.swift (100%) delete mode 100644 Sources/Surge/Hyperbolic.swift rename Sources/Surge/{ => Linear Algebra}/Matrix.swift (100%) rename Sources/Surge/{ => Linear Algebra}/Scalar.swift (100%) rename Sources/Surge/{ => Linear Algebra}/Vector.swift (100%) rename Sources/Surge/{Exponential.swift => Logarithm/Logarithm.swift} (70%) rename Sources/Surge/{ => Statistics}/Statistics.swift (100%) rename Sources/Surge/{ => Trigonometry}/Trigonometric.swift (63%) rename Sources/Surge/{ArrayUnsafeMemory.swift => Utilities/Array+Extensions.swift} (100%) rename Sources/Surge/{ArraySliceUnsafeMemory.swift => Utilities/ArraySlice+Extensions.swift} (100%) rename Sources/Surge/{ => Utilities}/OperatorPrecedences.swift (100%) rename Sources/Surge/{ => Utilities}/Pointers.swift (100%) rename Sources/Surge/{ => Utilities}/UnsafeMemory.swift (100%) rename Sources/Surge/{ => Utilities}/UnsafeMutableMemory.swift (100%) diff --git a/Sources/Surge/Auxiliary.swift b/Sources/Surge/Auxiliary Functions/Auxiliary.swift similarity index 100% rename from Sources/Surge/Auxiliary.swift rename to Sources/Surge/Auxiliary Functions/Auxiliary.swift diff --git a/Sources/Surge/Convolution.swift b/Sources/Surge/Digital Signal Processing/Convolution.swift similarity index 100% rename from Sources/Surge/Convolution.swift rename to Sources/Surge/Digital Signal Processing/Convolution.swift diff --git a/Sources/Surge/FFT.swift b/Sources/Surge/Digital Signal Processing/FFT.swift similarity index 100% rename from Sources/Surge/FFT.swift rename to Sources/Surge/Digital Signal Processing/FFT.swift diff --git a/Sources/Surge/Exponential/Exponential.swift b/Sources/Surge/Exponential/Exponential.swift new file mode 100644 index 0000000..0ce481c --- /dev/null +++ b/Sources/Surge/Exponential/Exponential.swift @@ -0,0 +1,73 @@ +// Copyright © 2014-2018 the Surge contributors +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import Accelerate + +// MARK: - Exponentiation + +/// - Warning: does not support memory stride (assumes stride is 1). +public func exp(_ x: X) -> [Float] where X.Element == Float { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Float](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvexpf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +/// - Warning: does not support memory stride (assumes stride is 1). +public func exp(_ x: X) -> [Double] where X.Element == Double { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Double](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvexp(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +// MARK: - Square Exponentiation + +/// - Warning: does not support memory stride (assumes stride is 1). +public func exp2(_ x: X) -> [Float] where X.Element == Float { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Float](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvexp2f(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +/// - Warning: does not support memory stride (assumes stride is 1). +public func exp2(_ x: X) -> [Double] where X.Element == Double { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Double](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvexp2(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} diff --git a/Sources/Surge/Arithmetic.swift b/Sources/Surge/General Arithmetic/Arithmetic.swift similarity index 100% rename from Sources/Surge/Arithmetic.swift rename to Sources/Surge/General Arithmetic/Arithmetic.swift diff --git a/Sources/Surge/Power.swift b/Sources/Surge/General Arithmetic/Power.swift similarity index 100% rename from Sources/Surge/Power.swift rename to Sources/Surge/General Arithmetic/Power.swift diff --git a/Sources/Surge/Hyperbolic.swift b/Sources/Surge/Hyperbolic.swift deleted file mode 100644 index 76e2a25..0000000 --- a/Sources/Surge/Hyperbolic.swift +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright © 2014-2018 the Surge contributors -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Accelerate - -// MARK: - Hyperbolic Sine - -/// - Warning: does not support memory stride (assumes stride is 1). -public func sinh(_ x: X) -> [Float] where X.Iterator.Element == Float { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Float](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvsinhf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -/// - Warning: does not support memory stride (assumes stride is 1). -public func sinh(_ x: X) -> [Double] where X.Iterator.Element == Double { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Double](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvsinh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -// MARK: - Hyperbolic Cosine - -/// - Warning: does not support memory stride (assumes stride is 1). -public func cosh(_ x: X) -> [Float] where X.Iterator.Element == Float { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Float](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvcoshf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -/// - Warning: does not support memory stride (assumes stride is 1). -public func cosh(_ x: X) -> [Double] where X.Iterator.Element == Double { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Double](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvcosh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -// MARK: - Hyperbolic Tangent - -/// - Warning: does not support memory stride (assumes stride is 1). -public func tanh(_ x: X) -> [Float] where X.Iterator.Element == Float { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Float](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvtanhf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -/// - Warning: does not support memory stride (assumes stride is 1). -public func tanh(_ x: X) -> [Double] where X.Iterator.Element == Double { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Double](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvtanh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -// MARK: - Inverse Hyperbolic Sine - -/// - Warning: does not support memory stride (assumes stride is 1). -public func asinh(_ x: X) -> [Float] where X.Iterator.Element == Float { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Float](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvasinhf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -/// - Warning: does not support memory stride (assumes stride is 1). -public func asinh(_ x: X) -> [Double] where X.Iterator.Element == Double { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Double](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvasinh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -// MARK: - Inverse Hyperbolic Cosine - -/// - Warning: does not support memory stride (assumes stride is 1). -public func acosh(_ x: X) -> [Float] where X.Iterator.Element == Float { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Float](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvacoshf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -/// - Warning: does not support memory stride (assumes stride is 1). -public func acosh(_ x: X) -> [Double] where X.Iterator.Element == Double { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Double](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvacosh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -// MARK: - Inverse Hyperbolic Tangent - -/// - Warning: does not support memory stride (assumes stride is 1). -public func atanh(_ x: X) -> [Float] where X.Iterator.Element == Float { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Float](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvatanhf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -/// - Warning: does not support memory stride (assumes stride is 1). -public func atanh(_ x: X) -> [Double] where X.Iterator.Element == Double { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Double](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvatanh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} diff --git a/Sources/Surge/Matrix.swift b/Sources/Surge/Linear Algebra/Matrix.swift similarity index 100% rename from Sources/Surge/Matrix.swift rename to Sources/Surge/Linear Algebra/Matrix.swift diff --git a/Sources/Surge/Scalar.swift b/Sources/Surge/Linear Algebra/Scalar.swift similarity index 100% rename from Sources/Surge/Scalar.swift rename to Sources/Surge/Linear Algebra/Scalar.swift diff --git a/Sources/Surge/Vector.swift b/Sources/Surge/Linear Algebra/Vector.swift similarity index 100% rename from Sources/Surge/Vector.swift rename to Sources/Surge/Linear Algebra/Vector.swift diff --git a/Sources/Surge/Exponential.swift b/Sources/Surge/Logarithm/Logarithm.swift similarity index 70% rename from Sources/Surge/Exponential.swift rename to Sources/Surge/Logarithm/Logarithm.swift index 28964fd..bfa7f3d 100644 --- a/Sources/Surge/Exponential.swift +++ b/Sources/Surge/Logarithm/Logarithm.swift @@ -20,58 +20,6 @@ import Accelerate -// MARK: - Exponentiation - -/// - Warning: does not support memory stride (assumes stride is 1). -public func exp(_ x: X) -> [Float] where X.Element == Float { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Float](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvexpf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -/// - Warning: does not support memory stride (assumes stride is 1). -public func exp(_ x: X) -> [Double] where X.Element == Double { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Double](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvexp(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -// MARK: - Square Exponentiation - -/// - Warning: does not support memory stride (assumes stride is 1). -public func exp2(_ x: X) -> [Float] where X.Element == Float { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Float](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvexp2f(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - -/// - Warning: does not support memory stride (assumes stride is 1). -public func exp2(_ x: X) -> [Double] where X.Element == Double { - return x.withUnsafeMemory { xm in - precondition(xm.stride == 1, "\(#function) does not support strided memory access") - var results = [Double](repeating: 0.0, count: numericCast(x.count)) - results.withUnsafeMutableBufferPointer { rbp in - vvexp2(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) - } - return results - } -} - // MARK: - Natural Logarithm /// - Warning: does not support memory stride (assumes stride is 1). diff --git a/Sources/Surge/Statistics.swift b/Sources/Surge/Statistics/Statistics.swift similarity index 100% rename from Sources/Surge/Statistics.swift rename to Sources/Surge/Statistics/Statistics.swift diff --git a/Sources/Surge/Trigonometric.swift b/Sources/Surge/Trigonometry/Trigonometric.swift similarity index 63% rename from Sources/Surge/Trigonometric.swift rename to Sources/Surge/Trigonometry/Trigonometric.swift index a257dd1..9f43e8c 100644 --- a/Sources/Surge/Trigonometric.swift +++ b/Sources/Surge/Trigonometry/Trigonometric.swift @@ -261,3 +261,159 @@ func deg2rad(_ x: X) -> [Double] where X.Element == D return results } } + +// MARK: - Hyperbolic Sine + +/// - Warning: does not support memory stride (assumes stride is 1). +public func sinh(_ x: X) -> [Float] where X.Iterator.Element == Float { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Float](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvsinhf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +/// - Warning: does not support memory stride (assumes stride is 1). +public func sinh(_ x: X) -> [Double] where X.Iterator.Element == Double { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Double](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvsinh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +// MARK: - Hyperbolic Cosine + +/// - Warning: does not support memory stride (assumes stride is 1). +public func cosh(_ x: X) -> [Float] where X.Iterator.Element == Float { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Float](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvcoshf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +/// - Warning: does not support memory stride (assumes stride is 1). +public func cosh(_ x: X) -> [Double] where X.Iterator.Element == Double { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Double](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvcosh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +// MARK: - Hyperbolic Tangent + +/// - Warning: does not support memory stride (assumes stride is 1). +public func tanh(_ x: X) -> [Float] where X.Iterator.Element == Float { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Float](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvtanhf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +/// - Warning: does not support memory stride (assumes stride is 1). +public func tanh(_ x: X) -> [Double] where X.Iterator.Element == Double { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Double](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvtanh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +// MARK: - Inverse Hyperbolic Sine + +/// - Warning: does not support memory stride (assumes stride is 1). +public func asinh(_ x: X) -> [Float] where X.Iterator.Element == Float { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Float](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvasinhf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +/// - Warning: does not support memory stride (assumes stride is 1). +public func asinh(_ x: X) -> [Double] where X.Iterator.Element == Double { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Double](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvasinh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +// MARK: - Inverse Hyperbolic Cosine + +/// - Warning: does not support memory stride (assumes stride is 1). +public func acosh(_ x: X) -> [Float] where X.Iterator.Element == Float { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Float](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvacoshf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +/// - Warning: does not support memory stride (assumes stride is 1). +public func acosh(_ x: X) -> [Double] where X.Iterator.Element == Double { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Double](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvacosh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +// MARK: - Inverse Hyperbolic Tangent + +/// - Warning: does not support memory stride (assumes stride is 1). +public func atanh(_ x: X) -> [Float] where X.Iterator.Element == Float { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Float](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvatanhf(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} + +/// - Warning: does not support memory stride (assumes stride is 1). +public func atanh(_ x: X) -> [Double] where X.Iterator.Element == Double { + return x.withUnsafeMemory { xm in + precondition(xm.stride == 1, "\(#function) does not support strided memory access") + var results = [Double](repeating: 0.0, count: numericCast(x.count)) + results.withUnsafeMutableBufferPointer { rbp in + vvatanh(rbp.baseAddress!, xm.pointer, [numericCast(xm.count)]) + } + return results + } +} diff --git a/Sources/Surge/ArrayUnsafeMemory.swift b/Sources/Surge/Utilities/Array+Extensions.swift similarity index 100% rename from Sources/Surge/ArrayUnsafeMemory.swift rename to Sources/Surge/Utilities/Array+Extensions.swift diff --git a/Sources/Surge/ArraySliceUnsafeMemory.swift b/Sources/Surge/Utilities/ArraySlice+Extensions.swift similarity index 100% rename from Sources/Surge/ArraySliceUnsafeMemory.swift rename to Sources/Surge/Utilities/ArraySlice+Extensions.swift diff --git a/Sources/Surge/OperatorPrecedences.swift b/Sources/Surge/Utilities/OperatorPrecedences.swift similarity index 100% rename from Sources/Surge/OperatorPrecedences.swift rename to Sources/Surge/Utilities/OperatorPrecedences.swift diff --git a/Sources/Surge/Pointers.swift b/Sources/Surge/Utilities/Pointers.swift similarity index 100% rename from Sources/Surge/Pointers.swift rename to Sources/Surge/Utilities/Pointers.swift diff --git a/Sources/Surge/UnsafeMemory.swift b/Sources/Surge/Utilities/UnsafeMemory.swift similarity index 100% rename from Sources/Surge/UnsafeMemory.swift rename to Sources/Surge/Utilities/UnsafeMemory.swift diff --git a/Sources/Surge/UnsafeMutableMemory.swift b/Sources/Surge/Utilities/UnsafeMutableMemory.swift similarity index 100% rename from Sources/Surge/UnsafeMutableMemory.swift rename to Sources/Surge/Utilities/UnsafeMutableMemory.swift diff --git a/Surge.xcodeproj/project.pbxproj b/Surge.xcodeproj/project.pbxproj index ec54fcd..a0b4218 100644 --- a/Surge.xcodeproj/project.pbxproj +++ b/Surge.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ 614AD33A1FC0AF72002BFE1C /* Convolution.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944D1F762B58002A4AD2 /* Convolution.swift */; }; 614AD33B1FC0AF72002BFE1C /* Exponential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944E1F762B58002A4AD2 /* Exponential.swift */; }; 614AD33C1FC0AF72002BFE1C /* FFT.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944F1F762B58002A4AD2 /* FFT.swift */; }; - 614AD33D1FC0AF72002BFE1C /* Hyperbolic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394501F762B58002A4AD2 /* Hyperbolic.swift */; }; 614AD33E1FC0AF72002BFE1C /* Matrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394511F762B58002A4AD2 /* Matrix.swift */; }; 614AD33F1FC0AF72002BFE1C /* Pointers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394521F762B58002A4AD2 /* Pointers.swift */; }; 614AD3401FC0AF72002BFE1C /* Power.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394531F762B58002A4AD2 /* Power.swift */; }; @@ -35,7 +34,6 @@ 614AD36B1FC0B0CC002BFE1C /* Convolution.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944D1F762B58002A4AD2 /* Convolution.swift */; }; 614AD36C1FC0B0CC002BFE1C /* Exponential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944E1F762B58002A4AD2 /* Exponential.swift */; }; 614AD36D1FC0B0CC002BFE1C /* FFT.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944F1F762B58002A4AD2 /* FFT.swift */; }; - 614AD36E1FC0B0CC002BFE1C /* Hyperbolic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394501F762B58002A4AD2 /* Hyperbolic.swift */; }; 614AD36F1FC0B0CC002BFE1C /* Matrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394511F762B58002A4AD2 /* Matrix.swift */; }; 614AD3701FC0B0CC002BFE1C /* Pointers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394521F762B58002A4AD2 /* Pointers.swift */; }; 614AD3711FC0B0CC002BFE1C /* Power.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394531F762B58002A4AD2 /* Power.swift */; }; @@ -55,7 +53,6 @@ 614AD38D1FC0B134002BFE1C /* Convolution.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944D1F762B58002A4AD2 /* Convolution.swift */; }; 614AD38E1FC0B134002BFE1C /* Exponential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944E1F762B58002A4AD2 /* Exponential.swift */; }; 614AD38F1FC0B134002BFE1C /* FFT.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944F1F762B58002A4AD2 /* FFT.swift */; }; - 614AD3901FC0B134002BFE1C /* Hyperbolic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394501F762B58002A4AD2 /* Hyperbolic.swift */; }; 614AD3911FC0B134002BFE1C /* Matrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394511F762B58002A4AD2 /* Matrix.swift */; }; 614AD3921FC0B134002BFE1C /* Pointers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394521F762B58002A4AD2 /* Pointers.swift */; }; 614AD3931FC0B134002BFE1C /* Power.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394531F762B58002A4AD2 /* Power.swift */; }; @@ -69,7 +66,6 @@ 615394581F762B59002A4AD2 /* Convolution.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944D1F762B58002A4AD2 /* Convolution.swift */; }; 615394591F762B59002A4AD2 /* Exponential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944E1F762B58002A4AD2 /* Exponential.swift */; }; 6153945A1F762B59002A4AD2 /* FFT.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6153944F1F762B58002A4AD2 /* FFT.swift */; }; - 6153945B1F762B59002A4AD2 /* Hyperbolic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394501F762B58002A4AD2 /* Hyperbolic.swift */; }; 6153945C1F762B59002A4AD2 /* Matrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394511F762B58002A4AD2 /* Matrix.swift */; }; 6153945D1F762B59002A4AD2 /* Pointers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394521F762B58002A4AD2 /* Pointers.swift */; }; 6153945E1F762B59002A4AD2 /* Power.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615394531F762B58002A4AD2 /* Power.swift */; }; @@ -88,18 +84,18 @@ 61E930B9207002EA00694FCB /* UnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930B7207002EA00694FCB /* UnsafeMemory.swift */; }; 61E930BA207002EA00694FCB /* UnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930B7207002EA00694FCB /* UnsafeMemory.swift */; }; 61E930BB207002EA00694FCB /* UnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930B7207002EA00694FCB /* UnsafeMemory.swift */; }; - 61E930BD2070104600694FCB /* ArrayUnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930BC2070104600694FCB /* ArrayUnsafeMemory.swift */; }; - 61E930BE2070104600694FCB /* ArrayUnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930BC2070104600694FCB /* ArrayUnsafeMemory.swift */; }; - 61E930BF2070104600694FCB /* ArrayUnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930BC2070104600694FCB /* ArrayUnsafeMemory.swift */; }; - 61E930C02070104600694FCB /* ArrayUnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930BC2070104600694FCB /* ArrayUnsafeMemory.swift */; }; + 61E930BD2070104600694FCB /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930BC2070104600694FCB /* Array+Extensions.swift */; }; + 61E930BE2070104600694FCB /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930BC2070104600694FCB /* Array+Extensions.swift */; }; + 61E930BF2070104600694FCB /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930BC2070104600694FCB /* Array+Extensions.swift */; }; + 61E930C02070104600694FCB /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930BC2070104600694FCB /* Array+Extensions.swift */; }; 61E930C22070B69300694FCB /* UnsafeMutableMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C12070B69300694FCB /* UnsafeMutableMemory.swift */; }; 61E930C32070B69300694FCB /* UnsafeMutableMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C12070B69300694FCB /* UnsafeMutableMemory.swift */; }; 61E930C42070B69300694FCB /* UnsafeMutableMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C12070B69300694FCB /* UnsafeMutableMemory.swift */; }; 61E930C52070B69300694FCB /* UnsafeMutableMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C12070B69300694FCB /* UnsafeMutableMemory.swift */; }; - 61E930C82070BCCD00694FCB /* ArraySliceUnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C72070BCCD00694FCB /* ArraySliceUnsafeMemory.swift */; }; - 61E930C92070BCCD00694FCB /* ArraySliceUnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C72070BCCD00694FCB /* ArraySliceUnsafeMemory.swift */; }; - 61E930CA2070BCCD00694FCB /* ArraySliceUnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C72070BCCD00694FCB /* ArraySliceUnsafeMemory.swift */; }; - 61E930CB2070BCCD00694FCB /* ArraySliceUnsafeMemory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C72070BCCD00694FCB /* ArraySliceUnsafeMemory.swift */; }; + 61E930C82070BCCD00694FCB /* ArraySlice+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C72070BCCD00694FCB /* ArraySlice+Extensions.swift */; }; + 61E930C92070BCCD00694FCB /* ArraySlice+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C72070BCCD00694FCB /* ArraySlice+Extensions.swift */; }; + 61E930CA2070BCCD00694FCB /* ArraySlice+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C72070BCCD00694FCB /* ArraySlice+Extensions.swift */; }; + 61E930CB2070BCCD00694FCB /* ArraySlice+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E930C72070BCCD00694FCB /* ArraySlice+Extensions.swift */; }; CAEC79BF2319274F00516E10 /* OperatorPrecedences.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79B72319244D00516E10 /* OperatorPrecedences.swift */; }; CAEC79C02319275000516E10 /* OperatorPrecedences.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79B72319244D00516E10 /* OperatorPrecedences.swift */; }; CAEC79C12319275000516E10 /* OperatorPrecedences.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79B72319244D00516E10 /* OperatorPrecedences.swift */; }; @@ -108,6 +104,10 @@ CAEC79C5231930EC00516E10 /* Scalar.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79C323192FE300516E10 /* Scalar.swift */; }; CAEC79C6231930ED00516E10 /* Scalar.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79C323192FE300516E10 /* Scalar.swift */; }; CAEC79C7231930ED00516E10 /* Scalar.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79C323192FE300516E10 /* Scalar.swift */; }; + CAEC79D22319343100516E10 /* Logarithm.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79D12319343100516E10 /* Logarithm.swift */; }; + CAEC79D32319343100516E10 /* Logarithm.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79D12319343100516E10 /* Logarithm.swift */; }; + CAEC79D42319343100516E10 /* Logarithm.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79D12319343100516E10 /* Logarithm.swift */; }; + CAEC79D52319343100516E10 /* Logarithm.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEC79D12319343100516E10 /* Logarithm.swift */; }; CAFE5DA522F9EC1D00A34887 /* XCTAssert+Surge.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAFE5DA422F9EC1D00A34887 /* XCTAssert+Surge.swift */; }; CAFE5DA622F9EC1D00A34887 /* XCTAssert+Surge.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAFE5DA422F9EC1D00A34887 /* XCTAssert+Surge.swift */; }; CAFE5DA722F9EC1D00A34887 /* XCTAssert+Surge.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAFE5DA422F9EC1D00A34887 /* XCTAssert+Surge.swift */; }; @@ -161,7 +161,6 @@ 6153944D1F762B58002A4AD2 /* Convolution.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Convolution.swift; sourceTree = ""; }; 6153944E1F762B58002A4AD2 /* Exponential.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Exponential.swift; sourceTree = ""; }; 6153944F1F762B58002A4AD2 /* FFT.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FFT.swift; sourceTree = ""; }; - 615394501F762B58002A4AD2 /* Hyperbolic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hyperbolic.swift; sourceTree = ""; }; 615394511F762B58002A4AD2 /* Matrix.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Matrix.swift; sourceTree = ""; }; 615394521F762B58002A4AD2 /* Pointers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pointers.swift; sourceTree = ""; }; 615394531F762B58002A4AD2 /* Power.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Power.swift; sourceTree = ""; }; @@ -180,11 +179,12 @@ 61A0AD801F70D99B00B99FFB /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; 61A0AD811F70D99B00B99FFB /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 61E930B7207002EA00694FCB /* UnsafeMemory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnsafeMemory.swift; sourceTree = ""; }; - 61E930BC2070104600694FCB /* ArrayUnsafeMemory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArrayUnsafeMemory.swift; sourceTree = ""; }; + 61E930BC2070104600694FCB /* Array+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Array+Extensions.swift"; sourceTree = ""; }; 61E930C12070B69300694FCB /* UnsafeMutableMemory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnsafeMutableMemory.swift; sourceTree = ""; }; - 61E930C72070BCCD00694FCB /* ArraySliceUnsafeMemory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArraySliceUnsafeMemory.swift; sourceTree = ""; }; + 61E930C72070BCCD00694FCB /* ArraySlice+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ArraySlice+Extensions.swift"; sourceTree = ""; }; CAEC79B72319244D00516E10 /* OperatorPrecedences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OperatorPrecedences.swift; sourceTree = ""; }; CAEC79C323192FE300516E10 /* Scalar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Scalar.swift; sourceTree = ""; }; + CAEC79D12319343100516E10 /* Logarithm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logarithm.swift; sourceTree = ""; }; CAFE5DA422F9EC1D00A34887 /* XCTAssert+Surge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTAssert+Surge.swift"; sourceTree = ""; }; CAFE5DA822F9ED3A00A34887 /* Vector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Vector.swift; sourceTree = ""; }; CAFE5DAD22F9ED4900A34887 /* VectorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VectorTests.swift; sourceTree = ""; }; @@ -263,24 +263,15 @@ isa = PBXGroup; children = ( 615394541F762B58002A4AD2 /* Surge.h */, - 6153944B1F762B58002A4AD2 /* Arithmetic.swift */, - 61E930C72070BCCD00694FCB /* ArraySliceUnsafeMemory.swift */, - 61E930BC2070104600694FCB /* ArrayUnsafeMemory.swift */, - 6153944C1F762B58002A4AD2 /* Auxiliary.swift */, - 6153944D1F762B58002A4AD2 /* Convolution.swift */, - 6153944E1F762B58002A4AD2 /* Exponential.swift */, - 6153944F1F762B58002A4AD2 /* FFT.swift */, - 615394501F762B58002A4AD2 /* Hyperbolic.swift */, - 615394511F762B58002A4AD2 /* Matrix.swift */, - 615394521F762B58002A4AD2 /* Pointers.swift */, - 615394531F762B58002A4AD2 /* Power.swift */, - 6152A42020719E9200043627 /* Statistics.swift */, - 615394551F762B58002A4AD2 /* Trigonometric.swift */, - 61E930B7207002EA00694FCB /* UnsafeMemory.swift */, - 61E930C12070B69300694FCB /* UnsafeMutableMemory.swift */, - CAFE5DA822F9ED3A00A34887 /* Vector.swift */, - CAEC79B72319244D00516E10 /* OperatorPrecedences.swift */, - CAEC79C323192FE300516E10 /* Scalar.swift */, + CAEC79CB2319336500516E10 /* Auxiliary Functions */, + CAEC79C92319333E00516E10 /* Digital Signal Processing */, + CAEC79CF2319340300516E10 /* Exponential */, + CAEC79CA2319335100516E10 /* General Arithmetic */, + CAEC79CD2319338F00516E10 /* Linear Algebra */, + CAEC79D02319343100516E10 /* Logarithm */, + CAEC79CC2319337700516E10 /* Statistics */, + CAEC79CE231933D700516E10 /* Trigonometry */, + CAEC79C8231932E900516E10 /* Utilities */, ); path = Surge; sourceTree = ""; @@ -303,6 +294,87 @@ path = SurgeTests; sourceTree = ""; }; + CAEC79C8231932E900516E10 /* Utilities */ = { + isa = PBXGroup; + children = ( + 61E930BC2070104600694FCB /* Array+Extensions.swift */, + 61E930C72070BCCD00694FCB /* ArraySlice+Extensions.swift */, + CAEC79B72319244D00516E10 /* OperatorPrecedences.swift */, + 615394521F762B58002A4AD2 /* Pointers.swift */, + 61E930B7207002EA00694FCB /* UnsafeMemory.swift */, + 61E930C12070B69300694FCB /* UnsafeMutableMemory.swift */, + ); + path = Utilities; + sourceTree = ""; + }; + CAEC79C92319333E00516E10 /* Digital Signal Processing */ = { + isa = PBXGroup; + children = ( + 6153944D1F762B58002A4AD2 /* Convolution.swift */, + 6153944F1F762B58002A4AD2 /* FFT.swift */, + ); + path = "Digital Signal Processing"; + sourceTree = ""; + }; + CAEC79CA2319335100516E10 /* General Arithmetic */ = { + isa = PBXGroup; + children = ( + 6153944B1F762B58002A4AD2 /* Arithmetic.swift */, + 615394531F762B58002A4AD2 /* Power.swift */, + ); + path = "General Arithmetic"; + sourceTree = ""; + }; + CAEC79CB2319336500516E10 /* Auxiliary Functions */ = { + isa = PBXGroup; + children = ( + 6153944C1F762B58002A4AD2 /* Auxiliary.swift */, + ); + path = "Auxiliary Functions"; + sourceTree = ""; + }; + CAEC79CC2319337700516E10 /* Statistics */ = { + isa = PBXGroup; + children = ( + 6152A42020719E9200043627 /* Statistics.swift */, + ); + path = Statistics; + sourceTree = ""; + }; + CAEC79CD2319338F00516E10 /* Linear Algebra */ = { + isa = PBXGroup; + children = ( + CAEC79C323192FE300516E10 /* Scalar.swift */, + CAFE5DA822F9ED3A00A34887 /* Vector.swift */, + 615394511F762B58002A4AD2 /* Matrix.swift */, + ); + path = "Linear Algebra"; + sourceTree = ""; + }; + CAEC79CE231933D700516E10 /* Trigonometry */ = { + isa = PBXGroup; + children = ( + 615394551F762B58002A4AD2 /* Trigonometric.swift */, + ); + path = Trigonometry; + sourceTree = ""; + }; + CAEC79CF2319340300516E10 /* Exponential */ = { + isa = PBXGroup; + children = ( + 6153944E1F762B58002A4AD2 /* Exponential.swift */, + ); + path = Exponential; + sourceTree = ""; + }; + CAEC79D02319343100516E10 /* Logarithm */ = { + isa = PBXGroup; + children = ( + CAEC79D12319343100516E10 /* Logarithm.swift */, + ); + path = Logarithm; + sourceTree = ""; + }; F84A6AAF19A9A72F007B53E1 /* Tests */ = { isa = PBXGroup; children = ( @@ -714,16 +786,16 @@ files = ( 614AD33E1FC0AF72002BFE1C /* Matrix.swift in Sources */, 61E930C32070B69300694FCB /* UnsafeMutableMemory.swift in Sources */, - 61E930C92070BCCD00694FCB /* ArraySliceUnsafeMemory.swift in Sources */, + 61E930C92070BCCD00694FCB /* ArraySlice+Extensions.swift in Sources */, + CAEC79D32319343100516E10 /* Logarithm.swift in Sources */, 614AD3391FC0AF72002BFE1C /* Auxiliary.swift in Sources */, 614AD3411FC0AF72002BFE1C /* Trigonometric.swift in Sources */, 614AD3381FC0AF72002BFE1C /* Arithmetic.swift in Sources */, - 614AD33D1FC0AF72002BFE1C /* Hyperbolic.swift in Sources */, 614AD33A1FC0AF72002BFE1C /* Convolution.swift in Sources */, 614AD33F1FC0AF72002BFE1C /* Pointers.swift in Sources */, 614AD33C1FC0AF72002BFE1C /* FFT.swift in Sources */, CAFE5DAA22F9ED3A00A34887 /* Vector.swift in Sources */, - 61E930BE2070104600694FCB /* ArrayUnsafeMemory.swift in Sources */, + 61E930BE2070104600694FCB /* Array+Extensions.swift in Sources */, 61E930B9207002EA00694FCB /* UnsafeMemory.swift in Sources */, CAEC79C5231930EC00516E10 /* Scalar.swift in Sources */, 614AD3401FC0AF72002BFE1C /* Power.swift in Sources */, @@ -757,16 +829,16 @@ files = ( 614AD36F1FC0B0CC002BFE1C /* Matrix.swift in Sources */, 61E930C42070B69300694FCB /* UnsafeMutableMemory.swift in Sources */, - 61E930CA2070BCCD00694FCB /* ArraySliceUnsafeMemory.swift in Sources */, + 61E930CA2070BCCD00694FCB /* ArraySlice+Extensions.swift in Sources */, + CAEC79D42319343100516E10 /* Logarithm.swift in Sources */, 614AD36A1FC0B0CC002BFE1C /* Auxiliary.swift in Sources */, 614AD3721FC0B0CC002BFE1C /* Trigonometric.swift in Sources */, 614AD3691FC0B0CC002BFE1C /* Arithmetic.swift in Sources */, - 614AD36E1FC0B0CC002BFE1C /* Hyperbolic.swift in Sources */, 614AD36B1FC0B0CC002BFE1C /* Convolution.swift in Sources */, 614AD3701FC0B0CC002BFE1C /* Pointers.swift in Sources */, 614AD36D1FC0B0CC002BFE1C /* FFT.swift in Sources */, CAFE5DAB22F9ED3A00A34887 /* Vector.swift in Sources */, - 61E930BF2070104600694FCB /* ArrayUnsafeMemory.swift in Sources */, + 61E930BF2070104600694FCB /* Array+Extensions.swift in Sources */, 61E930BA207002EA00694FCB /* UnsafeMemory.swift in Sources */, CAEC79C6231930ED00516E10 /* Scalar.swift in Sources */, 614AD3711FC0B0CC002BFE1C /* Power.swift in Sources */, @@ -800,16 +872,16 @@ files = ( 614AD3911FC0B134002BFE1C /* Matrix.swift in Sources */, 61E930C52070B69300694FCB /* UnsafeMutableMemory.swift in Sources */, - 61E930CB2070BCCD00694FCB /* ArraySliceUnsafeMemory.swift in Sources */, + 61E930CB2070BCCD00694FCB /* ArraySlice+Extensions.swift in Sources */, + CAEC79D52319343100516E10 /* Logarithm.swift in Sources */, 614AD38C1FC0B134002BFE1C /* Auxiliary.swift in Sources */, 614AD3941FC0B134002BFE1C /* Trigonometric.swift in Sources */, 614AD38B1FC0B134002BFE1C /* Arithmetic.swift in Sources */, - 614AD3901FC0B134002BFE1C /* Hyperbolic.swift in Sources */, 614AD38D1FC0B134002BFE1C /* Convolution.swift in Sources */, 614AD3921FC0B134002BFE1C /* Pointers.swift in Sources */, 614AD38F1FC0B134002BFE1C /* FFT.swift in Sources */, CAFE5DAC22F9ED3A00A34887 /* Vector.swift in Sources */, - 61E930C02070104600694FCB /* ArrayUnsafeMemory.swift in Sources */, + 61E930C02070104600694FCB /* Array+Extensions.swift in Sources */, 61E930BB207002EA00694FCB /* UnsafeMemory.swift in Sources */, CAEC79C7231930ED00516E10 /* Scalar.swift in Sources */, 614AD3931FC0B134002BFE1C /* Power.swift in Sources */, @@ -843,16 +915,16 @@ files = ( 6153945C1F762B59002A4AD2 /* Matrix.swift in Sources */, 61E930C22070B69300694FCB /* UnsafeMutableMemory.swift in Sources */, - 61E930C82070BCCD00694FCB /* ArraySliceUnsafeMemory.swift in Sources */, + 61E930C82070BCCD00694FCB /* ArraySlice+Extensions.swift in Sources */, + CAEC79D22319343100516E10 /* Logarithm.swift in Sources */, 615394571F762B59002A4AD2 /* Auxiliary.swift in Sources */, 615394601F762B59002A4AD2 /* Trigonometric.swift in Sources */, 615394561F762B59002A4AD2 /* Arithmetic.swift in Sources */, - 6153945B1F762B59002A4AD2 /* Hyperbolic.swift in Sources */, 615394581F762B59002A4AD2 /* Convolution.swift in Sources */, 6153945D1F762B59002A4AD2 /* Pointers.swift in Sources */, 6153945A1F762B59002A4AD2 /* FFT.swift in Sources */, CAFE5DA922F9ED3A00A34887 /* Vector.swift in Sources */, - 61E930BD2070104600694FCB /* ArrayUnsafeMemory.swift in Sources */, + 61E930BD2070104600694FCB /* Array+Extensions.swift in Sources */, 61E930B8207002EA00694FCB /* UnsafeMemory.swift in Sources */, CAEC79C423192FE300516E10 /* Scalar.swift in Sources */, 6153945E1F762B59002A4AD2 /* Power.swift in Sources */,