GithubHelp home page GithubHelp logo

bachmeil / gretlmat Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 213 KB

A simple linear algebra library for D

License: GNU General Public License v2.0

D 99.89% Shell 0.11%
d linearalgebra gretl matrix vector dlang d-programming-language

gretlmat's Introduction

gretlmat

This library makes it as easy as possible to add matrix and vector support to a D program on Linux, Mac, or Windows.

Features

  • Matrix and vector types.
  • Operators for common operations like addition, subtraction, and multiplication.
  • Support for common linear algebra operations.
  • Vectors are ranges that support foreach.
  • Rows and columns have their own types and are ranges that support foreach.
  • Matrices can be used as ranges to iterate over rows or columns to support foreach.
  • Multidimensional slicing provides convenient submatrix selection.

License

GPLv2

Design Constraints

  • Optimized for ease of use rather than speed of execution.
  • Full documentation, with a usage example for every feature.
  • The entire library goes in one file. No dependencies other than Gretl.
  • Works with any modern release of DMD, LDC, or GDC on any OS supported by D.
  • No understanding of memory management required to use the library.
  • No knowledge of C required to use the library.
  • Code that's easy to read and extend with no more than an intermediate knowledge of D. Templates and metaprogramming might be great fun, but they can make the code hard to read and work with. They should be used only when it really is the simplest solution, and there should be comments in the code for someone that doesn't have that knowledge. This means there is lots of code duplication, and that's intentional. It is possible that I might remove some of the duplication if I can do so without making it hard to change the code.
  • Stability - only bug fixes after the 1.0 release. It should be possible to use this library ten years in the future even if I make no updates. Users can write code knowing that it will work even if I disappear. In the extremely unlikely case that a change in the language itself breaks something, see the previous item. If I decide to make major changes, I'll start a new project with a new name - something I wish other projects would do.
  • Compilation of programs with one simple line in the terminal. This reduces the need to learn new things, but there's a larger advantage. I can't guarantee stability (write code today and run it five years from now) if I rely on a build system that doesn't offer the same guarantee. Github will probably still be around in five years. The compiler will probably still compile programs the same way in five years. Gretl is heavily used and won't change the functionality I'm wrapping in the next five years.

Nongoals

  • Optimize for speed of execution.
  • Avoid the garbage collector.
  • Demonstrate the power of the D programming language.
  • Handle all use cases.
  • Adoption outside of academic research and students.
  • Non-GPL license. If for some reason the GPL bothers you, this is not the right library for you. Gretl is GPL and my code is not independent of the Gretl code. If you are selling a commercial product and do not want to release the source code under the GPL or a compatible license, don't use this library. If it's for your personal use, commercial or otherwise, the GPL lets you do whatever you want. I understand that some companies want a more freeloader-friendly license. I'm available for hire as a consultant if you want me to do related work under a different license.

Notes

  • Currently under development
  • Currently only tested on my own Ubuntu Linux setup
  • Currently testing by running a test file and looking at the output

gretlmat's People

Contributors

bachmeil avatar

Watchers

 avatar

Forkers

stellacha

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.