![]() |
Sleipnir Python API
|
Public Member Functions | |
| None | __init__ (self) |
| None | __init__ (self, int rows) |
| None | __init__ (self, int rows, int cols) |
| None | __init__ (self, Sequence[Sequence[Real|float]] list) |
| None | __init__ (self, Sequence[Sequence[float]] list) |
| None | __init__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] values) |
| None | __init__ (self, Annotated[NDArray[numpy.float32], dict(shape=(None, None))] values) |
| None | __init__ (self, Real|float variable) |
| None | __init__ (self, Submatrix values) |
| None | __init__ (self, Submatrix arg) |
| None | set_value (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] values) |
| None | set_value (self, Annotated[NDArray[numpy.float32], dict(shape=(None, None))] values) |
| None | set_value (self, Annotated[NDArray[numpy.int64], dict(shape=(None, None))] values) |
| None | set_value (self, Annotated[NDArray[numpy.int32], dict(shape=(None, None))] values) |
| Real | __setitem__ (self, int row, Real|float value) |
| None | __setitem__ (self, tuple[int|slice, int|slice] slices, object value) |
| Real | __getitem__ (self, int row) |
| Real | __getitem__ (self, tuple[int, int] slices) |
| Submatrix | __getitem__ (self, tuple[int|slice, int|slice] slices) |
| Submatrix | row (self, int row) |
| Submatrix | col (self, int col) |
| Matrix | __mul__ (self, Matrix rhs) |
| Matrix | __mul__ (self, Submatrix rhs) |
| Matrix | __mul__ (self, Real|float rhs) |
| Matrix | __matmul__ (self, Matrix rhs) |
| Matrix | __matmul__ (self, Submatrix rhs) |
| Matrix | __matmul__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] rhs) |
| Matrix | __rmul__ (self, Submatrix lhs) |
| Matrix | __rmul__ (self, Real|float lhs) |
| Matrix | __rmatmul__ (self, Submatrix lhs) |
| Matrix | __rmatmul__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] lhs) |
| object | __array_ufunc__ (self, object ufunc, str method, *object inputs, **object kwargs) |
| Matrix | __add__ (self, Matrix rhs) |
| Real | __add__ (self, float rhs) |
| Real | __add__ (self, int rhs) |
| Real | __add__ (self, Real rhs) |
| Matrix | __add__ (self, Submatrix rhs) |
| Matrix | __add__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] rhs) |
| Matrix | __sub__ (self, Matrix rhs) |
| Real | __sub__ (self, float rhs) |
| Real | __sub__ (self, int rhs) |
| Real | __sub__ (self, Real rhs) |
| Matrix | __sub__ (self, Submatrix rhs) |
| Matrix | __sub__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] rhs) |
| Matrix | __neg__ (self) |
| Matrix | __truediv__ (self, Real|float rhs) |
| Matrix | __itruediv__ (self, Real|float rhs) |
| Real | __radd__ (self, float lhs) |
| Real | __radd__ (self, int lhs) |
| Real | __radd__ (self, Real lhs) |
| Matrix | __radd__ (self, Submatrix lhs) |
| Matrix | __radd__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] lhs) |
| Real | __rsub__ (self, float lhs) |
| Real | __rsub__ (self, int lhs) |
| Real | __rsub__ (self, Real lhs) |
| Matrix | __rsub__ (self, Submatrix lhs) |
| Matrix | __rsub__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] lhs) |
| Matrix | __pow__ (self, int power) |
| Matrix | T (self) |
| int | rows (self) |
| int | cols (self) |
| tuple | shape (self) |
| float | value (self, int row, int col) |
| float | value (self, int index) |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None), order='F')] | value (self) |
| Matrix | cwise_map (self, Callable[[Real], Real] func) |
| Matrix | exp (self) |
| EqualityConstraints | __eq__ (self, Matrix rhs) |
| EqualityConstraints | __eq__ (self, float rhs) |
| EqualityConstraints | __eq__ (self, float rhs) |
| EqualityConstraints | __eq__ (self, int rhs) |
| EqualityConstraints | __eq__ (self, int rhs) |
| EqualityConstraints | __eq__ (self, Real rhs) |
| EqualityConstraints | __eq__ (self, Real rhs) |
| EqualityConstraints | __eq__ (self, Submatrix rhs) |
| EqualityConstraints | __eq__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] rhs) |
| InequalityConstraints | __lt__ (self, Matrix rhs) |
| InequalityConstraints | __lt__ (self, float rhs) |
| InequalityConstraints | __lt__ (self, float rhs) |
| InequalityConstraints | __lt__ (self, int rhs) |
| InequalityConstraints | __lt__ (self, int rhs) |
| InequalityConstraints | __lt__ (self, Real rhs) |
| InequalityConstraints | __lt__ (self, Real rhs) |
| InequalityConstraints | __lt__ (self, Submatrix rhs) |
| InequalityConstraints | __lt__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] rhs) |
| InequalityConstraints | __le__ (self, Matrix rhs) |
| InequalityConstraints | __le__ (self, float rhs) |
| InequalityConstraints | __le__ (self, float rhs) |
| InequalityConstraints | __le__ (self, int rhs) |
| InequalityConstraints | __le__ (self, int rhs) |
| InequalityConstraints | __le__ (self, Real rhs) |
| InequalityConstraints | __le__ (self, Real rhs) |
| InequalityConstraints | __le__ (self, Submatrix rhs) |
| InequalityConstraints | __le__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] rhs) |
| InequalityConstraints | __gt__ (self, Matrix rhs) |
| InequalityConstraints | __gt__ (self, float rhs) |
| InequalityConstraints | __gt__ (self, float rhs) |
| InequalityConstraints | __gt__ (self, int rhs) |
| InequalityConstraints | __gt__ (self, int rhs) |
| InequalityConstraints | __gt__ (self, Real rhs) |
| InequalityConstraints | __gt__ (self, Real rhs) |
| InequalityConstraints | __gt__ (self, Submatrix rhs) |
| InequalityConstraints | __gt__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] rhs) |
| InequalityConstraints | __ge__ (self, Matrix rhs) |
| InequalityConstraints | __ge__ (self, float rhs) |
| InequalityConstraints | __ge__ (self, float rhs) |
| InequalityConstraints | __ge__ (self, int rhs) |
| InequalityConstraints | __ge__ (self, int rhs) |
| InequalityConstraints | __ge__ (self, Real rhs) |
| InequalityConstraints | __ge__ (self, Real rhs) |
| InequalityConstraints | __ge__ (self, Submatrix rhs) |
| InequalityConstraints | __ge__ (self, Annotated[NDArray[numpy.float64], dict(shape=(None, None))] rhs) |
| int | __len__ (self) |
| Iterator[Real] | __iter__ (self) |
Static Public Member Functions | |
| Matrix | identity (int rows) |
| Matrix | zero (int rows, int cols) |
| Matrix | one (int rows, int cols) |
| Matrix | constant (int rows, int cols, float constant) |
A matrix of autodiff expressions.
Template Args:
Scalar_: Scalar type.
| None sleipnir.autodiff.Matrix.__init__ | ( | self | ) |
Constructs an empty Matrix.
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| int | rows | ||
| ) |
Constructs a zero-initialized Matrix column vector with the given
rows.
Args:
rows: The number of matrix rows.
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| int | rows, | ||
| int | cols | ||
| ) |
Constructs a zero-initialized Matrix with the given dimensions.
Args:
rows: The number of matrix rows.
cols: The number of matrix columns.
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| Sequence[Sequence[Real | float]] | list | ||
| ) |
Constructs a scalar Matrix from a nested list of Reals.
Args:
list: The nested list of Reals.
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| Sequence[Sequence[float]] | list | ||
| ) |
Constructs a scalar Matrix from a nested list of scalars.
This overload is for Python bindings only.
Args:
list: The nested list of Reals.
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | values | ||
| ) |
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| Annotated[NDArray[numpy.float32], dict(shape=(None, None))] | values | ||
| ) |
Constructs a Matrix from an Eigen matrix.
Args:
values: Eigen matrix of values.
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| Real | float | variable | ||
| ) |
Constructs a scalar Matrix from a Real.
Args:
variable: Real.
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| Submatrix | values | ||
| ) |
Constructs a Matrix from a Submatrix.
Args:
values: Submatrix of values.
| None sleipnir.autodiff.Matrix.__init__ | ( | self, | |
| Submatrix | arg | ||
| ) |
| Matrix sleipnir.autodiff.Matrix.__add__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | rhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__add__ | ( | self, | |
| float | rhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__add__ | ( | self, | |
| int | rhs | ||
| ) |
| object sleipnir.autodiff.Matrix.__array_ufunc__ | ( | self, | |
| object | ufunc, | ||
| str | method, | ||
| *object | inputs, | ||
| **object | kwargs | ||
| ) |
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | rhs | ||
| ) |
Equality operator that returns an equality constraint for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| float | rhs | ||
| ) |
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| float | rhs | ||
| ) |
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| int | rhs | ||
| ) |
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| int | rhs | ||
| ) |
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| Matrix | rhs | ||
| ) |
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| Real | rhs | ||
| ) |
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| Real | rhs | ||
| ) |
| EqualityConstraints sleipnir.autodiff.Matrix.__eq__ | ( | self, | |
| Submatrix | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | rhs | ||
| ) |
Greater-than-or-equal-to comparison operator that returns an
inequality constraint for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| float | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| float | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| int | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| int | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| Matrix | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| Real | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| Real | rhs | ||
| ) |
Less-than-or-equal-to comparison operator that returns an inequality
constraint for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| InequalityConstraints sleipnir.autodiff.Matrix.__ge__ | ( | self, | |
| Submatrix | rhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__getitem__ | ( | self, | |
| int | row | ||
| ) |
Returns the element at the given index.
Args:
index: The index.
Returns:
The element at the given index.
| Real sleipnir.autodiff.Matrix.__getitem__ | ( | self, | |
| tuple[int, int] | slices | ||
| ) |
| Submatrix sleipnir.autodiff.Matrix.__getitem__ | ( | self, | |
| tuple[int | slice, int | slice] | slices | ||
| ) |
Returns the element at the given row and column.
Args:
row: The row.
col: The column.
Returns:
The element at the given row and column.
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | rhs | ||
| ) |
Greater-than comparison operator that returns an inequality constraint
for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| float | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| float | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| int | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| int | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| Matrix | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| Real | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| Real | rhs | ||
| ) |
Less-than comparison operator that returns an inequality constraint
for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| InequalityConstraints sleipnir.autodiff.Matrix.__gt__ | ( | self, | |
| Submatrix | rhs | ||
| ) |
| Iterator[Real] sleipnir.autodiff.Matrix.__iter__ | ( | self | ) |
Compound matrix division-assignment operator.
Args:
rhs: Real to divide.
Returns:
Result of division.
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | rhs | ||
| ) |
Less-than-or-equal-to comparison operator that returns an inequality
constraint for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| float | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| float | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| int | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| int | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| Matrix | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| Real | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| Real | rhs | ||
| ) |
Greater-than-or-equal-to comparison operator that returns an
inequality constraint for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| InequalityConstraints sleipnir.autodiff.Matrix.__le__ | ( | self, | |
| Submatrix | rhs | ||
| ) |
| int sleipnir.autodiff.Matrix.__len__ | ( | self | ) |
Returns the number of rows in the matrix.
Returns:
The number of rows in the matrix.
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | rhs | ||
| ) |
Less-than comparison operator that returns an inequality constraint
for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| float | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| float | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| int | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| int | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| Matrix | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| Real | rhs | ||
| ) |
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| Real | rhs | ||
| ) |
Greater-than comparison operator that returns an inequality constraint
for two Reals.
Args:
lhs: Left-hand side.
rhs: Left-hand side.
| InequalityConstraints sleipnir.autodiff.Matrix.__lt__ | ( | self, | |
| Submatrix | rhs | ||
| ) |
| Matrix sleipnir.autodiff.Matrix.__matmul__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | rhs | ||
| ) |
| Matrix sleipnir.autodiff.Matrix.__neg__ | ( | self | ) |
| Matrix sleipnir.autodiff.Matrix.__pow__ | ( | self, | |
| int | power | ||
| ) |
| Matrix sleipnir.autodiff.Matrix.__radd__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | lhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__radd__ | ( | self, | |
| float | lhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__radd__ | ( | self, | |
| int | lhs | ||
| ) |
| Matrix sleipnir.autodiff.Matrix.__rmatmul__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | lhs | ||
| ) |
| Matrix sleipnir.autodiff.Matrix.__rsub__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | lhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__rsub__ | ( | self, | |
| float | lhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__rsub__ | ( | self, | |
| int | lhs | ||
| ) |
| None sleipnir.autodiff.Matrix.__setitem__ | ( | self, | |
| tuple[int | slice, int | slice] | slices, | ||
| object | value | ||
| ) |
| Matrix sleipnir.autodiff.Matrix.__sub__ | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | rhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__sub__ | ( | self, | |
| float | rhs | ||
| ) |
| Real sleipnir.autodiff.Matrix.__sub__ | ( | self, | |
| int | rhs | ||
| ) |
| Submatrix sleipnir.autodiff.Matrix.col | ( | self, | |
| int | col | ||
| ) |
Returns a column slice of the variable matrix.
Args:
col: The column to slice.
Returns:
A column slice of the variable matrix.
| int sleipnir.autodiff.Matrix.cols | ( | self | ) |
Returns the number of columns in the matrix.
Returns:
The number of columns in the matrix.
|
static |
Returns a variable matrix filled with a constant.
Args:
rows: The number of matrix rows.
cols: The number of matrix columns.
constant: The constant.
Returns:
A variable matrix filled with a constant.
Transforms the matrix coefficient-wise with an unary operator.
Args:
unary_op: The unary operator to use for the transform operation.
Returns:
Result of the unary operator.
| Matrix sleipnir.autodiff.Matrix.exp | ( | self | ) |
Returns the matrix exponential.
Returns:
The matrix exponential.
|
static |
Returns an identity variable matrix.
Args:
rows: The number of matrix rows.
Returns:
An identity variable matrix.
|
static |
Returns a variable matrix filled with ones.
Args:
rows: The number of matrix rows.
cols: The number of matrix columns.
Returns:
A variable matrix filled with ones.
| Submatrix sleipnir.autodiff.Matrix.row | ( | self, | |
| int | row | ||
| ) |
Returns a row slice of the variable matrix.
Args:
row: The row to slice.
Returns:
A row slice of the variable matrix.
| int sleipnir.autodiff.Matrix.rows | ( | self | ) |
Returns the number of rows in the matrix.
Returns:
The number of rows in the matrix.
| None sleipnir.autodiff.Matrix.set_value | ( | self, | |
| Annotated[NDArray[numpy.float32], dict(shape=(None, None))] | values | ||
| ) |
| None sleipnir.autodiff.Matrix.set_value | ( | self, | |
| Annotated[NDArray[numpy.float64], dict(shape=(None, None))] | values | ||
| ) |
| None sleipnir.autodiff.Matrix.set_value | ( | self, | |
| Annotated[NDArray[numpy.int32], dict(shape=(None, None))] | values | ||
| ) |
Sets the Matrix's internal values.
Args:
values: Eigen matrix of values.
| None sleipnir.autodiff.Matrix.set_value | ( | self, | |
| Annotated[NDArray[numpy.int64], dict(shape=(None, None))] | values | ||
| ) |
| tuple sleipnir.autodiff.Matrix.shape | ( | self | ) |
| Matrix sleipnir.autodiff.Matrix.T | ( | self | ) |
Returns the transpose of the variable matrix.
Returns:
The transpose of the variable matrix.
| Annotated[NDArray[numpy.float64], dict(shape=(None, None), order='F')] sleipnir.autodiff.Matrix.value | ( | self | ) |
Returns the contents of the variable matrix.
Returns:
The contents of the variable matrix.
| float sleipnir.autodiff.Matrix.value | ( | self, | |
| int | index | ||
| ) |
Returns an element of the variable matrix.
Args:
index: The index of the element to return.
Returns:
An element of the variable matrix.
| float sleipnir.autodiff.Matrix.value | ( | self, | |
| int | row, | ||
| int | col | ||
| ) |
Returns an element of the variable matrix.
Args:
row: The row of the element to return.
col: The column of the element to return.
Returns:
An element of the variable matrix.
|
static |
Returns a variable matrix filled with zeros.
Args:
rows: The number of matrix rows.
cols: The number of matrix columns.
Returns:
A variable matrix filled with zeros.