13 releases

0.0.13 Jun 3, 2017
0.0.12 Dec 28, 2016
0.0.11 Nov 21, 2015
0.0.8 Apr 17, 2015
0.0.0 Dec 16, 2014

#83 in Math

Download history 54/week @ 2019-08-23 50/week @ 2019-08-30 17/week @ 2019-09-06 26/week @ 2019-09-13 75/week @ 2019-09-20 14/week @ 2019-09-27 15/week @ 2019-10-04 1/week @ 2019-10-11 29/week @ 2019-10-18 17/week @ 2019-10-25 26/week @ 2019-11-01 1/week @ 2019-11-08 41/week @ 2019-11-15 1/week @ 2019-11-22

74 downloads per month

LGPL-3.0

56KB
2.5K SLoC

RustAlgebloat

Build Status

Do you love template bloat? Do you think waiting for your program to compile is awesome? Do you think complicated error messages are the best thing since sliced bread? If so, this linear algebra library is just for you!

Packages

Documentation

See here.

Example

Some basic operations and row access (no allocations except during the initial matrix creation!):

let m = &mat![1.0, 2.0, 3.0;
              4.0, 5.0, 6.0;
              7.0, 8.0, 9.0];
println!("m =\n{}", m);
let t1 = m.t();
println!("t1 =\n{}", t1);
let r = m.row(0) + t1.row(0);
println!("r =\n{}", r);

let m2 = stack![m.view( ..2, ..2), m.view( ..2, 1..);
                m.view(1..,  ..2), m.view(1..,  1..)];
println!("m2 =\n{}", m2);

Output:

m =1 2 3⎤
⎢4 5 6⎥
⎣7 8 9⎦
t1 =1 4 7⎤
⎢2 5 8⎥
⎣3 6 9⎦
r =
[2 6 10]
m2 =1 2 2 3⎤
⎢4 5 5 6⎥
⎢4 5 5 6⎥
⎣7 8 8 9

Features

  • WIP! This is very much incomplete... stay tuned!
  • Expression templates (well, more like expression traits since this is Rust) assure all the caveats above while in principle providing allocation-free speed (only available with optimizations turned on)!
  • Matrices
    • Elementwise operations (right-hand side can be a scalar)
      • Binary operators (*/-+)
      • Unary negation
      • Binary functions
        • pow
        • atan2
        • hypot
      • Unary functions
        • Trigonometry/exponential functions
        • ceil
        • floor
        • ln
        • log10
        • sqrt
      • Reductions
        • min
        • max
    • Row and column access
    • Views
    • Multiplication
    • Reshaping
    • Stacking
    • Flat views (view matrix as a vector)
      • Element access
      • Slicing

Building

Via Cargo:

./cargo_util.py --build

Dependencies