![]() |
WPILibC++ 2027.0.0-alpha-5
|
A matrix of autodiff variables. More...
Classes | |
| class | iterator |
| class | const_iterator |
Public Types | |
| using | Scalar = Scalar_ |
| Scalar type alias. | |
| using | reverse_iterator = std::reverse_iterator<iterator> |
| using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
Public Member Functions | |
| VariableMatrix ()=default | |
| Constructs an empty VariableMatrix. | |
| VariableMatrix (int rows) | |
| Constructs a zero-initialized VariableMatrix column vector with the given rows. | |
| VariableMatrix (int rows, int cols) | |
| Constructs a zero-initialized VariableMatrix with the given dimensions. | |
| VariableMatrix (detail::empty_t, int rows, int cols) | |
| Constructs an empty VariableMatrix with the given dimensions. | |
| VariableMatrix (std::initializer_list< std::initializer_list< Variable< Scalar > > > list) | |
| Constructs a scalar VariableMatrix from a nested list of Variables. | |
| VariableMatrix (const std::vector< std::vector< Scalar > > &list) | |
| Constructs a scalar VariableMatrix from a nested list of scalars. | |
| VariableMatrix (const std::vector< std::vector< Variable< Scalar > > > &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. | |
| VariableMatrix (const Variable< Scalar > &variable) | |
| Constructs a scalar VariableMatrix from a Variable. | |
| VariableMatrix (Variable< Scalar > &&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< Scalar > > values) | |
| Constructs a column vector wrapper around a Variable array. | |
| VariableMatrix (std::span< const Variable< Scalar > > values, int rows, int cols) | |
| Constructs a matrix wrapper around a Variable array. | |
| template<typename Derived> | |
| VariableMatrix & | operator= (const Eigen::MatrixBase< Derived > &values) |
| Assigns an Eigen matrix to a VariableMatrix. | |
| VariableMatrix & | operator= (ScalarLike auto value) |
| Assigns a scalar to the matrix. | |
| template<typename Derived> requires std::same_as<typename Derived::Scalar, Scalar> | |
| void | set_value (const Eigen::MatrixBase< Derived > &values) |
| Sets the VariableMatrix's internal values. | |
| Variable< Scalar > & | operator() (int row, int col) |
| Returns the element at the given row and column. | |
| const Variable< Scalar > & | operator() (int row, int col) const |
| Returns the element at the given row and column. | |
| Variable< Scalar > & | operator[] (int index) |
| Returns the element at the given index. | |
| const Variable< Scalar > & | operator[] (int index) const |
| Returns the element at the given index. | |
| 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< Scalar > () const | |
| Implicit conversion operator from 1x1 VariableMatrix to Variable. | |
| VariableMatrix< Scalar > | 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. | |
| Scalar | value (int row, int col) |
| Returns an element of the variable matrix. | |
| Scalar | value (int index) |
| Returns an element of the variable matrix. | |
| Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > | value () |
| Returns the contents of the variable matrix. | |
| VariableMatrix< Scalar > | cwise_transform (function_ref< Variable< Scalar >(const Variable< Scalar > &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 const begin iterator. | |
| const_iterator | end () const |
| Returns const end iterator. | |
| const_iterator | cbegin () const |
| Returns const begin iterator. | |
| const_iterator | cend () const |
| Returns const end iterator. | |
| reverse_iterator | rbegin () |
| Returns reverse begin iterator. | |
| reverse_iterator | rend () |
| Returns reverse end iterator. | |
| const_reverse_iterator | rbegin () const |
| Returns const reverse begin iterator. | |
| const_reverse_iterator | rend () const |
| Returns const reverse end iterator. | |
| const_reverse_iterator | crbegin () const |
| Returns const reverse begin iterator. | |
| const_reverse_iterator | crend () const |
| Returns const reverse end iterator. | |
| size_t | size () const |
| Returns number of elements in matrix. | |
Static Public Member Functions | |
| static VariableMatrix< Scalar > | zero (int rows, int cols) |
| Returns a variable matrix filled with zeroes. | |
| static VariableMatrix< Scalar > | one (int rows, int cols) |
| Returns a variable matrix filled with ones. | |
| static VariableMatrix< Scalar > | constant (int rows, int cols, Scalar constant) |
| Returns a variable matrix filled with a constant. | |
Friends | |
| template<EigenMatrixLike LHS, SleipnirMatrixLike< Scalar > RHS> | |
| VariableMatrix< Scalar > | operator* (const LHS &lhs, const RHS &rhs) |
| Matrix multiplication operator. | |
| template<SleipnirMatrixLike< Scalar > LHS, EigenMatrixLike RHS> | |
| VariableMatrix< Scalar > | operator* (const LHS &lhs, const RHS &rhs) |
| Matrix multiplication operator. | |
| template<SleipnirMatrixLike< Scalar > LHS, SleipnirMatrixLike< Scalar > RHS> | |
| VariableMatrix< Scalar > | operator* (const LHS &lhs, const RHS &rhs) |
| Matrix multiplication operator. | |
| template<EigenMatrixLike LHS> | |
| VariableMatrix< Scalar > | operator* (const LHS &lhs, const Variable< Scalar > &rhs) |
| Matrix-scalar multiplication operator. | |
| template<SleipnirMatrixLike< Scalar > LHS, ScalarLike RHS> | |
| VariableMatrix< Scalar > | operator* (const LHS &lhs, const RHS &rhs) |
| Matrix-scalar multiplication operator. | |
| template<EigenMatrixLike RHS> | |
| VariableMatrix< Scalar > | operator* (const Variable< Scalar > &lhs, const RHS &rhs) |
| Scalar-matrix multiplication operator. | |
| template<ScalarLike LHS, SleipnirMatrixLike< Scalar > RHS> | |
| VariableMatrix< Scalar > | operator* (const LHS &lhs, const RHS &rhs) |
| Scalar-matrix multiplication operator. | |
| template<EigenMatrixLike LHS> | |
| VariableMatrix< Scalar > | operator/ (const LHS &lhs, const Variable< Scalar > &rhs) |
| Binary division operator. | |
| template<SleipnirMatrixLike< Scalar > LHS, ScalarLike RHS> requires (!SleipnirScalarLike<RHS, Scalar>) | |
| VariableMatrix< Scalar > | operator/ (const LHS &lhs, const RHS &rhs) |
| Binary division operator. | |
| template<SleipnirMatrixLike< Scalar > LHS> | |
| VariableMatrix< Scalar > | operator/ (const LHS &lhs, const Variable< Scalar > &rhs) |
| Binary division operator. | |
| template<EigenMatrixLike LHS, SleipnirMatrixLike< Scalar > RHS> | |
| VariableMatrix< Scalar > | operator+ (const LHS &lhs, const RHS &rhs) |
| Binary addition operator. | |
| template<SleipnirMatrixLike< Scalar > LHS, EigenMatrixLike RHS> | |
| VariableMatrix< Scalar > | operator+ (const LHS &lhs, const RHS &rhs) |
| Binary addition operator. | |
| template<SleipnirMatrixLike< Scalar > LHS, SleipnirMatrixLike< Scalar > RHS> | |
| VariableMatrix< Scalar > | operator+ (const LHS &lhs, const RHS &rhs) |
| Binary addition operator. | |
| template<EigenMatrixLike LHS, SleipnirMatrixLike< Scalar > RHS> | |
| VariableMatrix< Scalar > | operator- (const LHS &lhs, const RHS &rhs) |
| Binary subtraction operator. | |
| template<SleipnirMatrixLike< Scalar > LHS, EigenMatrixLike RHS> | |
| VariableMatrix< Scalar > | operator- (const LHS &lhs, const RHS &rhs) |
| Binary subtraction operator. | |
| template<SleipnirMatrixLike< Scalar > LHS, SleipnirMatrixLike< Scalar > RHS> | |
| VariableMatrix< Scalar > | operator- (const LHS &lhs, const RHS &rhs) |
| Binary subtraction operator. | |
| VariableMatrix< Scalar > | operator- (const SleipnirMatrixLike< Scalar > auto &lhs) |
| Unary minus operator. | |
A matrix of autodiff variables.
| Scalar_ | Scalar type. |
| using slp::VariableMatrix< Scalar_ >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
| using slp::VariableMatrix< Scalar_ >::reverse_iterator = std::reverse_iterator<iterator> |
| using slp::VariableMatrix< Scalar_ >::Scalar = Scalar_ |
Scalar type alias.
|
default |
Constructs an empty VariableMatrix.
|
inlineexplicit |
Constructs a zero-initialized 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 scalars.
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 const 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 const begin iterator.
|
inline |
Returns const 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.
|
inlinestatic |
Returns a variable matrix filled with a constant.
| rows | The number of matrix rows. |
| cols | The number of matrix columns. |
| constant | The constant. |
|
inline |
Returns const reverse begin iterator.
|
inline |
Returns const reverse end iterator.
|
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 const 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 the element at the given row and column.
| row | The row. |
| col | The column. |
|
inline |
Returns the element at the given row and column.
| row | The row. |
| col | The 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 scalar to the matrix.
This only works for matrices with one row and one column.
| value | Value to assign. |
|
inline |
Returns the element at the given index.
| index | The index. |
|
inline |
Returns the element at the given index.
| index | The index. |
|
inline |
Returns reverse begin iterator.
|
inline |
Returns const reverse begin iterator.
|
inline |
Returns reverse end iterator.
|
inline |
Returns const reverse end iterator.
|
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 an element of the variable matrix.
| 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 |
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 |
Matrix multiplication operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Matrix multiplication operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
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 |
Binary addition 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 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 |
Binary subtraction 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. |
|
friend |
Binary division operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |
|
friend |
Binary division operator.
| lhs | Operator left-hand side. |
| rhs | Operator right-hand side. |