Git Product home page Git Product logo

rustalgebloat's Introduction

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

rustalgebloat's People

Contributors

siegelord avatar siegelordex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.