simba 0.2.0

Scalar traits (`Real`, `Transcendental`) implemented for the Q32.32 `fixed::Fixed` of fixed-cairo: the Cairo counterpart of Dimforge's simba.

Readme

simba-cairo

Scalar traits for provable linear algebra in Cairo: the counterpart of Dimforge's simba.

In Rust, simba is a trait layer (RealField, ComplexField) implemented for the primitive f32 / f64; nalgebra is generic over T: RealField. Here the primitive is the Q32.32 fixed::Fixed and simba implements the traits for it; nalgebra-cairo is generic over T: Real.

Part of a stack porting reputable Rust crates to Cairo for provable game physics: fixed -> simba -> nalgebra -> rapier and fixed -> glam -> glamx -> rapier.

Package

Package Content simba Real (constants, helpers, fused kernels sum_prod* / diff_prod / norm*, the fixed::wide::Acc accumulator, prepared divisors div3..div16) and Transcendental, implemented for fixed::Fixed by delegation only (#[inline(always)], zero-cost: no arithmetic of its own)
[dependencies]
simba = "0.2.0"
fixed = "0.4.0"

The numeric specification (rounding, overflow, panic messages 'Fixed: ...') is fixed's. See docs/DESIGN.md.

Development

./scripts/check.sh (fmt, lint, build, tests, gas snapshot; --update refreshes gas/). Toolchain pinned in .tool-versions (scarb 2.19.4, starknet-foundry 0.61.0).

Metadata

Version 0.2.0

Uploaded 3 hours ago

License MIT

Cairo version ^2.19.4

Size 13.3 KB

Installation

Run the following command in your project dir

scarb add simba@0.2.0

Or add the following line to your Scarb.toml

simba = "0.2.0"

Monthly downloads

Links

Keywords

  • math
  • scalar
  • fixed-point
  • linear-algebra
  • gamedev

Owners