Package edu.wpi.first.math
Class MatBuilder<R extends Num,C extends Num>
java.lang.Object
edu.wpi.first.math.MatBuilder<R,C>
- Type Parameters:
R
- The number of rows of the desired matrix.C
- The number of columns of the desired matrix.
public class MatBuilder<R extends Num,C extends Num> extends Object
A class for constructing arbitrary RxC matrices.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MatBuilder(Nat<R> rows, Nat<C> cols)
Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and Type Method Description Matrix<R,C>
fill(double... data)
Fills the matrix with the given data, encoded in row major form.static <R extends Num, C extends Num>
Matrix<R,C>fill(Nat<R> rows, Nat<C> cols, double... data)
Fills the matrix with the given data, encoded in row major form.
-
Field Details
-
Constructor Details
-
MatBuilder
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newMatBuilder
with the given dimensions.- Parameters:
rows
- The number of rows of the matrix.cols
- The number of columns of the matrix.
-
-
Method Details
-
fill
public static final <R extends Num, C extends Num> Matrix<R,C> fill(Nat<R> rows, Nat<C> cols, double... data)Fills the matrix with the given data, encoded in row major form. (The matrix is filled row by row, left to right with the given data).- Type Parameters:
R
- The number of rows of the matrix.C
- The number of columns of the matrix.- Parameters:
rows
- The number of rows of the matrix.cols
- The number of columns of the matrix.data
- The data to fill the matrix with.- Returns:
- The constructed matrix.
-
fill
Fills the matrix with the given data, encoded in row major form. (The matrix is filled row by row, left to right with the given data).- Parameters:
data
- The data to fill the matrix with.- Returns:
- The constructed matrix.
-