Giter VIP home page Giter VIP logo

lua_matrix's Introduction

lmatrix

A matrix library for Lua, written in C. (This is basically a port of a library I've already written in Lua, but am using to learn the C api.)

Build (GNU make)

As a dynamic library

Given that you have the lua headers on your system: lua.h, lualib.h, and lauxlib.h

  1. clone the repo && cd into it
  2. run make, and it (hopefully) should just work
$ make

Additionally, I keep a simple test suite. You can run

$ make testing
$ cd testing/
$ ./runTests noErrors.lua

to build and run the test suite.

Manually

  1. Clone the repo or curl/wget/whatever the src files
  2. run the following
$ gcc -shared -o lmatrix.so -fPIC src/*.c

Use

Once you've either downloaded or compiled the library, either placing it in the directory of your Lua project or placing it in your LUA_CPATH you can simply require it like any other library

local matrix = require "lmatrix"
local a = matrix.new{
	{1,2,3},
	{4,5,6},
	{7,8,9}
}
local b = matrix.random(3, 3)
print(a*b)

For details of how to actually use the library, check out either the wiki or doc directory Currently the docs are a little outdated, hopefully I'll get to it soon.

lua_matrix's People

Contributors

euclidianace avatar

Stargazers

 avatar  avatar

Watchers

 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.