Latest 0.1.2
Homepage https://github.com/alexandertar/LASwift
License BSD-3-Clause
Platforms ios 8.0, osx 10.9, tvos 9.0
Frameworks Accelerate
Authors

CI Status
codecov
Carthage compatible
Documentation
GitHub license

LASwift provides most of linear algebra operations on vectors and matrices
required to implement machine learning algorithms. Library syntax is inspired by
Matlab matrix manipulation and Haskell linear algebra library ‘hmatrix’. LASwift is
using high-performant calculations provided by LAPACK, BLAS and vDSP through Apple
Accelerate framework.

Currently supported

Following operations are fully supported for both vectors and matrices:

  • Arithmetic operations (addition, substraction, multiplication, division, absolute value)
  • Exponential functions (raise to power, exponent, logarithms)
  • Trigonometric functions (sine, cosine, tangent)
  • Statistics functions (max, min, mean value, standard deviation)

Linear algebra operations on matrices:

  • Inversion
  • Transposition
  • Matrix power (integer values)
  • Eigenvectors and eigenvalues
  • Singular value decomposition

Following matrix manipulation operations are supported:

  • Concatenation
  • Slicing

Requirements

  • iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+
  • Xcode 8.0+
  • Swift 3.0+

Benchmarks

Refer to linalg-benchmarks project
regarding basic benchmarking of latest version of LASwift against most popular linear
algebra libraries (Haskell hmatrix, Python NumPy, Octave, Go gonum-matrix).

Installation

CocoaPods

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Go to the directory of your Xcode project, and Create and Edit your Podfile and add LASwift:

$ cd /path/to/MyProject
$ touch Podfile
$ edit Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

use_frameworks!
pod 'LASwift', '~> 0.1.0'

Install into your project:

$ pod install

Open your project in Xcode from the .xcworkspace file (not the usual project file):

$ open MyProject.xcworkspace

You can now import LASwift framework into your files.

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate LASwift into your Xcode project using Carthage, specify it in your Cartfile file:

github "alexandertar/LASwift" >= 0.1.0

Swift Package Manager

You can use The Swift Package Manager to install LASwift by adding the proper description to your Package.swift file:

import PackageDescription

let package = Package(
name: "YOUR_PROJECT_NAME",
targets: [],
dependencies: [
.Package(url: "https://github.com/alexandertar/LASwift", versions: "0.1.0" ..< Version.max)
]
)

Note that the Swift Package Manager is still in early design and development, for more information checkout its GitHub Page.

Contribution

Currently implemented functionality should be sufficient enough to implement machine learning
algorithms (as this was an initial purpose). However, if you find something missing or wish to add
extra features, feel free to submit pull-requests or create issues with proposals.

Author

Alexander Taraymovich, [email protected]

License

LASwift is available under the BSD-3-Clause license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LASwift",
    "version": "0.1.2",
    "summary": "Linear algebra library for Swift language",
    "description": "This library provides most of linear algebra operations on vectors and matricesnrequired to implement machine learning algorithms. Library syntax is inspired bynMatlab matrix manipulation and Haskell linear algebra library 'hmatrix'",
    "homepage": "https://github.com/alexandertar/LASwift",
    "license": {
        "type": "BSD-3-Clause",
        "file": "LICENSE"
    },
    "authors": {
        "Alexander Taraymovich": "[email protected]"
    },
    "source": {
        "git": "https://github.com/alexandertar/LASwift.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "tvos": "9.0"
    },
    "frameworks": "Accelerate",
    "source_files": "Sources/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This