[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6831":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},6831,"Surge","Jounce\u002FSurge","Jounce","A Swift library that uses the Accelerate framework to provide high-performance functions for matrix math, digital signal processing, and image manipulation.","",null,"Swift",5319,477,153,13,0,5,64.54,"MIT License",false,"master",[23,24,25,26,27,28,29,30,31],"accelerate","arithmetic","convolution","dsp","fft","math","matrix","swift","trigonometry","2026-06-12 04:00:30","# 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:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSIMD) 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> Curious about the name _Surge_? (And _Jounce_?)\n> Back in the mid 90's, Apple, IBM, and Motorola teamed up to create\n> [AltiVec](http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAltiVec) (a.k.a the Velocity Engine),\n> which provided a SIMD instruction set for the PowerPC architecture.\n> When Apple made the switch to Intel CPUs,\n> AltiVec was ported to the x86 architecture and rechristened\n> [Accelerate](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002FAccelerate).\n> The derivative of Accelerate (and second derivative of Velocity)\n> is known as either [jerk, jolt, _surge_, or lurch](http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FJerk_%28physics%29);\n> if you take the derivative of surge,\n> you get the [_jounce_](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FJounce) ---\n> 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 & 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:\u002F\u002Fswift.org\u002Fpackage-manager\u002F) add Surge to your `Package.swift` file:\n\n```swift\nlet package = Package(\n    name: \"myproject\",\n    dependencies: [\n        .package(url: \"https:\u002F\u002Fgithub.com\u002FJounce\u002FSurge.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:\u002F\u002Fcocoapods.org) add Surge to your `Podfile`:\n\n```ruby\nsource 'https:\u002F\u002Fgithub.com\u002FCocoaPods\u002FSpecs.git'\nplatform :ios, '10.0'\nuse_frameworks!\n\ntarget '\u003CYour Target Name>' do\n    pod 'Surge', '~> 2.3.2'\nend\n```\n\nThen run `pod install`.\n\n### Carthage\n\nTo use [Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) add Surge to your `Cartfile`:\n\n```ruby\ngithub \"Jounce\u002FSurge\" ~> 2.3.2\n```\n\nThen run `carthage update` and use the framework in `Carthage\u002FBuild\u002F\u003Cplatform>`.\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) \u002F\u002F 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) \u002F\u002F [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\u002FCosine\u002FTangent](#sinecosinetangent)\n  - [Arc Sine\u002FCosine\u002FTangent](#arc-sinecosinetangent)\n  - [Hyperbolic Sine\u002FCosine\u002FTangent](#hyperbolic-sinecosinetangent)\n  - [Inverse Hyperbolic Sine\u002FCosine\u002FTangent](#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\u002FMaximum](#minimummaximum)\n  - [Mean\u002FVariance](#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:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAddition)\n\n\u003Cdetails open>\n\n\u003Csummary>\nAddition functions & operators\n\u003C\u002Fsummary>\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\u002Fa      | n\u002Fa          | n\u002Fa               |\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\u002Fa               |\n| n\u002Fa               |\n| `addInPlace`      |\n| `addInPlace`      |\n-->\n\n\u003C!-- FIXME: `add` for `(Array, Array)` should be called `eladd`\u002F`.+`, no? -->\n\u003C!-- FIXME: Missing `add` function for `(Matrix, Scalar)`. -->\n\u003C!-- FIXME: Missing `add` functions\u002Foperators for `(Matrix, Vector)`. -->\n\u003C!-- FIXME: Missing `addInPlace` function for `(Matrix, Scalar)` & `(Matrix, Matrix)`. -->\n\n\u003C\u002Fdetails>\n\n### [Subtraction](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSubtraction)\n\n\u003Cdetails open>\n\n\u003Csummary>\nSubtraction functions & operators\n\u003C\u002Fsummary>\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\u002Fa      | n\u002Fa          | n\u002Fa               |\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\u002Fa               |\n| n\u002Fa               |\n| `subInPlace`      |\n| `subInPlace`      |\n-->\n\n\u003C!-- FIXME: `sub` for `(Array, Array)` should be called `elsub`\u002F`.-`, no? -->\n\u003C!-- FIXME: Missing `sub` function\u002Foperator for `(Matrix, Scalar)`. -->\n\u003C!-- FIXME: Missing `sub` functions\u002Foperators for `(Matrix, Vector)`. -->\n\u003C!-- FIXME: Missing `subInPlace` function for `(Matrix, Scalar)` & `(Matrix, Matrix)`. -->\n\n\u003C\u002Fdetails>\n\n### [Multiplication](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMultiplication)\n\n\u003Cdetails open>\n\n\u003Csummary>\nMultiplication functions & operators\n\u003C\u002Fsummary>\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\u002Fa               |\n| `(Matrix, Vector)` | `mul`    | `*` (infix)  | n\u002Fa               |\n| `(Matrix, Scalar)` | `mul`    | `*` (infix)  | n\u002Fa               |\n| `(Vector, Matrix)` | `mul`    | `*` (infix)  | n\u002Fa               |\n| `(Vector, Scalar)` | `mul`    | `*` (infix)  | `*=` (infix)      |\n| `(Scalar, Array)`  | `mul`    | `*` (infix)  | n\u002Fa               |\n| `(Scalar, Matrix)` | `mul`    | `*` (infix)  | n\u002Fa               |\n| `(Scalar, Vector)` | `mul`    | `*` (infix)  | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| `mulInPlace`      |\n| `mulInPlace`      |\n| n\u002Fa               |\n| n\u002Fa               |\n| n\u002Fa               |\n| n\u002Fa               |\n| `mulInPlace`      |\n| n\u002Fa               |\n| n\u002Fa               |\n| n\u002Fa               |\n-->\n\n\u003C\u002Fdetails>\n\n### [Element-wise multiplication](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMultiplication)\n\n\u003Cdetails open>\n\n\u003Csummary>\nElement-wise multiplication functions & operators\n\u003C\u002Fsummary>\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Matrix, Matrix)` | `elmul`  | n\u002Fa          | n\u002Fa               |\n| `(Vector, Vector)` | `elmul`  | `.*` (infix) | `.*=` (infix)     |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| `elmulInPlace`    |\n-->\n\n\u003C!-- FIXME: The does not seem to be a `.*` implemented for `(Matrix, Matrix)`. -->\n\n\u003C\u002Fdetails>\n\n### [Division](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDivision_(mathematics))\n\n\u003Cdetails open>\n\n\u003Csummary>\nDivision functions & operators\n\u003C\u002Fsummary>\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Array, Array)`   | `div`    | `.\u002F` (infix) | `.\u002F=` (infix)     |\n| `(Array, Scalar)`  | `div`    | `\u002F` (infix)  | `\u002F=` (infix)      |\n| `(Matrix, Matrix)` | `div`    | `\u002F` (infix)  | n\u002Fa               |\n| `(Matrix, Scalar)` | n\u002Fa      | `\u002F` (infix)  | n\u002Fa               |\n| `(Vector, Scalar)` | `div`    | `\u002F` (infix)  | `\u002F=` (infix)      |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| `divInPlace`      |\n| `divInPlace`      |\n| n\u002Fa               |\n| n\u002Fa               |\n| `divInPlace`      |\n-->\n\n\u003C!-- FIXME: Func `div` of `(Array, Array)` should be called `eldiv`, no? -->\n\u003C!-- FIXME: Missing `div` function for `(Matrix, Scalar)`. -->\n\n\u003C\u002Fdetails>\n\n### [Element-wise Division](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDivision_(mathematics))\n\n\u003Cdetails open>\n\n\u003Csummary>\nElement-wise multiplication functions & operators\n\u003C\u002Fsummary>\n\n| Arguments          | Function | Operator     | In-Place Operator |\n|--------------------|----------|--------------|-------------------|\n| `(Vector, Vector)` | `eldiv`  | `.\u002F` (infix) | `.\u002F=` (infix)     |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| `eldivInPlace`    |\n -->\n\n\u003C\u002Fdetails>\n\n### [Modulo](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FModulo_operation)\n\n\u003Cdetails open>\n\n\u003Csummary>\nModulo functions & operators\n\u003C\u002Fsummary>\n\n| Arguments         | Function | Operator     | In-Place Operator |\n|-------------------|----------|--------------|-------------------|\n| `(Array, Array)`  | `mod`    | `.%` (infix) | n\u002Fa               |\n| `(Array, Scalar)` | `mod`    | `%` (infix)  | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| n\u002Fa               |\n-->\n\n\u003C!-- FIXME: Do we need `mod` functions\u002Foperators for `Matrix`? -->\n\u003C!-- FIXME: Do we need `mod` functions\u002Foperators for `Vector`? -->\n\n\u003C\u002Fdetails>\n\n### [Remainder](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRemainder)\n\n\u003Cdetails open>\n\n\u003Csummary>\nRemainder functions & operators\n\u003C\u002Fsummary>\n\n| Arguments         | Function    | Operator | In-Place Operator |\n|-------------------|-------------|----------|-------------------|\n| `(Array, Array)`  | `remainder` | n\u002Fa      | n\u002Fa               |\n| `(Array, Scalar)` | `remainder` | n\u002Fa      | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| n\u002Fa               |\n -->\n\n\u003C!-- FIXME: Do we need `remainder` functions \u002Foperators for `Matrix`? -->\n\u003C!-- FIXME: Do we need `remainder` functions \u002Foperators for `Vector`? -->\n\n\u003C\u002Fdetails>\n\n### [Square Root](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSquare_root)\n\n\u003Cdetails open>\n\n\u003Csummary>\nSquare root functions & operators\n\u003C\u002Fsummary>\n\n| Arguments | Function | Operator | In-Place Operator |\n|-----------|----------|----------|-------------------|\n| `(Array)` | `sqrt`   | n\u002Fa      | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n -->\n\n\u003C!-- FIXME: The seems to be a variant `func sqrt\u003CMI, MO>(_ x: MI, into results: inout MO)` that could be made into a `sqrtInPlace`-->\n\n\u003C!-- FIXME: Do we need `sqrt` functions\u002Foperators for `Matrix`? -->\n\u003C!-- FIXME: Do we need `sqrt` functions\u002Foperators for `Vector`? -->\n\n\u003C\u002Fdetails>\n\n### [Summation](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSummation)\n\n\u003Cdetails open>\n\n\u003Csummary>\nSum functions & operators\n\u003C\u002Fsummary>\n\n| Arguments  | Function | Operator | In-Place Operator |\n|------------|----------|----------|-------------------|\n| `(Array)`  | `sum`    | n\u002Fa      | n\u002Fa               |\n| `(Matrix)` | `sum`    | n\u002Fa      | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| n\u002Fa               |\n -->\n\n\u003C!-- FIXME: Do we need `sum` functions\u002Foperators for `Vector`? -->\n\n\u003C\u002Fdetails>\n\n### [Dot Product](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDot_product)\n\n\u003Cdetails open>\n\n\u003Csummary>\nDot product functions & operators\n\u003C\u002Fsummary>\n\n| Arguments          | Function | Operator    | In-Place Operator |\n|--------------------|----------|-------------|-------------------|\n| `(Array, Array)`   | `dot`    | `•` (infix) | n\u002Fa               |\n| `(Vector, Vector)` | `dot`    | `•` (infix) | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| n\u002Fa               |\n -->\n\n\u003C!-- FIXME: Do we need `dot` functions\u002Foperators for `Matrix`? -->\n\n\u003C\u002Fdetails>\n\n### [Distance](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FEuclidean_distance)\n\n\u003Cdetails open>\n\n\u003Csummary>\nDistance functions & operators\n\u003C\u002Fsummary>\n\n| Arguments          | Function | Operator | In-Place Operator |\n|--------------------|----------|----------|-------------------|\n| `(Array, Array)`   | `dist`   | n\u002Fa      | n\u002Fa               |\n| `(Vector, Vector)` | `dist`   | n\u002Fa      | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| n\u002Fa               |\n -->\n\n### [Squared Distance](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FEuclidean_distance#Squared_Euclidean_distance)\n\n\u003Cdetails open>\n\n\u003Csummary>\nSquared distance functions & operators\n\u003C\u002Fsummary>\n\n| Arguments          | Function | Operator | In-Place Operator |\n|--------------------|----------|----------|-------------------|\n| `(Array, Array)`   | `distSq` | n\u002Fa      | n\u002Fa               |\n| `(Vector, Vector)` | `distSq` | n\u002Fa      | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| n\u002Fa               |\n -->\n\n\u003C\u002Fdetails>\n\n### [Power](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FPower_(mathematics))\n\n\u003Cdetails open>\n\n\u003Csummary>\nPower functions & operators\n\u003C\u002Fsummary>\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\u002Fa          | n\u002Fa               |\n| `(Vector, Vector)` | `pow`    | n\u002Fa          | n\u002Fa               |\n\n([Serial exponentiation](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FOrder_of_operations#Serial_exponentiation): `a ** b ** c == a ** (b ** c)`)\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| n\u002Fa               |\n| n\u002Fa               |\n| n\u002Fa               |\n -->\n\n\u003C!-- FIXME: Shouldn't the `pow`\u002F`**` function\u002Foperator of `(Array, Array)` be `elpow`\u002F`.**`? -->\n\u003C!-- FIXME: Shouldn't the `pow`\u002F`**` function\u002Foperator of `(Vector, Vector)` be `elpow`\u002F`.**`? -->\n\u003C!-- FIXME: The does not seem to be a corresponding `.**` operator implemented. -->\n\u003C!-- FIXME: Do we need `pow` functions\u002Foperators for `(Vector, Scalar)`? -->\n\n### [Exponential](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FExponential_function)\n\n\u003Cdetails open>\n\n\u003Csummary>\nExponential functions & operators\n\u003C\u002Fsummary>\n\n| Arguments  | Function | Operator | In-Place Operator |\n|------------|----------|----------|-------------------|\n| `(Array)`  | `exp`    | n\u002Fa      | n\u002Fa               |\n| `(Matrix)` | `exp`    | n\u002Fa      | n\u002Fa               |\n| `(Vector)` | `exp`    | n\u002Fa      | n\u002Fa               |\n\n\u003C!--\nInternal use only:\n\n| In-Place Function |\n|-------------------|\n| n\u002Fa               |\n| n\u002Fa               |\n| n\u002Fa               |\n -->\n\n\u003C\u002Fdetails>\n\n## Trigonometric Operations\n\n\u003Cdetails open>\n\n\u003Csummary>\nTrigonometric functions & operators\n\u003C\u002Fsummary>\n\n### [Sine\u002FCosine\u002FTangent](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTrigonometric_functions)\n\n| Arguments | Function | Operation     |\n|-----------|----------|---------------|\n| `(Array)` | `sin`    | Sine          |\n| `(Array)` | `cos`    | Cosine        |\n| `(Array)` | `tan`    | Tangent       |\n| `(Array)` | `sincos` | Sine & Cosine |\n\n### [Arc Sine\u002FCosine\u002FTangent](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTrigonometric_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\u002FCosine\u002FTangent](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FHyperbolic_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\u002FCosine\u002FTangent](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FInverse_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:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAngle#Types_of_angles)\n\n| Arguments | Function  | Operation                                                                                                  |\n|-----------|-----------|------------------------------------------------------------------------------------------------------------|\n| `(Array)` | `rad2deg` | [Radians](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRadian) to [Degrees](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDegree_(angle)) |\n| `(Array)` | `deg2rad` | [Degrees](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDegree_(angle)) to [Radians](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRadian) |\n\n\u003C\u002Fdetails>\n\n## [Exponential Function](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FExponential_function)\n\n\u003Cdetails open>\n\n\u003Csummary>\nExponential functions & operators\n\u003C\u002Fsummary>\n\n| Arguments | Function | Operation                   |\n|-----------|----------|-----------------------------|\n| `(Array)` | `exp`    | Base-e Exponential Function |\n| `(Array)` | `exp2`   | Base-2 Exponential Function |\n\n\u003C\u002Fdetails>\n\n## [Logarithm](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLogarithm)\n\n\u003Cdetails open>\n\n\u003Csummary>\nExponential functions & operators\n\u003C\u002Fsummary>\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\u002Fdetails>\n\n## Statistical Operations\n\n\u003Cdetails open>\n\n\u003Csummary>\nStatistical functions & operators\n\u003C\u002Fsummary>\n\n### [Summation](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSummation)\n\n| Arguments | Function | Operation          |\n|-----------|----------|--------------------|\n| `(Array)` | `sum`    | Summation          |\n| `(Array)` | `asum`   | Absolute Summation |\n\n### [Minimum\u002FMaximum](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMaximal_and_minimal_elements)\n\n| Arguments | Function | Operation |\n|-----------|----------|-----------|\n| `(Array)` | `min`    | Minimum   |\n| `(Array)` | `max`    | Maximum   |\n\n### [Mean\u002FVariance](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMean)\n\n| Arguments | Function   | Operation                                                              |\n|-----------|------------|------------------------------------------------------------------------|\n| `(Array)` | `mean`     | [Mean](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMean)                             |\n| `(Array)` | `meamg`    | Mean of Magnitudes                                                     |\n| `(Array)` | `measq`    | [Mean of Squares](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMean_square)           |\n| `(Array)` | `variance` | [Variance](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FVariance)                     |\n| `(Array)` | `std`      | [Standard Deviation](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FStandard_deviation) |\n\n\u003C\u002Fdetails>\n\n## Auxiliary Functions\n\n\u003Cdetails open>\n\n\u003Csummary>\nAuxiliary functions & operators\n\u003C\u002Fsummary>\n\n### [Rounding Functions](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRounding)\n\n| Arguments | Function | Operation                                                             |\n|-----------|----------|-----------------------------------------------------------------------|\n| `(Array)` | `ceil`   | [Ceiling](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFloor_and_ceiling_functions)  |\n| `(Array)` | `floor`  | [Flooring](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFloor_and_ceiling_functions) |\n| `(Array)` | `round`  | [Rounding](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRounding)                    |\n| `(Array)` | `trunc`  | [Integer truncation](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTruncation)        |\n\n### [Absolute value](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAbsolute_value)\n\n| Arguments | Function | In-Place Function | Operator | In-Place Operator |\n|-----------|----------|-------------------|----------|-------------------|\n| `(Array)` | `abs`    | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n### [Signum function](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSign_function)\n\n| Arguments | Function   | In-Place Function | Operator | In-Place Operator |\n|-----------|------------|-------------------|----------|-------------------|\n| `(Array)` | `copysign` | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n### [Multiplicative inverse](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMultiplicative_inverse)\n\n| Arguments | Function | In-Place Function | Operator | In-Place Operator |\n|-----------|----------|-------------------|----------|-------------------|\n| `(Array)` | `rec`    | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n\u003C\u002Fdetails>\n\n## Matrix-specific Operations\n\n\u003Cdetails open>\n\n\u003Csummary>\nMatrix-specific functions & operators\n\u003C\u002Fsummary>\n\n### [Matrix Inversion](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FInvertible_matrix)\n\n| Arguments  | Function | In-Place Function | Operator | In-Place Operator |\n|------------|----------|-------------------|----------|-------------------|\n| `(Matrix)` | `inv`    | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n### [Matrix Transposition](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMatrix_transpose)\n\n| Arguments  | Function    | In-Place Function | Operator      | In-Place Operator |\n|------------|-------------|-------------------|---------------|-------------------|\n| `(Matrix)` | `transpose` | n\u002Fa               | `′` (postfix) | n\u002Fa               |\n\n### [Matrix Determinant](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMatrix_determinant)\n\n| Arguments  | Function | In-Place Function | Operator | In-Place Operator |\n|------------|----------|-------------------|----------|-------------------|\n| `(Matrix)` | `det`    | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n### [Eigen Decomposition](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FEigen_decomposition)\n\n| Arguments  | Function         | In-Place Function | Operator | In-Place Operator |\n|------------|------------------|-------------------|----------|-------------------|\n| `(Matrix)` | `eigenDecompose` | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n\u003C\u002Fdetails>\n\n## DSP-specific Operations\n\n\u003Cdetails open>\n\n\u003Csummary>\nFast fourier transform functions & operators\n\u003C\u002Fsummary>\n\n### [Fast Fourier Transform](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FConvolution)\n\n| Arguments | Function | In-Place Function | Operator | In-Place Operator |\n|-----------|----------|-------------------|----------|-------------------|\n| `(Array)` | `fft`    | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n### [Convolution](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FConvolution)\n\n| Arguments        | Function | In-Place Function | Operator | In-Place Operator |\n|------------------|----------|-------------------|----------|-------------------|\n| `(Array, Array)` | `conv`   | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n### [Cross-Correlation](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCross-correlation)\n\n| Arguments        | Function | In-Place Function | Operator | In-Place Operator |\n|------------------|----------|-------------------|----------|-------------------|\n| `(Array, Array)` | `xcorr`  | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n| `(Array)`        | `xcorr`  | n\u002Fa               | n\u002Fa      | n\u002Fa               |\n\n\u003C\u002Fdetails>\n\n[build status]: https:\u002F\u002Fgithub.com\u002FJounce\u002FSurge\u002Factions?query=workflow%3ACI\n[build status badge]: https:\u002F\u002Fgithub.com\u002FJounce\u002FSurge\u002Fworkflows\u002FCI\u002Fbadge.svg\n[license]: https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT\n[license badge]: https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fl\u002FSurge.svg\n[cocoapods platforms badge]: https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fp\u002FSurge.svg\n[cocoapods]: https:\u002F\u002Fcocoapods.org\u002Fpods\u002FSurge\n[cocoapods badge]: https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FSurge.svg\n[carthage]: https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage\n[carthage badge]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg\n[swift package manager badge]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fspm-compatible-brightgreen.svg?style=flat\n[swift package manager]: https:\u002F\u002Fswift.org\u002Fpackage-manager\n","Surge 是一个基于 Swift 的库，利用 Accelerate 框架提供高性能的矩阵数学、数字信号处理和图像操作功能。它通过暴露现代 CPU 中可用的 SIMD 指令来显著提高特定计算的性能。Surge 简化了 Accelerate 框架的使用，使得在一组数据上进行计算几乎与对单个数据点的操作一样简单且高效。适用于需要快速执行复杂数学运算、信号处理或图像变换的应用场景，特别是在处理大规模数据集时表现出色。需要注意的是，在某些情况下，如小数据集上的简单计算，传统算法可能更优，因此建议根据具体需求进行性能测试。",2,"2026-06-11 03:09:07","top_language"]