WPILibC++ 2025.1.1
|
A matrix of autodiff variables. More...
Classes | |
class | const_iterator |
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 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. | |
template<typename Derived > requires std::same_as<typename Derived::Scalar, double> | |
void | SetValue (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 rowOffset, int colOffset, int blockRows, int blockCols) |
Returns a block of the variable matrix. | |
const VariableBlock< const VariableMatrix > | Block (int rowOffset, int colOffset, int blockRows, int blockCols) const |
Returns a block of the variable matrix. | |
VariableBlock< VariableMatrix > | operator() (Slice rowSlice, Slice colSlice) |
Returns a slice of the variable matrix. | |
const VariableBlock< const VariableMatrix > | operator() (Slice rowSlice, Slice colSlice) const |
Returns a slice of the variable matrix. | |
VariableBlock< VariableMatrix > | operator() (Slice rowSlice, int rowSliceLength, Slice colSlice, int colSliceLength) |
Returns a slice of the variable matrix. | |
const VariableBlock< const VariableMatrix > | operator() (Slice rowSlice, int rowSliceLength, Slice colSlice, int colSliceLength) 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 VariableMatrix &rhs) |
Compound matrix multiplication-assignment operator. | |
VariableMatrix & | operator/= (const Variable &rhs) |
Compound matrix division-assignment operator (only enabled when rhs is a scalar). | |
VariableMatrix & | operator+= (const VariableMatrix &rhs) |
Compound addition-assignment operator. | |
VariableMatrix & | operator-= (const VariableMatrix &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 number of rows in the matrix. | |
int | Cols () const |
Returns 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 | CwiseTransform (function_ref< Variable(const Variable &x)> unaryOp) 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. | |
Friends | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const VariableMatrix &lhs, const VariableMatrix &rhs) |
Matrix multiplication operator. | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const VariableMatrix &lhs, const Variable &rhs) |
Matrix-scalar multiplication operator. | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const VariableMatrix &lhs, double rhs) |
Matrix-scalar multiplication operator. | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator* (const Variable &lhs, const VariableMatrix &rhs) |
Scalar-matrix multiplication operator. | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator* (double lhs, const VariableMatrix &rhs) |
Scalar-matrix multiplication operator. | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator/ (const VariableMatrix &lhs, const Variable &rhs) |
Binary division operator (only enabled when rhs is a scalar). | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator+ (const VariableMatrix &lhs, const VariableMatrix &rhs) |
Binary addition operator. | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator- (const VariableMatrix &lhs, const VariableMatrix &rhs) |
Binary subtraction operator. | |
SLEIPNIR_DLLEXPORT VariableMatrix | operator- (const VariableMatrix &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 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.
rowOffset | The row offset of the block selection. |
colOffset | The column offset of the block selection. |
blockRows | The number of rows in the block selection. |
blockCols | The number of columns in the block selection. |
|
inline |
Returns a block of the variable matrix.
rowOffset | The row offset of the block selection. |
colOffset | The column offset of the block selection. |
blockRows | The number of rows in the block selection. |
blockCols | 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 number of columns in the matrix.
|
inline |
Transforms the matrix coefficient-wise with an unary operator.
unaryOp | 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.
row | The block row. |
|
inline |
Returns a block pointing to the given row.
row | The block row. |
|
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.
rowSlice | The row slice. |
rowSliceLength | The row slice length. |
colSlice | The column slice. |
colSliceLength | 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.
rowSlice | The row slice. |
rowSliceLength | The row slice length. |
colSlice | The column slice. |
colSliceLength | The column slice length. |
|
inline |
Returns a slice of the variable matrix.
rowSlice | The row slice. |
colSlice | The column slice. |
|
inline |
Returns a slice of the variable matrix.
rowSlice | The row slice. |
colSlice | The column slice. |
|
inline |
Compound matrix multiplication-assignment operator.
rhs | Variable to multiply. |
|
inline |
Compound addition-assignment operator.
rhs | Variable to add. |
|
inline |
Compound subtraction-assignment operator.
rhs | Variable to subtract. |
|
inline |
Compound matrix division-assignment operator (only enabled when rhs is a scalar).
rhs | Variable to divide. |
|
inline |
Assigns an Eigen matrix to a VariableMatrix.
values | Eigen matrix of values. |
|
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 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 |
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-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 |
Unary minus operator.
lhs | Operand for unary minus. |
|
friend |
Binary subtraction operator.
lhs | Operator left-hand side. |
rhs | Operator right-hand side. |
|
friend |
Binary division operator (only enabled when rhs is a scalar).
lhs | Operator left-hand side. |
rhs | Operator right-hand side. |