Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

teburd/numerl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numerical Erlang

Efficient matrix math in erlang in the same spirit as NumPy.

NOTE This repo is here for purely historical reasons, no further work has been done for a long time.

Example Usage

An example of the potential future usage of the matrix module in NumErl.

matrix_demo.erl

-module(matrix_demo).

-export([do_it/0]).

do_it() ->
    %% Matrix 3x3 full of ones
    MyMatrix = matrix:ones(3),

    %% Matrix 3x3 identity
    Identity = matrix:identity(3),
   
    %% Transposed ones matrix is in fact equal as expected.
    MyMatrix = matrix:transpose(MyMatrix),

    %% Identity multiplied by MyMatrix gives MyMatrix
    MyMatrix = matrix:multiply(MyMatrix, Identity),

    %% Convert MyMatrix to a tuple of tuples of numbers
    TMatrix = matrix:to_tuples(MyMatrix),

    %% Convert MyMatrix to a list of lists of numbers
    LMatrix = matrix:to_lists(MyMatrix),

    io:format("TMatrix ~p~n", [TMatrix]),
    io:format("LMatrix ~p~n", [LMatrix]),

    ok.

About

Numerical Erlang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published