symforce.geo.matrix module#
- class Matrix(*args, **kwargs)[source]#
Bases:
Storage
Matrix type that wraps the SymPy Matrix class. Care has been taken to allow this class to create fixed-size child classes like
Matrix31
. Anytime__new__()
is called, the appropriate fixed size class is returned rather than the type of the arguments. The API is meant to parallel the way Eigen’s C++ matrix classes work with dynamic and fixed sizes, as well as internal use cases within SymPy and SymEngine.Examples:
1) Matrix32() # Zero constructed Matrix32 2) Matrix(sm.Matrix([[1, 2], [3, 4]])) # Matrix22 with [1, 2, 3, 4] data 3A) Matrix([[1, 2], [3, 4]]) # Matrix22 with [1, 2, 3, 4] data 3B) Matrix22([1, 2, 3, 4]) # Matrix22 with [1, 2, 3, 4] data (must matched fixed shape) 3C) Matrix([1, 2, 3, 4]) # Matrix41 with [1, 2, 3, 4] data - column vector assumed 4) Matrix(4, 3) # Zero constructed Matrix43 5) Matrix(2, 2, [1, 2, 3, 4]) # Matrix22 with [1, 2, 3, 4] data (first two are shape) 6) Matrix(2, 2, lambda row, col: row + col) # Matrix22 with [0, 1, 1, 2] data 7) Matrix22(1, 2, 3, 4) # Matrix22 with [1, 2, 3, 4] data (must match fixed length)
References
https://docs.sympy.org/latest/tutorial/matrices.html https://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html https://en.wikipedia.org/wiki/Vector_space
Matrix does not implement the group or lie group concepts using instance/class methods directly, because we want it to represent the group R^{NxM}, not GL(n), which leads to the
identity
andinverse
methods being confusingly named. For the group ops and lie group ops, usesymforce.ops.group_ops.GroupOps
andsymforce.ops.lie_group_ops.LieGroupOps
respectively, which use the implementation insymforce.ops.impl.vector_class_lie_group_ops
of the R^{NxM} group under matrix addition. For the identity matrix and inverse matrix, seeMatrix.eye()
andMatrix.inv()
respectively.- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- MatrixT = ~MatrixT#
- SHAPE = (-1, -1)#
- static __new__(cls, *args, **kwargs)[source]#
Beast of a method for creating a Matrix. Handles a variety of construction use cases and always returns a fixed size child class of Matrix rather than Matrix itself. The available construction options depend on whether cls is a fixed size type or not. See the Matrix docstring for a summary of the construction options.
- classmethod from_storage(vec)[source]#
Construct from a flat list representation. Opposite of
to_storage()
.- Parameters:
vec (_T.Union[_T.Sequence[_T.Scalar], Matrix]) –
- Return type:
MatrixT
- to_storage()[source]#
Flat list representation of the underlying storage, length of
storage_dim()
. This is used purely for plumbing, it is NOT like a tangent space.
- classmethod from_tangent(vec, epsilon=0.0)[source]#
- Parameters:
vec (_T.Sequence[_T.Scalar]) –
epsilon (_T.Scalar) –
- Return type:
MatrixT
- classmethod diag(diagonal)[source]#
Construct a square matrix from the diagonal.
- Parameters:
diagonal (_T.Sequence[_T.Scalar]) –
- Return type:
MatrixT
- classmethod eye(rows=None, cols=None)[source]#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- inv(method='LU')[source]#
Inverse of the matrix.
- Parameters:
self (MatrixT) –
method (str) –
- Return type:
MatrixT
- classmethod block_matrix(array)[source]#
Constructs a matrix from block elements.
For example:
[[Matrix22(...), Matrix23(...)], [Matrix11(...), Matrix14(...)]]
constructs a
Matrix35
with elements equal to given blocks
- simplify(*args, **kwargs)[source]#
Simplify this expression.
This overrides the sympy implementation because that clobbers the class type.
- limit(*args, **kwargs)[source]#
Take the limit at z = z0
This overrides the sympy implementation because that clobbers the class type.
- jacobian(X, tangent_space=True)[source]#
Compute the jacobian with respect to the tangent space of X if
tangent_space = True
, otherwise returns the jacobian wih respect to the storage elements of X.
- lower_triangle()[source]#
Returns the lower triangle (including diagonal) of self
self must be square
- Parameters:
self (MatrixT) –
- Return type:
MatrixT
- symmetric_copy(upper_or_lower)[source]#
Returns a symmetric copy of self by copying the lower or upper triangle to the opposite triangle.
- Parameters:
upper_or_lower (Triangle) – The triangle to copy to the opposite triangle
self (MatrixT) –
- Return type:
MatrixT
- dot(other)[source]#
Dot product, also known as inner product.
Only supports mapping
1 x n
orn x 1
Matrices to scalars. Note that both matrices must have the same shape.
- cross(other)[source]#
Cross product.
- Parameters:
self (MatrixT) –
other (MatrixT) –
- Return type:
Vector3
- squared_norm()[source]#
Squared norm of a vector, equivalent to the dot product with itself.
- Return type:
- normalized(epsilon=0.0)[source]#
Returns a unit vector in this direction (divide by norm).
- Parameters:
self (MatrixT) –
epsilon (_T.Scalar) –
- Return type:
MatrixT
- clamp_norm(max_norm, epsilon=0.0)[source]#
Clamp a vector to the given norm in a safe/differentiable way.
Is NOT safe if max_norm can be negative, or if derivatives are needed w.r.t. max_norm and max_norm can be 0 or small enough that
max_squared_norm / squared_norm
is truncated to 0 in the particular floating point type being used (e.g. all of these are true ifmax_norm
is optimized).Currently only L2 norm is supported
- Parameters:
self (MatrixT) –
max_norm (_T.Scalar) –
epsilon (_T.Scalar) –
- Return type:
MatrixT
- multiply_elementwise(rhs)[source]#
Do the elementwise multiplication between self and rhs, and return the result as a new
Matrix
- Parameters:
self (MatrixT) –
rhs (MatrixT) –
- Return type:
MatrixT
- applyfunc(func)[source]#
Apply a unary operation to every scalar.
- Parameters:
self (MatrixT) –
func (_T.Callable) –
- Return type:
MatrixT
- __getitem__(item)[source]#
Get a scalar value or submatrix slice.
Unlike sympy, for 1D matrices the submatrix slice is returned as a 1D matrix instead of as a list.
- __add__(right)[source]#
Add a scalar or matrix to this matrix.
- Parameters:
self (MatrixT) –
right (_T.Union[_T.Scalar, MatrixT]) –
- Return type:
MatrixT
- __sub__(right)[source]#
Subtract a scalar or matrix from this matrix.
- Parameters:
self (MatrixT) –
right (_T.Union[_T.Scalar, MatrixT]) –
- Return type:
MatrixT
- __truediv__(right)#
Divide a matrix by a scalar or a matrix (which takes the inverse).
- static are_parallel(a, b, tolerance)[source]#
Returns 1 if a and b are parallel within tolerance, and 0 otherwise.
- class Matrix11(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 1)#
- class Matrix21(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 1)#
- class Matrix31(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 1)#
- class Matrix41(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 1)#
- class Matrix51(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 1)#
- class Matrix61(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 1)#
- class Matrix71(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 1)#
- class Matrix81(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 1)#
- class Matrix91(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 1)#
- class Matrix12(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 2)#
- class Matrix22(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 2)#
- class Matrix32(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 2)#
- class Matrix42(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 2)#
- class Matrix52(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 2)#
- class Matrix62(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 2)#
- class Matrix72(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 2)#
- class Matrix82(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 2)#
- class Matrix92(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 2)#
- class Matrix13(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 3)#
- class Matrix23(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 3)#
- class Matrix33(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 3)#
- class Matrix43(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 3)#
- class Matrix53(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 3)#
- class Matrix63(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 3)#
- class Matrix73(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 3)#
- class Matrix83(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 3)#
- class Matrix93(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 3)#
- class Matrix14(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 4)#
- class Matrix24(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 4)#
- class Matrix34(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 4)#
- class Matrix44(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 4)#
- class Matrix54(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 4)#
- class Matrix64(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 4)#
- class Matrix74(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 4)#
- class Matrix84(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 4)#
- class Matrix94(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 4)#
- class Matrix15(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 5)#
- class Matrix25(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 5)#
- class Matrix35(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 5)#
- class Matrix45(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 5)#
- class Matrix55(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 5)#
- class Matrix65(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 5)#
- class Matrix75(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 5)#
- class Matrix85(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 5)#
- class Matrix95(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 5)#
- class Matrix16(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 6)#
- class Matrix26(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 6)#
- class Matrix36(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 6)#
- class Matrix46(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 6)#
- class Matrix56(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 6)#
- class Matrix66(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 6)#
- class Matrix76(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 6)#
- class Matrix86(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 6)#
- class Matrix96(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 6)#
- class Matrix17(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 7)#
- class Matrix27(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 7)#
- class Matrix37(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 7)#
- class Matrix47(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 7)#
- class Matrix57(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 7)#
- class Matrix67(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 7)#
- class Matrix77(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 7)#
- class Matrix87(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 7)#
- class Matrix97(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 7)#
- class Matrix18(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 8)#
- class Matrix28(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 8)#
- class Matrix38(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 8)#
- class Matrix48(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 8)#
- class Matrix58(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 8)#
- class Matrix68(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 8)#
- class Matrix78(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 8)#
- class Matrix88(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 8)#
- class Matrix98(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 8)#
- class Matrix19(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (1, 9)#
- class Matrix29(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (2, 9)#
- class Matrix39(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (3, 9)#
- class Matrix49(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (4, 9)#
- class Matrix59(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (5, 9)#
- class Matrix69(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (6, 9)#
- class Matrix79(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (7, 9)#
- class Matrix89(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (8, 9)#
- class Matrix99(*args, **kwargs)[source]#
Bases:
Matrix
- Parameters:
args (_T.Any) –
kwargs (_T.Any) –
- Return type:
- SHAPE = (9, 9)#
- matrix_type_from_shape(shape)[source]#
Return a fixed size matrix type (like
Matrix32
) given a shapeEither uses the statically defined ones or dynamically creates a new one if not available.
- I1(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I11(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I2(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I22(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I3(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I33(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I4(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I44(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I5(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I55(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I6(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I66(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I7(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I77(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I8(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I88(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I9(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.
- I99(rows=None, cols=None)#
Construct an identity matrix
If neither rows nor cols is provided, this must be called as a class method on a fixed-size class.
If rows is provided, returns a square identity matrix of shape (rows x rows).
If rows and cols are provided, returns a (rows x cols) matrix, with ones on the diagonal.