Giter Club home page Giter Club logo

matrixmathint's Introduction

MatrixMathInt

Fork of https://github.com/codebendercc/MatrixMath

It is the same but for work with integers.

FEATURES

Briefly, the functions provided by MatrixMath:

void MatrixPrint(int* A, int m, int n, String label);
void MatrixCopy(int* A, int n, int m, int* B);
void MatrixMult(int* A, int* B, int m, int p, int n, int* C);
void MatrixAdd(int* A, int* B, int m, int n, int* C);
void MatrixSubtract(int* A, int* B, int m, int n, int* C);
void MatrixTranspose(int* A, int m, int n, int* C);
int MatrixInvert(int* A, int n);

Matrices should be stored in row-major arrays, which is fairly standard. The user must keep track of array dimensions and send them to the functions; mistakes on dimensions will not be caught by the library.

It's worth pointing out that the MatrixInvert() function uses Gauss-Jordan elimination with partial pivoting. Partial pivoting is a compromise between a numerically unstable algorithm and full pivoting, which involves more searching and swapping matrix elements.

Also, the inversion algorithm stores the result matrix on top of the the input matrix, meaning no extra memory is allocated during inversion but your original matrix is gone.

HOW TO IMPORT/INSTALL

Grab the source code below, and put in a folder called MatrixMathInt. [Apparently recent Playground changes have killed the zip file. Please edit this if there is a preferred way of making the source available.

Put the MatrixMathInt folder in "libraries".

Edit: clone this repo at https://github.com/buckbaskin/MatrixMath.git into your libraries\ folder

In the Arduino IDE, create a new sketch (or open one) and

select from the menubar "Sketch->Import Library->MatrixMathInt".

Once the library is imported, a "#include MatrixMathInt.h" line will appear at the top of your Sketch.

The MatrixMathDemo in the Examples folder demonstrates multiplication and inversion using the MatrixPrint() function to show results.

matrixmathint's People

Contributors

ceritium avatar

Watchers

James Cloos avatar  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.