GithubHelp home page GithubHelp logo

madrury / linalg Goto Github PK

View Code? Open in Web Editor NEW
45.0 2.0 11.0 86 KB

A linear algebra library in C. For fun.

C 99.18% Makefile 0.20% Objective-C 0.19% C++ 0.43%
linear-algebra matrix-factorization

linalg's Introduction

linalg: Linear Algebra and Regression in C

linalg is a library for linear algebra and regression implemented in C. The code is optimized for readability and clarity instead of raw efficiency (though it tries not to ignore issues of efficiency completely).

Linear Algebra

linalg contains two datatypes in its core linear algebra engine, vector and matrix:

  • vector is a (one dimensional) vector of real numbers (C doubles). The underlying data is stored as a C array, and so occupies contiguous memory locations in the computer's memory.
  • matrix is a (two dimensional) matrix of real numbers (C doubles). The underlying data is stored in row-major order, so each row occupies contiguous memory locations in the computer's memory.

To complement these data types, linalg contains many functions for performing linear algebraic operations. For example

  • matrix_vector_multiply computes the product vector of a matrix and vector.
  • matrix_multiply computes the product matrix of two matrices.
  • matrix_multiply_MtN computes the product of the transpose of one matrix with another.

Linear equations can be solved using linsolve_qr, which adopts a strategy of computing the QR matrix factorization of the left hand side. To access the underlying matrix factorization, use qr_decomp.

Regression

linalg also includes functions for regression. Use linreg_fit to fit a linear regression given a design matrix X and a response vector y.

Tests

The routines in linalg are extensively unit tested, which also serve as simple examples of use.

linalg's People

Contributors

madrury avatar pat-oreilly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

linalg's Issues

License

Could you clarify the license?

Implement a VECTOR_IDX_INTO.

There are a lot of DATA(v)[i] littered around, this can be abstracted.

This also adds symmetry with the matrix implementation.

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.