All Projects β†’ dougmacdoug β†’ ponylang-linal

dougmacdoug / ponylang-linal

Licence: MIT license
Linear Algebra library for Pony Language

Programming Languages

Pony
23 projects
Batchfile
5799 projects
Makefile
30231 projects

Projects that are alternatives of or similar to ponylang-linal

kiuatan
A parser library for Pony.
Stars: ✭ 15 (-34.78%)
Mutual labels:  ponylang, pony-language
Ponyc
🐴 Pony is an open-source, actor-model, capabilities-secure, high performance programming language
Stars: ✭ 4,857 (+21017.39%)
Mutual labels:  ponylang, pony-language
msgpack
🐴 Pure Pony implementation of the MessagePack serialization format. msgpack.org[Pony]
Stars: ✭ 31 (+34.78%)
Mutual labels:  ponylang, pony-language
http
ponylang HTTP client library 🐴 πŸ•ΈοΈ
Stars: ✭ 38 (+65.22%)
Mutual labels:  ponylang, pony-language
pony-websocket
WebSocket server for Ponylang🐴
Stars: ✭ 43 (+86.96%)
Mutual labels:  ponylang, pony-language
pony-tutorial
🐴 Tutorial for the Pony programming language
Stars: ✭ 247 (+973.91%)
Mutual labels:  pony-language
jylis
A distributed in-memory database for Conflict-free Replicated Data Types (CRDTs). 🌱 ↔️
Stars: ✭ 68 (+195.65%)
Mutual labels:  pony-language
Learn-Machine-Learning-in-3-month
No description or website provided.
Stars: ✭ 35 (+52.17%)
Mutual labels:  linear-algebra
float
Single precision (float) matrices for R.
Stars: ✭ 41 (+78.26%)
Mutual labels:  linear-algebra
rfcs
🐴 RFCs for changes to Pony
Stars: ✭ 60 (+160.87%)
Mutual labels:  pony-language
arrayfire-haskell
Haskell bindings to ArrayFire
Stars: ✭ 52 (+126.09%)
Mutual labels:  linear-algebra
eigenvalues
symmetric matrices algorithms to compute eigenvalue/eigenvector pairs
Stars: ✭ 26 (+13.04%)
Mutual labels:  linear-algebra
pony-zmq
Pure Pony implementation of the ZeroMQ messaging library. 🐴 0️⃣ Ⓜ️ πŸ€
Stars: ✭ 64 (+178.26%)
Mutual labels:  pony-language
SLICOT-Reference
SLICOT - A Fortran subroutines library for systems and control
Stars: ✭ 19 (-17.39%)
Mutual labels:  linear-algebra
linearmap-family
Purely-functional, coordinate-free linear algebra
Stars: ✭ 22 (-4.35%)
Mutual labels:  linear-algebra
speedy-vision
GPU-accelerated Computer Vision for JavaScript.
Stars: ✭ 96 (+317.39%)
Mutual labels:  linear-algebra
saddle
SADDLE: Scala Data Library
Stars: ✭ 23 (+0%)
Mutual labels:  linear-algebra
maths-for-deep-learning-ai
A open source book covering the foundational maths of deep learning and machine learning using TensorFlow
Stars: ✭ 35 (+52.17%)
Mutual labels:  linear-algebra
pony-sodium
Safe Pony FFI wrapper for the libsodium cryptography library. 🐴 πŸ”
Stars: ✭ 24 (+4.35%)
Mutual labels:  pony-language
kaliningraph
πŸ•ΈοΈ Graphs, finite fields and discrete dynamical systems in Kotlin
Stars: ✭ 62 (+169.57%)
Mutual labels:  linear-algebra

linal - Linear Algebra library for Pony Language

Tuple-based Linear Algebra for typical 2D, 3D operations

  • operate on the stack
  • 100% immutable
  • side-effect free functions
  • float32 internals (F32)
  • 🐎 pure pony
  • efficient wrapper classes available for convenience

Status

CircleCI

  • v0.2.1 - 2020-02-28
  • v0.2.0 - 2018-03-03
  • v0.1.0 - 2018-02-19

Applicability

This library is intended for use in common 2D and 3D applications not as a scientific or precise mathematics library. Various scientific libraries such as LAPACK, GSL or others can be bound with the Pony C ABI.

Installation

{ 
  "type": "github",
  "repo": "dougmacdoug/ponylang-linal"
}
  • stable fetch to fetch your dependencies
  • use "linal" to include this package
  • stable env ponyc to compile your application

Type System

Each TYPE consists of a type alias, a primitive, and a wrapper class

  • A type alias to a tuple (similar to class state data)
  • A primitive function collection (similar to methods)
  • the first argument is similar to "this" except it is immutable
  • rather than modify state, result is returned as immutable stack tuple
  • optional wrapper class
  • wrapper class methods only produce tuples to prevent unwanted instantiation
  • wrapper classes accept both tuples and instances for convenience

Example for Vector 2

  • V2 => Type Alias for tuple (F32, F32)
  • V2fun => primitive function collection that acts on and returns V2 tuples
  • Vector2 => wrapper class for convenience, embedding, and persistent handle
  let a = (F32(1), F32(1)) // simple tuple compatible with V2

  let b: V2 = (3, 3)       // declared type alias forces 3's to F32
  let c = V2fun(3, 3)      // apply sugar => V2
  let d = V2fun.add(a, b)  // a + b
  let f = V2fun.mul(V2fun.unit(d), 5) // normalize d and scale to 5 units

  let v2 = Linear.vector2()   // readable function alias to V2fun
  let p1 = v2(1, 2)           // alias + apply sugar
  let p2 = v2.add(p1, (1, 1)) // p2 = p1 + (1, 1)

  let vec = Vector2 // wrapper class
  vec() = vec + p1  // vec = vec + p1 via add sugar, update sugar
  vec() = vec * 5   // vec = vec * 5 via mul sugar, update sugar
  vec(p2)           // vec = p2 via apply sugar

  // wrapper classes accept other wrapper instances or tuples
  let other1 = Vector2(vec)
  let other2 = Vector2(p1)
  // functions with results do not generate GC'd classes, only tuples
  let result: V2 = other1 + other2
  // update sugar looks closer to traditional linear classes
  other1() = other1 + other2

Types

Type Func Wrapper Tuple
V2 V2fun Vector2 (x: F32, y: F32)
V3 V3fun Vector3 (x: F32, y: F32, z: F32)
V4 V4fun Vector4 (x: F32, y: F32, z: F32, w: F32)
M2 M2fun Matrix2 (x: V2, y: V2)
M3 M3fun Matrix3 (x: V3, y: V3, z: V3)
M4 M4fun Matrix4 (x: V4, y: V4, z: V4, w: V4)
Q4 Q4fun Quaternion (x: V4, y: V4, z: V4, w: V4)
R4 R4fun Rect (origin: V2, width: F32, height: F32)
R2 R2fun Ray (position: V3, direction: V3)
P4 P4fun Plane (normal: V3, distance: F32)

Utility

  • Linear - various linal utility functions
  • Intersect - hit test functions

@TODO // MAYBEDO

  • docstring references
  • unit test coverage
  • examples
  • slerp nlerp
  • faster Q4
  • add fast sqrt for length operations
  • consider writing longhand (dist2 = distance_squared)
  • try to use compile time expressions once adopted by pony fun inv(q: Q4): Q4 => #(div(conj(q), dot(q, q)))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].