Git Product home page Git Product logo

lineas's Introduction

Lineas

Linear algebra in Rust

crate.io version badge docs.rs docs status badge

This fast and simple-to-use library provides the ability to perform linear algebra within Rust. It provides matrices and vectors as well as complex numbers for all your computing needs.

Examples

Use lines

If you want to use a matrix, you ned to import it. Operations are included as default too.

use lineas::Matrix;

A new matrix

Matrix::new([[1, 2, 3], [4, 5, 6]]);

Make sure that the array you give is two dimensional and that each element is the same size

DTypes

You can change the dtype (data type taken from NumPy) with the dtype function

Matrix::new([[1, 2], [3, 4]]).dtype::<f32>();

Decomposition

If you need to use decompositions, you'll need to specify that:

use lineas::decompose::{
    LUDecompose,
    PLUDecompose,
    Diagonalise
};

let a = Matrix::new([[1, 2], [3, 4]]);

a.lu_decompose();
a.plu_decompose();
a.diagonalise();

Contribute

If you want to contribute, feel free. That is the nature of open source after all. Do a pull request or something.

lineas's People

Contributors

rosiepuddles avatar

Stargazers

HuyHung92 avatar lsb108.eth avatar  avatar

Watchers

 avatar

Forkers

lsb108

lineas's Issues

Numerical multiplication and division

Currently, we have to use .scale to divide and multiply matrices by single numerical values. It would be nice if we could change this to allow Matrix * <literal> and Matrix / <literal>

Random for matrices

Add in the functions:

  • Matrix::random() for uniform random values from 0 to 1
  • Matrix::random_range(r:Ranged) for uniform random values in given range

Standard deviation

Add in standard deviation for vectors and cvectors. Also implement this for matrices row-wise, column-wise, and for all values

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.