mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[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:
@@ -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}.
|
||||
|
||||
Reference in New Issue
Block a user