{"id":13461814,"url":"https://github.com/Jounce/Surge","last_synced_at":"2025-03-24T22:35:07.775Z","repository":{"id":19511172,"uuid":"22757905","full_name":"Jounce/Surge","owner":"Jounce","description":"A Swift library that uses the Accelerate framework to provide high-performance functions for matrix math, digital signal processing, and image manipulation.","archived":false,"fork":false,"pushed_at":"2023-07-20T14:04:23.000Z","size":554,"stargazers_count":5264,"open_issues_count":14,"forks_count":484,"subscribers_count":159,"default_branch":"master","last_synced_at":"2024-10-29T15:09:27.070Z","etag":null,"topics":["accelerate","arithmetic","convolution","dsp","fft","math","matrix","swift","trigonometry"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jounce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-08-08T13:03:42.000Z","updated_at":"2024-10-24T07:47:47.000Z","dependencies_parsed_at":"2022-07-11T02:00:38.761Z","dependency_job_id":"2b7681f5-cffd-4a10-977b-63be0496fe84","html_url":"https://github.com/Jounce/Surge","commit_stats":{"total_commits":327,"total_committers":30,"mean_commits":10.9,"dds":"0.43425076452599387","last_synced_commit":"6e4a47e63da8801afe6188cf039e9f04eb577721"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jounce%2FSurge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jounce%2FSurge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jounce%2FSurge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jounce%2FSurge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jounce","download_url":"https://codeload.github.com/Jounce/Surge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245366204,"owners_count":20603438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accelerate","arithmetic","convolution","dsp","fft","math","matrix","swift","trigonometry"],"created_at":"2024-07-31T11:00:58.354Z","updated_at":"2025-03-24T22:35:02.740Z","avatar_url":"https://github.com/Jounce.png","language":"Swift","readme":"# Surge\n\n[![Build Status][build status badge]][build status]\n[![License][license badge]][license]\n![CocoaPods platforms][cocoapods platforms badge]\n[![CocoaPods compatible][cocoapods badge]][cocoapods]\n[![Carthage compatible][carthage badge]][carthage]\n[![Swift Package Manager compatible][swift package manager badge]][swift package manager]\n\nSurge is a Swift library that uses the Accelerate framework to provide high-performance functions for matrix math, digital signal processing, and image manipulation.\n\nAccelerate exposes [SIMD](http://en.wikipedia.org/wiki/SIMD) instructions available in modern CPUs to significantly improve performance of certain calculations. Because of its relative obscurity and inconvenient APIs, Accelerate is not commonly used by developers, which is a shame, since many applications could benefit from these performance optimizations.\n\n**Surge aims to bring Accelerate to the mainstream, making it as easy (and nearly as fast, in most cases) to perform computation over a set of numbers as for a single member.**\n\nThough, keep in mind: _Accelerate is not a silver bullet_. Under certain conditions, such as performing simple calculations over a small data set, Accelerate can be out-performed by conventional algorithms. Always benchmark to determine the performance characteristics of each potential approach.\n\n---\n\n\u003e Curious about the name _Surge_? (And _Jounce_?)\n\u003e Back in the mid 90's, Apple, IBM, and Motorola teamed up to create\n\u003e [AltiVec](http://en.wikipedia.org/wiki/AltiVec) (a.k.a the Velocity Engine),\n\u003e which provided a SIMD instruction set for the PowerPC architecture.\n\u003e When Apple made the switch to Intel CPUs,\n\u003e AltiVec was ported to the x86 architecture and rechristened\n\u003e [Accelerate](https://developer.apple.com/documentation/Accelerate).\n\u003e The derivative of Accelerate (and second derivative of Velocity)\n\u003e is known as either [jerk, jolt, _surge_, or lurch](http://en.wikipedia.org/wiki/Jerk_%28physics%29);\n\u003e if you take the derivative of surge,\n\u003e you get the [_jounce_](https://en.wikipedia.org/wiki/Jounce) ---\n\u003e hence the name of this library and its parent organization.\n\n---\n\n## Installation\n\n_The infrastructure and best practices for distributing Swift libraries are currently in flux during this beta period of Swift \u0026 Xcode. In the meantime, you can add Surge as a git submodule, drag the `Surge.xcodeproj` file into your Xcode project, and add `Surge.framework` as a dependency for your target._\n\nSurge uses Swift 5. This means that your code has to be written in Swift 5 due to current binary compatibility limitations.\n\n## License\n\nSurge is available under the MIT license. See the LICENSE file for more info.\n\n### Swift Package Manager\n\nTo use [Swift Package Manager](https://swift.org/package-manager/) add Surge to your `Package.swift` file:\n\n```swift\nlet package = Package(\n    name: \"myproject\",\n    dependencies: [\n        .package(url: \"https://github.com/Jounce/Surge.git\", .upToNextMajor(from: \"2.3.2\")),\n    ],\n    targets: [\n        .target(\n            name: \"myproject\",\n            dependencies: [\"Surge\"]),\n    ]\n)\n```\n\nThen run `swift build`.\n\n### CocoaPods\n\nTo use [CocoaPods](https://cocoapods.org) add Surge to your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '10.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'Surge', '~\u003e 2.3.2'\nend\n```\n\nThen run `pod install`.\n\n### Carthage\n\nTo use [Carthage](https://github.com/Carthage/Carthage) add Surge to your `Cartfile`:\n\n```ruby\ngithub \"Jounce/Surge\" ~\u003e 2.3.2\n```\n\nThen run `carthage update` and use the framework in `Carthage/Build/\u003cplatform\u003e`.\n\n---\n\n## Usage\n\n### Computing Sum of `[Double]`\n\n```swift\nimport Surge\n\nlet n = [1.0, 2.0, 3.0, 4.0, 5.0]\nlet sum = Surge.sum(n) // 15.0\n```\n\n### Computing Product of Two `[Double]`s\n\n```swift\nimport Surge\n\nlet a = [1.0, 3.0, 5.0, 7.0]\nlet b = [2.0, 4.0, 6.0, 8.0]\n\nlet product = Surge.elmul(a, b) // [2.0, 12.0, 30.0, 56.0]\n```\n\n# Inventory\n\n- [Installation](#installation)\n- [License](#license)\n  - [Swift Package Manager](#swift-package-manager)\n  - [CocoaPods](#cocoapods)\n  - [Carthage](#carthage)\n- [Usage](#usage)\n  - [Computing Sum of `[Double]`](#computing-sum-of-double)\n  - [Computing Product of Two `[Double]`s](#computing-product-of-two-doubles)\n- [General Arithmetic Operations](#general-arithmetic-operations)\n  - [Addition](#addition)\n  - [Subtraction](#subtraction)\n  - [Multiplication](#multiplication)\n  - [Element-wise multiplication](#element-wise-multiplication)\n  - [Division)](#division)\n  - [Element-wise Division)](#element-wise-division)\n  - [Modulo](#modulo)\n  - [Remainder](#remainder)\n  - [Square Root](#square-root)\n  - [Summation](#summation)\n  - [Dot Product](#dot-product)\n  - [Distance](#distance)\n  - [Squared Distance](#squared-distance)\n  - [Power](#power)\n  - [Exponential](#exponential)\n- [Trigonometric Operations](#trigonometric-operations)\n  - [Sine/Cosine/Tangent](#sinecosinetangent)\n  - [Arc Sine/Cosine/Tangent](#arc-sinecosinetangent)\n  - [Hyperbolic Sine/Cosine/Tangent](#hyperbolic-sinecosinetangent)\n  - [Inverse Hyperbolic Sine/Cosine/Tangent](#inverse-hyperbolic-sinecosinetangent)\n  - [Radians ↔︎ Degrees](#radians-︎-degrees)\n- [Exponential Function](#exponential-function)\n- [Logarithm](#logarithm)\n- [Statistical Operations](#statistical-operations)\n  - [Summation](#summation-1)\n  - [Minimum/Maximum](#minimummaximum)\n  - [Mean/Variance](#meanvariance)\n- [Auxiliary Functions](#auxiliary-functions)\n  - [Rounding Functions](#rounding-functions)\n  - [Absolute value](#absolute-value)\n  - [Signum function](#signum-function)\n  - [Multiplicative inverse](#multiplicative-inverse)\n- [Matrix-specific Operations](#matrix-specific-operations)\n  - [Matrix Inversion](#matrix-inversion)\n  - [Matrix Transposition](#matrix-transposition)\n  - [Matrix Determinant](#matrix-determinant)\n  - [Eigen Decomposition](#eigen-decomposition)\n- [DSP-specific Operations](#dsp-specific-operations)\n  - [Fast Fourier Transform](#fast-fourier-transform)\n  - [Convolution](#convolution)\n  - [Cross-Correlation](#cross-correlation)\n\n## General Arithmetic Operations\n\n### [Addition](https://en.wikipedia.org/wiki/Addition)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nAddition functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Array, Array)`   | `add`    | `.+` (infix) | `.+=` (infix)     |\n| `(Array, Scalar)`  | `add`    | `+` (infix)  | `+=` (infix)      |\n| `(Matrix, Matrix)` | `add`    | `+` (infix)  | `+=` (infix)      |\n| `(Matrix, Scalar)` | n/a      | n/a          | n/a               |\n| `(Vector, Vector)` | `add`    | `+` (infix)  | `+=` (infix)      |\n| `(Vector, Scalar)` | `add`    | `+` (infix)  | `+=` (infix)      |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| `addInPlace`      |\n| `addInPlace`      |\n| n/a               |\n| n/a               |\n| `addInPlace`      |\n| `addInPlace`      |\n--\u003e\n\n\u003c!-- FIXME: `add` for `(Array, Array)` should be called `eladd`/`.+`, no? --\u003e\n\u003c!-- FIXME: Missing `add` function for `(Matrix, Scalar)`. --\u003e\n\u003c!-- FIXME: Missing `add` functions/operators for `(Matrix, Vector)`. --\u003e\n\u003c!-- FIXME: Missing `addInPlace` function for `(Matrix, Scalar)` \u0026 `(Matrix, Matrix)`. --\u003e\n\n\u003c/details\u003e\n\n### [Subtraction](https://en.wikipedia.org/wiki/Subtraction)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nSubtraction functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Array, Array)`   | `sub`    | `.-` (infix) | `.-=` (infix)     |\n| `(Array, Scalar)`  | `sub`    | `-` (infix)  | `-=` (infix)      |\n| `(Matrix, Matrix)` | `sub`    | `-` (infix)  | `-=` (infix)      |\n| `(Matrix, Scalar)` | n/a      | n/a          | n/a               |\n| `(Vector, Vector)` | `sub`    | `-` (infix)  | `-=` (infix)      |\n| `(Vector, Scalar)` | `sub`    | `-` (infix)  | `-=` (infix)      |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| `subInPlace`      |\n| `subInPlace`      |\n| n/a               |\n| n/a               |\n| `subInPlace`      |\n| `subInPlace`      |\n--\u003e\n\n\u003c!-- FIXME: `sub` for `(Array, Array)` should be called `elsub`/`.-`, no? --\u003e\n\u003c!-- FIXME: Missing `sub` function/operator for `(Matrix, Scalar)`. --\u003e\n\u003c!-- FIXME: Missing `sub` functions/operators for `(Matrix, Vector)`. --\u003e\n\u003c!-- FIXME: Missing `subInPlace` function for `(Matrix, Scalar)` \u0026 `(Matrix, Matrix)`. --\u003e\n\n\u003c/details\u003e\n\n### [Multiplication](https://en.wikipedia.org/wiki/Multiplication)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nMultiplication functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Array, Array)`   | `mul`    | `.*` (infix) | `.*=` (infix)     |\n| `(Array, Scalar)`  | `mul`    | `*` (infix)  | `*=` (infix)      |\n| `(Matrix, Matrix)` | `mul`    | `*` (infix)  | n/a               |\n| `(Matrix, Vector)` | `mul`    | `*` (infix)  | n/a               |\n| `(Matrix, Scalar)` | `mul`    | `*` (infix)  | n/a               |\n| `(Vector, Matrix)` | `mul`    | `*` (infix)  | n/a               |\n| `(Vector, Scalar)` | `mul`    | `*` (infix)  | `*=` (infix)      |\n| `(Scalar, Array)`  | `mul`    | `*` (infix)  | n/a               |\n| `(Scalar, Matrix)` | `mul`    | `*` (infix)  | n/a               |\n| `(Scalar, Vector)` | `mul`    | `*` (infix)  | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| `mulInPlace`      |\n| `mulInPlace`      |\n| n/a               |\n| n/a               |\n| n/a               |\n| n/a               |\n| `mulInPlace`      |\n| n/a               |\n| n/a               |\n| n/a               |\n--\u003e\n\n\u003c/details\u003e\n\n### [Element-wise multiplication](https://en.wikipedia.org/wiki/Multiplication)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nElement-wise multiplication functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Matrix, Matrix)` | `elmul`  | n/a          | n/a               |\n| `(Vector, Vector)` | `elmul`  | `.*` (infix) | `.*=` (infix)     |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| `elmulInPlace`    |\n--\u003e\n\n\u003c!-- FIXME: The does not seem to be a `.*` implemented for `(Matrix, Matrix)`. --\u003e\n\n\u003c/details\u003e\n\n### [Division](https://en.wikipedia.org/wiki/Division_(mathematics))\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nDivision functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Array, Array)`   | `div`    | `./` (infix) | `./=` (infix)     |\n| `(Array, Scalar)`  | `div`    | `/` (infix)  | `/=` (infix)      |\n| `(Matrix, Matrix)` | `div`    | `/` (infix)  | n/a               |\n| `(Matrix, Scalar)` | n/a      | `/` (infix)  | n/a               |\n| `(Vector, Scalar)` | `div`    | `/` (infix)  | `/=` (infix)      |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| `divInPlace`      |\n| `divInPlace`      |\n| n/a               |\n| n/a               |\n| `divInPlace`      |\n--\u003e\n\n\u003c!-- FIXME: Func `div` of `(Array, Array)` should be called `eldiv`, no? --\u003e\n\u003c!-- FIXME: Missing `div` function for `(Matrix, Scalar)`. --\u003e\n\n\u003c/details\u003e\n\n### [Element-wise Division](https://en.wikipedia.org/wiki/Division_(mathematics))\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nElement-wise multiplication functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Vector, Vector)` | `eldiv`  | `./` (infix) | `./=` (infix)     |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| `eldivInPlace`    |\n --\u003e\n\n\u003c/details\u003e\n\n### [Modulo](https://en.wikipedia.org/wiki/Modulo_operation)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nModulo functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments         | Function | Operator     | In-Place Operator |\n|-------------------|----------|--------------|-------------------|\n| `(Array, Array)`  | `mod`    | `.%` (infix) | n/a               |\n| `(Array, Scalar)` | `mod`    | `%` (infix)  | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| n/a               |\n--\u003e\n\n\u003c!-- FIXME: Do we need `mod` functions/operators for `Matrix`? --\u003e\n\u003c!-- FIXME: Do we need `mod` functions/operators for `Vector`? --\u003e\n\n\u003c/details\u003e\n\n### [Remainder](https://en.wikipedia.org/wiki/Remainder)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nRemainder functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments         | Function    | Operator | In-Place Operator |\n|-------------------|-------------|----------|-------------------|\n| `(Array, Array)`  | `remainder` | n/a      | n/a               |\n| `(Array, Scalar)` | `remainder` | n/a      | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| n/a               |\n --\u003e\n\n\u003c!-- FIXME: Do we need `remainder` functions /operators for `Matrix`? --\u003e\n\u003c!-- FIXME: Do we need `remainder` functions /operators for `Vector`? --\u003e\n\n\u003c/details\u003e\n\n### [Square Root](https://en.wikipedia.org/wiki/Square_root)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nSquare root functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments | Function | Operator | In-Place Operator |\n|-----------|----------|----------|-------------------|\n| `(Array)` | `sqrt`   | n/a      | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n --\u003e\n\n\u003c!-- FIXME: The seems to be a variant `func sqrt\u003cMI, MO\u003e(_ x: MI, into results: inout MO)` that could be made into a `sqrtInPlace`--\u003e\n\n\u003c!-- FIXME: Do we need `sqrt` functions/operators for `Matrix`? --\u003e\n\u003c!-- FIXME: Do we need `sqrt` functions/operators for `Vector`? --\u003e\n\n\u003c/details\u003e\n\n### [Summation](https://en.wikipedia.org/wiki/Summation)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nSum functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments  | Function | Operator | In-Place Operator |\n|------------|----------|----------|-------------------|\n| `(Array)`  | `sum`    | n/a      | n/a               |\n| `(Matrix)` | `sum`    | n/a      | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| n/a               |\n --\u003e\n\n\u003c!-- FIXME: Do we need `sum` functions/operators for `Vector`? --\u003e\n\n\u003c/details\u003e\n\n### [Dot Product](https://en.wikipedia.org/wiki/Dot_product)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nDot product functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator    | In-Place Operator |\n|--------------------|----------|-------------|-------------------|\n| `(Array, Array)`   | `dot`    | `•` (infix) | n/a               |\n| `(Vector, Vector)` | `dot`    | `•` (infix) | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| n/a               |\n --\u003e\n\n\u003c!-- FIXME: Do we need `dot` functions/operators for `Matrix`? --\u003e\n\n\u003c/details\u003e\n\n### [Distance](https://en.wikipedia.org/wiki/Euclidean_distance)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nDistance functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator | In-Place Operator |\n|--------------------|----------|----------|-------------------|\n| `(Array, Array)`   | `dist`   | n/a      | n/a               |\n| `(Vector, Vector)` | `dist`   | n/a      | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| n/a               |\n --\u003e\n\n### [Squared Distance](https://en.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nSquared distance functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator | In-Place Operator |\n|--------------------|----------|----------|-------------------|\n| `(Array, Array)`   | `distSq` | n/a      | n/a               |\n| `(Vector, Vector)` | `distSq` | n/a      | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| n/a               |\n --\u003e\n\n\u003c/details\u003e\n\n### [Power](https://en.wikipedia.org/wiki/Power_(mathematics))\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nPower functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Array, Array)`   | `pow`    | `.**` (infix) | `.**=` (infix)    |\n| `(Array, Scalar)`  | `pow`    | `**` (infix) | `**=` (infix)     |\n| `(Matrix, Scalar)` | `pow`    | n/a          | n/a               |\n| `(Vector, Vector)` | `pow`    | n/a          | n/a               |\n\n([Serial exponentiation](https://en.wikipedia.org/wiki/Order_of_operations#Serial_exponentiation): `a ** b ** c == a ** (b ** c)`)\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| n/a               |\n| n/a               |\n| n/a               |\n --\u003e\n\n\u003c!-- FIXME: Shouldn't the `pow`/`**` function/operator of `(Array, Array)` be `elpow`/`.**`? --\u003e\n\u003c!-- FIXME: Shouldn't the `pow`/`**` function/operator of `(Vector, Vector)` be `elpow`/`.**`? --\u003e\n\u003c!-- FIXME: The does not seem to be a corresponding `.**` operator implemented. --\u003e\n\u003c!-- FIXME: Do we need `pow` functions/operators for `(Vector, Scalar)`? --\u003e\n\n### [Exponential](https://en.wikipedia.org/wiki/Exponential_function)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nExponential functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments  | Function | Operator | In-Place Operator |\n|------------|----------|----------|-------------------|\n| `(Array)`  | `exp`    | n/a      | n/a               |\n| `(Matrix)` | `exp`    | n/a      | n/a               |\n| `(Vector)` | `exp`    | n/a      | n/a               |\n\n\u003c!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n/a               |\n| n/a               |\n| n/a               |\n --\u003e\n\n\u003c/details\u003e\n\n## Trigonometric Operations\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nTrigonometric functions \u0026 operators\n\u003c/summary\u003e\n\n### [Sine/Cosine/Tangent](https://en.wikipedia.org/wiki/Trigonometric_functions)\n\n| Arguments | Function | Operation     |\n|-----------|----------|---------------|\n| `(Array)` | `sin`    | Sine          |\n| `(Array)` | `cos`    | Cosine        |\n| `(Array)` | `tan`    | Tangent       |\n| `(Array)` | `sincos` | Sine \u0026 Cosine |\n\n### [Arc Sine/Cosine/Tangent](https://en.wikipedia.org/wiki/Trigonometric_functions)\n\n| Arguments | Function | Operation   |\n|-----------|----------|-------------|\n| `(Array)` | `asin`   | Arc Sine    |\n| `(Array)` | `acos`   | Arc Cosine  |\n| `(Array)` | `atan`   | Arc Tangent |\n\n### [Hyperbolic Sine/Cosine/Tangent](https://en.wikipedia.org/wiki/Hyperbolic_function)\n\n| Arguments | Function | Operation          |\n|-----------|----------|--------------------|\n| `(Array)` | `sinh`   | Hyperbolic Sine    |\n| `(Array)` | `cosh`   | Hyperbolic Cosine  |\n| `(Array)` | `tanh`   | Hyperbolic Tangent |\n\n### [Inverse Hyperbolic Sine/Cosine/Tangent](https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions)\n\n| Arguments | Function | Operation                  |\n|-----------|----------|----------------------------|\n| `(Array)` | `asinh`  | Inverse Hyperbolic Sine    |\n| `(Array)` | `acosh`  | Inverse Hyperbolic Cosine  |\n| `(Array)` | `atanh`  | Inverse Hyperbolic Tangent |\n\n### [Radians ↔︎ Degrees](https://en.wikipedia.org/wiki/Angle#Types_of_angles)\n\n| Arguments | Function  | Operation                                                                                                  |\n|-----------|-----------|------------------------------------------------------------------------------------------------------------|\n| `(Array)` | `rad2deg` | [Radians](https://en.wikipedia.org/wiki/Radian) to [Degrees](https://en.wikipedia.org/wiki/Degree_(angle)) |\n| `(Array)` | `deg2rad` | [Degrees](https://en.wikipedia.org/wiki/Degree_(angle)) to [Radians](https://en.wikipedia.org/wiki/Radian) |\n\n\u003c/details\u003e\n\n## [Exponential Function](https://en.wikipedia.org/wiki/Exponential_function)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nExponential functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments | Function | Operation                   |\n|-----------|----------|-----------------------------|\n| `(Array)` | `exp`    | Base-e Exponential Function |\n| `(Array)` | `exp2`   | Base-2 Exponential Function |\n\n\u003c/details\u003e\n\n## [Logarithm](https://en.wikipedia.org/wiki/Logarithm)\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nExponential functions \u0026 operators\n\u003c/summary\u003e\n\n| Arguments | Function | Operation         |\n|-----------|----------|-------------------|\n| `(Array)` | `log`    | Base-e Logarithm  |\n| `(Array)` | `log2`   | Base-2 Logarithm  |\n| `(Array)` | `log10`  | Base-10 Logarithm |\n| `(Array)` | `logb`   | Base-b Logarithm  |\n\n\u003c/details\u003e\n\n## Statistical Operations\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nStatistical functions \u0026 operators\n\u003c/summary\u003e\n\n### [Summation](https://en.wikipedia.org/wiki/Summation)\n\n| Arguments | Function | Operation          |\n|-----------|----------|--------------------|\n| `(Array)` | `sum`    | Summation          |\n| `(Array)` | `asum`   | Absolute Summation |\n\n### [Minimum/Maximum](https://en.wikipedia.org/wiki/Maximal_and_minimal_elements)\n\n| Arguments | Function | Operation |\n|-----------|----------|-----------|\n| `(Array)` | `min`    | Minimum   |\n| `(Array)` | `max`    | Maximum   |\n\n### [Mean/Variance](https://en.wikipedia.org/wiki/Mean)\n\n| Arguments | Function   | Operation                                                              |\n|-----------|------------|------------------------------------------------------------------------|\n| `(Array)` | `mean`     | [Mean](https://en.wikipedia.org/wiki/Mean)                             |\n| `(Array)` | `meamg`    | Mean of Magnitudes                                                     |\n| `(Array)` | `measq`    | [Mean of Squares](https://en.wikipedia.org/wiki/Mean_square)           |\n| `(Array)` | `variance` | [Variance](https://en.wikipedia.org/wiki/Variance)                     |\n| `(Array)` | `std`      | [Standard Deviation](https://en.wikipedia.org/wiki/Standard_deviation) |\n\n\u003c/details\u003e\n\n## Auxiliary Functions\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nAuxiliary functions \u0026 operators\n\u003c/summary\u003e\n\n### [Rounding Functions](https://en.wikipedia.org/wiki/Rounding)\n\n| Arguments | Function | Operation                                                             |\n|-----------|----------|-----------------------------------------------------------------------|\n| `(Array)` | `ceil`   | [Ceiling](https://en.wikipedia.org/wiki/Floor_and_ceiling_functions)  |\n| `(Array)` | `floor`  | [Flooring](https://en.wikipedia.org/wiki/Floor_and_ceiling_functions) |\n| `(Array)` | `round`  | [Rounding](https://en.wikipedia.org/wiki/Rounding)                    |\n| `(Array)` | `trunc`  | [Integer truncation](https://en.wikipedia.org/wiki/Truncation)        |\n\n### [Absolute value](https://en.wikipedia.org/wiki/Absolute_value)\n\n| Arguments | Function | In-Place Function | Operator | In-Place Operator |\n|-----------|----------|-------------------|----------|-------------------|\n| `(Array)` | `abs`    | n/a               | n/a      | n/a               |\n\n### [Signum function](https://en.wikipedia.org/wiki/Sign_function)\n\n| Arguments | Function   | In-Place Function | Operator | In-Place Operator |\n|-----------|------------|-------------------|----------|-------------------|\n| `(Array)` | `copysign` | n/a               | n/a      | n/a               |\n\n### [Multiplicative inverse](https://en.wikipedia.org/wiki/Multiplicative_inverse)\n\n| Arguments | Function | In-Place Function | Operator | In-Place Operator |\n|-----------|----------|-------------------|----------|-------------------|\n| `(Array)` | `rec`    | n/a               | n/a      | n/a               |\n\n\u003c/details\u003e\n\n## Matrix-specific Operations\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nMatrix-specific functions \u0026 operators\n\u003c/summary\u003e\n\n### [Matrix Inversion](https://en.wikipedia.org/wiki/Invertible_matrix)\n\n| Arguments  | Function | In-Place Function | Operator | In-Place Operator |\n|------------|----------|-------------------|----------|-------------------|\n| `(Matrix)` | `inv`    | n/a               | n/a      | n/a               |\n\n### [Matrix Transposition](https://en.wikipedia.org/wiki/Matrix_transpose)\n\n| Arguments  | Function    | In-Place Function | Operator      | In-Place Operator |\n|------------|-------------|-------------------|---------------|-------------------|\n| `(Matrix)` | `transpose` | n/a               | `′` (postfix) | n/a               |\n\n### [Matrix Determinant](https://en.wikipedia.org/wiki/Matrix_determinant)\n\n| Arguments  | Function | In-Place Function | Operator | In-Place Operator |\n|------------|----------|-------------------|----------|-------------------|\n| `(Matrix)` | `det`    | n/a               | n/a      | n/a               |\n\n### [Eigen Decomposition](https://en.wikipedia.org/wiki/Eigen_decomposition)\n\n| Arguments  | Function         | In-Place Function | Operator | In-Place Operator |\n|------------|------------------|-------------------|----------|-------------------|\n| `(Matrix)` | `eigenDecompose` | n/a               | n/a      | n/a               |\n\n\u003c/details\u003e\n\n## DSP-specific Operations\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\nFast fourier transform functions \u0026 operators\n\u003c/summary\u003e\n\n### [Fast Fourier Transform](https://en.wikipedia.org/wiki/Convolution)\n\n| Arguments | Function | In-Place Function | Operator | In-Place Operator |\n|-----------|----------|-------------------|----------|-------------------|\n| `(Array)` | `fft`    | n/a               | n/a      | n/a               |\n\n### [Convolution](https://en.wikipedia.org/wiki/Convolution)\n\n| Arguments        | Function | In-Place Function | Operator | In-Place Operator |\n|------------------|----------|-------------------|----------|-------------------|\n| `(Array, Array)` | `conv`   | n/a               | n/a      | n/a               |\n\n### [Cross-Correlation](https://en.wikipedia.org/wiki/Cross-correlation)\n\n| Arguments        | Function | In-Place Function | Operator | In-Place Operator |\n|------------------|----------|-------------------|----------|-------------------|\n| `(Array, Array)` | `xcorr`  | n/a               | n/a      | n/a               |\n| `(Array)`        | `xcorr`  | n/a               | n/a      | n/a               |\n\n\u003c/details\u003e\n\n[build status]: https://github.com/Jounce/Surge/actions?query=workflow%3ACI\n[build status badge]: https://github.com/Jounce/Surge/workflows/CI/badge.svg\n[license]: https://opensource.org/licenses/MIT\n[license badge]: https://img.shields.io/cocoapods/l/Surge.svg\n[cocoapods platforms badge]: https://img.shields.io/cocoapods/p/Surge.svg\n[cocoapods]: https://cocoapods.org/pods/Surge\n[cocoapods badge]: https://img.shields.io/cocoapods/v/Surge.svg\n[carthage]: https://github.com/Carthage/Carthage\n[carthage badge]: https://img.shields.io/badge/Carthage-compatible-4BC51D.svg\n[swift package manager badge]: https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat\n[swift package manager]: https://swift.org/package-manager\n","funding_links":[],"categories":["Swift","\u003ca name=\"for-projects\"\u003e\u003c/a\u003e For Projects","trigonometry"],"sub_categories":["\u003ca name=\"for-projects-example-projects\"\u003e\u003c/a\u003e Example Projects"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJounce%2FSurge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJounce%2FSurge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJounce%2FSurge/lists"}