[wpimath] Make LTV controller constructors use faster DARE solver (#5543)

Made JNI modifications to expose the faster function, made the API use
the typesafe Matrix API, and synchronized the documentation with C++.

Sped up C++ LTV diff drive test from 20 ms to 15 ms.
Sped up C++ LTV unicycle test from 15 ms to 10 ms.
This commit is contained in:
Tyler Veness
2023-08-17 13:56:15 -07:00
committed by GitHub
parent 6953a303b3
commit 0cf6e37dc1
9 changed files with 596 additions and 220 deletions

View File

@@ -38,6 +38,18 @@ public class Matrix<R extends Num, C extends Num> {
Objects.requireNonNull(rows).getNum(), Objects.requireNonNull(columns).getNum());
}
/**
* Constructs a new {@link Matrix} with the given storage. Caller should make sure that the
* provided generic bounds match the shape of the provided {@link Matrix}.
*
* @param rows The number of rows of the matrix.
* @param columns The number of columns of the matrix.
* @param storage The double array to back this value.
*/
public Matrix(Nat<R> rows, Nat<C> columns, double[] storage) {
this.m_storage = new SimpleMatrix(rows.getNum(), columns.getNum(), true, storage);
}
/**
* Constructs a new {@link Matrix} with the given storage. Caller should make sure that the
* provided generic bounds match the shape of the provided {@link Matrix}.