No description
Find a file
2024-01-05 08:50:51 +09:00
.github/workflows fix: conflict between arduino pin defines and template parameters 2024-01-04 13:27:08 +09:00
ArduinoEigen fix: conflict between arduino pin defines and template parameters 2024-01-04 13:27:08 +09:00
examples update examples 2021-10-11 17:36:57 +09:00
.gitignore Initial commit 2018-03-10 19:35:06 +09:00
ArduinoEigen.h change library structure 2021-10-11 17:36:44 +09:00
ArduinoEigenDense.h change library structure 2021-10-11 17:36:44 +09:00
ArduinoEigenSparse.h change library structure 2021-10-11 17:36:44 +09:00
COPYING.MPL2 add copying 2021-10-11 16:18:05 +09:00
COPYING.README add copying 2021-10-11 16:18:05 +09:00
library.json chore: update version to v0.3.2 2024-01-05 08:50:14 +09:00
library.properties chore: update version to v0.3.2 2024-01-05 08:50:14 +09:00
LICENSE Initial commit 2018-03-10 19:35:06 +09:00
README.md feat: add library dependencies 2023-10-04 07:46:35 +09:00

ArduinoEigen

Eigen (a C++ template library for linear algebra) for Arduino

Eigen Version

  • Eigen v3.4.0

Usage

By using this library, Eigen can be used directly with Arduino. Please refer following official documents for the details of Eigen.

A simple first program

#include <ArduinoEigen.h>

using Eigen::MatrixXd;

void setup() {
    MatrixXd m(2, 2);
    m(0, 0) = 3;
    m(1, 0) = 2.5;
    m(0, 1) = -1;
    m(1, 1) = m(1, 0) + m(0, 1);
}

Matrices and vectors (dynamic)

#include <ArduinoEigenDense.h>

using namespace Eigen;

void setup() {
    MatrixXd m = MatrixXd::Random(3, 3);
    m = (m + MatrixXd::Constant(3, 3, 1.2)) * 50;

    VectorXd v(3);
    v << 1, 2, 3;

    VectorXd vo = m * v;
}

Matrices and vectors (static)

#include <ArduinoEigenDense.h>

using namespace Eigen;

void setup() {
    Matrix3d m = Matrix3d::Random();
    m = (m + Matrix3d::Constant(1.2)) * 50;

    Vector3d v(1, 2, 3);
    Vector3d vo = m * v;
}

Additional Features

Pseudo Inverse by SVD decomposition

MatrixXd Jacobi {3, 4};
MatrixXd Jacobi_pinv {4, 3};

Jacobi <<
    1, 2, 3, 4,
    5, 6, 7, 8,
    9, 10, 11, 12;

Jacobi_pinv = Eigen::pseudoInverse(Jacobi);

Note

This library does NOT support following boards because they don't have standard libraries.

  • AVR (Uno, Nano, Mega, etc.)
  • MEGAAVR (Uno WiFi, Nano Every, etc.)
  • SAM (Due)

For such boards, consider using EigenArduino.

Dependent Libraries

License

MPL-2.0