MathEagle is named after the golden eagle, since this is the fastest bird in the world

Overview

Swift-MathEagle

Travis

MathEagle is named after the golden eagle, since this is the fastest bird in the world (in horizontal flight).

This project is meant to make math easy in swift without losing performance. The syntax is designed to be as simple as possible. Contributors are always welcome, the more the merrier!

Warning!

MathEagle is still in its initial development phase so the syntax still changes frequently.

Installation

The fastest way to add MathEagle to your project is to download it as a zip file and drag all files in the MathEagle/Source folder to your project. Make sure to add them to your target. For Mac applications you can use the generated framework, check the wiki for more information. I'm currently working on an iOS framework.

MathEagle requires gmp (GNU multiple precision arithmetic library) be installed. Install gmp via brew install gmp assuming you have Homebrew installed.

Supported Xcode Versions

MathEagle is fully compatible with:

  • Xcode 9 and Swift 4

Currently Supported

  • Basic extensions, operators like power (** operator) and functions like sign and factorial
  • Prime functions
  • Complex numbers
  • Single variable function root solving
  • Single variable function optimization
  • Matrix and Vector math
  • Basic graph algorithms

MathEagle is fully generic, so almost all classes and functions work with any type (even types you define). MathEagle vectors for example can also be of type Int, while the Float and Double type vectors use Accelerate in the background for speed.

Take a look at the Wiki for documentation.

Advantages

The biggest advantage of MathEagle is that it's totally generic. You can create matrices and vectors and use functions like isPrime with all numeric types. You can even create your own type (let's say Quaternion), implement the protocols and everything just works. Of course specific implementations are overloaded to maintain performance. Vector addition for Float vectors for example is overloaded to use the Accelerate framework.

Benchmarking

