![]() |
WPILibC++ 2027.0.0-alpha-3
|
A matrix of autodiff variables. More...
Classes | |
| class | const_iterator |
| struct | empty_t |
| Type tag used to designate an uninitialized VariableMatrix. More... | |
| class | iterator |
Public Member Functions | |
| VariableMatrix ()=default | |
| Constructs an empty VariableMatrix. | |
| VariableMatrix (int rows) | |
| Constructs a VariableMatrix column vector with the given rows. | |
| VariableMatrix (int rows, int cols) | |
| Constructs a zero-initialized VariableMatrix with the given dimensions. | |
| VariableMatrix (empty_t, int rows, int cols) | |
| Constructs an empty VariableMatrix with the given dimensions. | |
| VariableMatrix (std::initializer_list< std::initializer_list< Variable > > list) | |
| Constructs a scalar VariableMatrix from a nested list of Variables. | |
| VariableMatrix (const std::vector< std::vector< double > > &list) | |
| Constructs a scalar VariableMatrix from a nested list of doubles. | |
| VariableMatrix (const std::vector< std::vector< Variable > > &list) | |
| Constructs a scalar VariableMatrix from a nested list of Variables. | |
| template<typename Derived > | |
| VariableMatrix (const Eigen::MatrixBase< Derived > &values) | |
| Constructs a VariableMatrix from an Eigen matrix. | |
| template<typename Derived > | |
| VariableMatrix (const Eigen::DiagonalBase< Derived > &values) | |
| Constructs a VariableMatrix from an Eigen diagonal matrix. | |
| template<typename Derived > | |
| VariableMatrix & | operator= (const Eigen::MatrixBase< Derived > &values) |
| Assigns an Eigen matrix to a VariableMatrix. | |
| VariableMatrix & | operator= (ScalarLike auto value) |
| Assigns a double to the matrix. | |
| template<typename Derived > requires std::same_as<typename Derived::Scalar, double> | |
| void | set_value (const Eigen::MatrixBase< Derived > &values) |
| Sets the VariableMatrix's internal values. | |
| VariableMatrix (const Variable &variable) | |
| Constructs a scalar VariableMatrix from a Variable. | |
| VariableMatrix (Variable &&variable) | |
| Constructs a scalar VariableMatrix from a Variable. | |
| VariableMatrix (const VariableBlock< VariableMatrix > &values) | |
| Constructs a VariableMatrix from a VariableBlock. | |
| VariableMatrix (const VariableBlock< const VariableMatrix > &values) | |
| Constructs a VariableMatrix from a VariableBlock. | |
| VariableMatrix (std::span< const Variable > values) | |
| Constructs a column vector wrapper around a Variable array. | |
| VariableMatrix (std::span< const Variable > values, int rows, int cols) | |
| Constructs a matrix wrapper around a Variable array. | |
| Variable & | operator() (int row, int col) |
| Returns a block pointing to the given row and column. | |
| const Variable & | operator() (int row, int col) const |
| Returns a block pointing to the given row and column. | |
| Variable & | operator[] (int row) |
| Returns a block pointing to the given row. | |
| const Variable & | operator[] (int row) const |
| Returns a block pointing to the given row. | |
| VariableBlock< VariableMatrix > | block (int row_offset, int col_offset, int block_rows, int block_cols) |
| Returns a block of the variable matrix. | |
| const VariableBlock< const VariableMatrix > | block (int row_offset, int col_offset, int block_rows, int block_cols) const |
| Returns a block of the variable matrix. | |
| VariableBlock< VariableMatrix > | operator() (Slice row_slice, Slice col_slice) |
| Returns a slice of the variable matrix. | |
| const VariableBlock< const VariableMatrix > | operator() (Slice row_slice, Slice col_slice) const |
| Returns a slice of the variable matrix. | |
| VariableBlock< VariableMatrix > | operator() (Slice row_slice, int row_slice_length, Slice col_slice, int col_slice_length) |
| Returns a slice of the variable matrix. | |
| const VariableBlock< const VariableMatrix > | operator() (Slice row_slice, int row_slice_length, Slice col_slice, int col_slice_length) const |
| Returns a slice of the variable matrix. | |
| VariableBlock< VariableMatrix > | segment (int offset, int length) |
| Returns a segment of the variable vector. | |
| const VariableBlock< const VariableMatrix > | segment (int offset, int length) const |
| Returns a segment of the variable vector. | |
| VariableBlock< VariableMatrix > | row (int row) |
| Returns a row slice of the variable matrix. | |
| const VariableBlock< const VariableMatrix > | row (int row) const |
| Returns a row slice of the variable matrix. | |
| VariableBlock< VariableMatrix > | col (int col) |
| Returns a column slice of the variable matrix. | |
| const VariableBlock< const VariableMatrix > | col (int col) const |
| Returns a column slice of the variable matrix. | |
| VariableMatrix & | operator*= (const MatrixLike auto &rhs) |
| Compound matrix multiplication-assignment operator. | |
| VariableMatrix & | operator*= (const ScalarLike auto &rhs) |
| Compound matrix-scalar multiplication-assignment operator. | |
| VariableMatrix & | operator/= (const ScalarLike auto &rhs) |
| Compound matrix division-assignment operator. | |
| VariableMatrix & | operator+= (const MatrixLike auto &rhs) |
| Compound addition-assignment operator. | |
| VariableMatrix & | operator+= (const ScalarLike auto &rhs) |
| Compound addition-assignment operator. | |
| VariableMatrix & | operator-= (const MatrixLike auto &rhs) |
| Compound subtraction-assignment operator. | |
| VariableMatrix & | operator-= (const ScalarLike auto &rhs) |
| Compound subtraction-assignment operator. | |
| operator Variable () const | |
| Implicit conversion operator from 1x1 VariableMatrix to Variable. | |
| VariableMatrix | T () const |
| Returns the transpose of the variable matrix. | |
| int | rows () const |
| Returns the number of rows in the matrix. | |
| int | cols () const |
| Returns the number of columns in the matrix. | |
| double | value (int row, int col) |
| Returns an element of the variable matrix. | |
| double | value (int index) |
| Returns a row of the variable column vector. | |
| Eigen::MatrixXd | value () |
| Returns the contents of the variable matrix. | |
| VariableMatrix | cwise_transform (function_ref< Variable(const Variable &x)> unary_op) const |
| Transforms the matrix coefficient-wise with an unary operator. | |
| iterator | begin () |
| Returns begin iterator. | |
| iterator | end () |
| Returns end iterator. | |
| const_iterator | begin () const |
| Returns begin iterator. | |
| const_iterator | end () const |
| Returns end iterator. | |
| const_iterator | cbegin () const |
| Returns begin iterator. | |
| const_iterator | cend () const |
| Returns end iterator. | |
| size_t | size () const |
| Returns number of elements in matrix. | |
Static Public Member Functions | |
| static VariableMatrix | zero (int rows, int cols) |
| Returns a variable matrix filled with zeroes. | |
| static VariableMatrix | ones (int rows, int cols) |
| Returns a variable matrix filled with ones. | |
Static Public Attributes | |
| static constexpr empty_t | empty {} |
| Designates an uninitialized VariableMatrix. | |
Friends | |
| template<MatrixLike LHS, MatrixLike RHS> requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS> | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const LHS &lhs, const RHS &rhs) |
| Matrix multiplication operator. | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const SleipnirMatrixLike auto &lhs, const ScalarLike auto &rhs) |
| Matrix-scalar multiplication operator. | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const MatrixLike auto &lhs, const Variable &rhs) |
| Matrix-scalar multiplication operator. | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const ScalarLike auto &lhs, const SleipnirMatrixLike auto &rhs) |
| Scalar-matrix multiplication operator. | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const Variable &lhs, const MatrixLike auto &rhs) |
| Scalar-matrix multiplication operator. | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator/ (const MatrixLike auto &lhs, const ScalarLike auto &rhs) |
| Binary division operator. | |
| template<MatrixLike LHS, MatrixLike RHS> requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS> | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator+ (const LHS &lhs, const RHS &rhs) |
| Binary addition operator. | |
| template<MatrixLike LHS, MatrixLike RHS> requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS> | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator- (const LHS &lhs, const RHS &rhs) |
| Binary subtraction operator. | |
| SLEIPNIR_DLLEXPORT VariableMatrix | operator- (const SleipnirMatrixLike auto &lhs) |
| Unary minus operator. | |
A matrix of autodiff variables.
|
default |
Constructs an empty VariableMatrix.
|
inlineexplicit |
Constructs a VariableMatrix column vector with the given rows.
| rows | The number of matrix rows. |
|
inline |
Constructs a zero-initialized VariableMatrix with the given dimensions.
| rows | The number of matrix rows. |
| cols | The number of matrix columns. |
|
inline |
Constructs an empty VariableMatrix with the given dimensions.
| rows | The number of matrix rows. |
| cols | The number of matrix columns. |
|
inline |
Constructs a scalar VariableMatrix from a nested list of Variables.
| list | The nested list of Variables. |
|
inline |
Constructs a scalar VariableMatrix from a nested list of doubles.
This overload is for Python bindings only.
| list | The nested list of Variables. |
|
inline |
Constructs a scalar VariableMatrix from a nested list of Variables.
This overload is for Python bindings only.
| list | The nested list of Variables. |
|
inline |
Constructs a VariableMatrix from an Eigen matrix.
| values | Eigen matrix of values. |
|
inline |
Constructs a VariableMatrix from an Eigen diagonal matrix.
| values | Diagonal matrix of values. |
|
inline |
Constructs a scalar VariableMatrix from a Variable.
| variable | Variable. |
|
inline |
Constructs a scalar VariableMatrix from a Variable.
| variable | Variable. |
|
inline |
Constructs a VariableMatrix from a VariableBlock.
| values | VariableBlock of values. |
|
inline |
Constructs a VariableMatrix from a VariableBlock.
| values | VariableBlock of values. |
|
inlineexplicit |
|
inline |
|
inline |
Returns begin iterator.
|
inline |
Returns begin iterator.
|
inline |
Returns a block of the variable matrix.
| row_offset | The row offset of the block selection. |
| col_offset | The column offset of the block selection. |
| block_rows | The number of rows in the block selection. |
| block_cols | The number of columns in the block selection. |
|
inline |
Returns a block of the variable matrix.
| row_offset | The row offset of the block selection. |
| col_offset | The column offset of the block selection. |
| block_rows | The number of rows in the block selection. |
| block_cols | The number of columns in the block selection. |
|
inline |
Returns begin iterator.
|
inline |
Returns end iterator.
|
inline |
Returns a column slice of the variable matrix.
| col | The column to slice. |
|
inline |
Returns a column slice of the variable matrix.
| col | The column to slice. |
|
inline |
Returns the number of columns in the matrix.
|
inline |
Transforms the matrix coefficient-wise with an unary operator.
| unary_op | The unary operator to use for the transform operation. |
|
inline |
Returns end iterator.
|
inline |
Returns end iterator.
|
inlinestatic |
Returns a variable matrix filled with ones.
| rows | The number of matrix rows. |
| cols | The number of matrix columns. |
|
inline |
Implicit conversion operator from 1x1 VariableMatrix to Variable.
|
inline |
Returns a block pointing to the given row and column.
| row | The block row. |
| col | The block column. |
|
inline |
Returns a block pointing to the given row and column.
| row | The block row. |
| col | The block column. |
|
inline |
Returns a slice of the variable matrix.
The given slices aren't adjusted. This overload is for Python bindings only.
| row_slice | The row slice. |
| row_slice_length | The row slice length. |
| col_slice | The column slice. |
| col_slice_length | The column slice length. |
|
inline |
Returns a slice of the variable matrix.
The given slices aren't adjusted. This overload is for Python bindings only.
| row_slice | The row slice. |
| row_slice_length | The row slice length. |
| col_slice | The column slice. |
| col_slice_length | The column slice length. |
|
inline |
Returns a slice of the variable matrix.
| row_slice | The row slice. |
| col_slice | The column slice. |
|
inline |
Returns a slice of the variable matrix.
| row_slice | The row slice. |
| col_slice | The column slice. |
|
inline |
Compound matrix multiplication-assignment operator.
| rhs | Variable to multiply. |
|
inline |
Compound matrix-scalar multiplication-assignment operator.
| rhs | Variable to multiply. |
|
inline |
|
inline |
|
inline |
Compound subtraction-assignment operator.
| rhs | Variable to subtract. |
|
inline |
Compound subtraction-assignment operator.
| rhs | Variable to subtract. |
|
inline |
Compound matrix division-assignment operator.
| rhs | Variable to divide. |
|
inline |
Assigns an Eigen matrix to a VariableMatrix.
| values | Eigen matrix of values. |
|
inline |
Assigns a double to the matrix.
This only works for matrices with one row and one column.
| value | Value to assign. |
|
inline |
Returns a block pointing to the given row.
| row | The block row. |
|
inline |
Returns a block pointing to the given row.
| row | The block row. |
|
inline |
Returns a row slice of the variable matrix.
| row | The row to slice. |
|
inline |
Returns a row slice of the variable matrix.
| row | The row to slice. |
|
inline |
Returns the number of rows in the matrix.
|
inline |
Returns a segment of the variable vector.
| offset | The offset of the segment. |
| length | The length of the segment. |
|
inline |
Returns a segment of the variable vector.
| offset | The offset of the segment. |
| length | The length of the segment. |
|
inline |
Sets the VariableMatrix's internal values.
| values | Eigen matrix of values. |
|
inline |
Returns number of elements in matrix.
|
inline |
Returns the transpose of the variable matrix.
|
inline |
Returns the contents of the variable matrix.
|
inline |
Returns a row of the variable column vector.
| index | The index of the element to return. |
|
inline |
Returns an element of the variable matrix.
| row | The row of the element to return. |
| col | The column of the element to return. |
|
inlinestatic |
Returns a variable matrix filled with zeroes.
| rows | The number of matrix rows. |
| cols | The number of matrix columns. |
|
friend |
Matrix multiplication operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Matrix-scalar multiplication operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Scalar-matrix multiplication operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Matrix-scalar multiplication operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Scalar-matrix multiplication operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Binary addition operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Binary subtraction operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Unary minus operator.
| lhs | Operand for unary minus. |
|
friend |
Binary division operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
staticconstexpr |
Designates an uninitialized VariableMatrix.