-
Notifications
You must be signed in to change notification settings - Fork 15
/
MatrixMath.h
36 lines (32 loc) · 1.02 KB
/
MatrixMath.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* MatrixMath.h Library for Matrix Math
*
* Created by Charlie Matlack on 12/18/10.
* Modified from code by RobH45345 on Arduino Forums, algorithm from
* NUMERICAL RECIPES: The Art of Scientific Computing.
* Modified to work with Arduino 1.0/1.5 by randomvibe & robtillaart
* Made into a real library on GitHub by Vasilis Georgitzikis (tzikis)
* so that it's easy to use and install (March 2015)
*/
#ifndef MatrixMath_h
#define MatrixMath_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
class MatrixMath
{
public:
//MatrixMath();
void Print(float* A, int m, int n, String label);
void Copy(float* A, int n, int m, float* B);
void Multiply(float* A, float* B, int m, int p, int n, float* C);
void Add(float* A, float* B, int m, int n, float* C);
void Subtract(float* A, float* B, int m, int n, float* C);
void Transpose(float* A, int m, int n, float* C);
void Scale(float* A, int m, int n, float k);
int Invert(float* A, int n);
};
extern MatrixMath Matrix;
#endif