First benchmarking tests show that MathEagle is as fast as Python's famous numpy. You can check the "Benchmarking Files" folder in MathEagle's tests. (These tests were conducted on an early 2013 15-inch Retina Macbook Pro with a 2.7 GHz Intel Core i7 and 16 GB of RAM.

Here are some plots for Vector addition: ![Vector Addition Float Benchmarking](/MathEagleTests/Benchmarking Files/Plot Images/VectorAdditionFloat.png) ![Vector Addition Double Benchmarking](/MathEagleTests/Benchmarking Files/Plot Images/VectorAdditionDouble.png)

To Do

  • Documentation
  • Further General Development
  • Incorporate Accelerate for all applications
Comments
  • [Suggestion] Generic approach to Solver

    [Suggestion] Generic approach to Solver

    I was trying to use the Solver.newton methods and found that it wasn't generic to handle Double, Float, CGFloat etc. I ended up implementing it this way. Do you think it would be worthwhile to update the code as illustrated?

    opened by BenziAhamed 4
  • Kellyroach/upgrade to xcode941

    Kellyroach/upgrade to xcode941

    This pull request upgrades Swift-MathEagle to Xcode 9.4.1 / Swift 4.2 .

    • Upgrade to Xcode 9.4.1 / Swift 4.2
    • Improved quadrant, Complex **, BigFloat stringValue, PermutationMatrix row, isPrime
    • Improved Random.swift
    • Added 149 new tests for improved test coverage
    opened by kellyroach 3
  • Make numberOfDigits function

    Make numberOfDigits function

    This function could use something like this, but then Swifty:

    n = 1;
    if (i >= 100000000){i /= 100000000; n += 8;}
    if (i >= 10000){i /= 10000; n += 4;}
    if (i >= 100){i /= 100; n += 2;}
    if (i >= 10){i /= 10; n += 1;}
    
    opened by rugheid 0
  • Add more optimization routines

    Add more optimization routines

    The only optimization procedure currently implemented is the golden section method. Optimization of functions with more than one variable (most notable Rosenbrock's function) is impossible without other methods.

    Some initial suggestions:

    For a well-written, high-level, fast and clear example of those (and other) routines, I highly recommend checking out Optim.jl.

    opened by anthonyclays 0
  • Make Complex generic

    Make Complex generic

    As the readme states:

    The biggest advantage about MathEagle is that it's totally generic. :wink:

    Making Complex generic over any real number would be great (especially when you get around to adding arbitrary precision numerics)

    opened by anthonyclays 0
  • Add more benchmarks

    Add more benchmarks

    Current benchmarks are not entirely representative of the performance, as simple vectorized computations are easily compiled to near-perfect machine code.

    Some benchmark suggestions:

    • Linear algebra routines (SVD, matrix inverse, eigenvalues...)
    • Number theory functions (primality tests, integer factorization...)
    • Optimization (test using rosenbrock function, count the number of objective function calls)
    opened by anthonyclays 1
Owner
Rugen Heidbuchel
Rugen Heidbuchel
A "time ago", "time since", "relative date", or "fuzzy date" category for NSDate and iOS, Objective-C, Cocoa Touch, iPhone, iPad

Migration 2014.04.12 NSDate+TimeAgo has merged with DateTools. DateTools is the parent project and Matthew York is the project head. This project is n

Kevin Lawler 1.8k Dec 2, 2022
Jorge Ovalle 305 Oct 11, 2022
MetricTime is designed to be one universal timekeeping system that eliminates the hassle of calculating time since most of its convertions as simple as converting meters to centimeters

MetricTime MetricTime is designed to be one universal timekeeping system that eliminates the hassle of calculating time since most of its convertions

Adrian Edwards 4 Feb 10, 2022
Solarized Dark Theme for Xcode. Compatible with all modern versions of Xcode since 2013!

Solarized Dark for Xcode Note I've moved away from using Solarized to a Night-Shift/Dark-Mode-friendly palette of my own creation; Cognac. It's availa

Arthur Ariel Sabintsev 365 Nov 25, 2022
🐦 Flappy Bird reincarnation [Swift 5.3, GameplayKit, SpriteKit, iOS 12].

?? Flappy Bird reincarnation [Swift 5.3, GameplayKit, SpriteKit, iOS 12].

Astemir Eleev 290 Dec 27, 2022
swift implementation of flappy bird. More at fullstackedu.com

FlappySwift An implementation of Flappy Bird in Swift for iOS 8. Notes We're launching a course Game Programming with Swift If you are interested in e

newline (formerly Fullstack.io) 9.5k Dec 29, 2022
A 99-player last-bird-flapping battle royale

Flappy Royale A HTML5 Game, built to be embedded in apps using Phaser 3. Setup Clone, and run yarn install, run yarn start to load up into the app: cd

Flappy Royale 149 Dec 17, 2022
swift implementation of flappy bird. More at fullstackedu.com

FlappySwift An implementation of Flappy Bird in Swift for iOS 8. Notes We're launching a course Game Programming with Swift If you are interested in e

newline (formerly Fullstack.io) 9.5k Dec 29, 2022
Flappy Bird in Swift

FlappySwift An implementation of Flappy Bird in Swift for iOS 8. Notes We're launching a course Game Programming with Swift If you are interested in e

null 0 Oct 30, 2021
The fastest 🚀 way to embed a 3D model in Swift

Insert3D is the easiest ?? and fastest ?? way to embed a 3D model in your iOS app. It combines SceneKit and Model I/O into a simple library for creati

Viktor Makarskyy 85 Dec 31, 2022
The fastest zero-tap iOS menu.

⚡️ Quicklook The fastest zero-tap iOS menu CariocaMenu is a simple, elegant, fast navigation menu for your iOS apps. ?? Features Accessible from a sin

momo 779 Nov 11, 2022
A Generic CoreData Manager to accept any type of objects. Fastest way for adding a Database to your project.

QuickDB FileManager + CoreData ❗️ Save and Retrieve any thing in JUST ONE line of code ❗️ Fast usage dataBase to avoid struggling with dataBase comple

Behrad Kazemi 17 Sep 24, 2022
Simply the fastest way to transmit data between iOS/tvOS and OSX

DarkLightning DarkLightning is a lightweight Swift library to allow data transmission between iOS/tvOS devices (Lightning port, Dock connector, USB-C)

Jens Meder 318 Nov 29, 2022
The fastest iOS app to add a note to your email inbox

Major Key How often are you on the run, or hanging out with friends, only to suddenly think of this really important thing you need to do when you're

Felix Krause 190 Oct 9, 2022
The fastest and easiest way to present a UITableView - in 3 lines of code.

Swift Table The fastest and easiest way to present a UITableView - in 3 lines of code. Powered by Generics to present any data type. No need to use th

Benyam Alemu Sood 16 Nov 1, 2022
An iOS library to natively render After Effects vector animations

Lottie for iOS, macOS (and Android and React Native) View documentation, FAQ, help, examples, and more at airbnb.io/lottie Lottie is a mobile library

Airbnb 23.6k Dec 31, 2022
Showcase new features after an app update similar to Pages, Numbers and Keynote.

WhatsNew Description WhatsNew automatically displays a short description of the new features when users update your app. This is similar to what happe

Patrick Balestra 1.5k Jan 4, 2023
Generates a random photo after you click the button

Swift Random Photo Generator Generates a random photo after you click the button! Things you need to do ?? clone this repository git clone https://git

Tsuen Hsueh 2 Aug 16, 2022
his is my second app, made right after the I am Rich app

I-am-Poop ?? Hello everyone! This is my second app, made right after the I am Rich app, to better fixate the concepts I learned during this lesson, wh

Victor Colen 1 Oct 11, 2021
iOS App that allows a pilot to check drone photo collection after a mapping mission for any issues

DronePhotoChecker iOS App that allows a pilot to check drone photo collection after a mapping mission for any issues. Features: Connects to DJI drone

null 0 Dec 30, 2021