points.matrices¶
Contains the Matrix class.

class
points.matrices.
Matrix
(*rows, columns=False)[source]¶ A Matrix is a rectangular array of numbers. They are created from iterables, which will be interpeted as rows unless specified otherwise.
They can be added and subtracted from each other, and multiplied by a scalar using the * operator. To multiply a Matrix with another Matrix, use
@
.Parameters: args (iter) – The rows of the Matrix. Each row must be iterable.
Raises:  ValueError – if you create an empty matrix.
 TypeError – if you mix Vectors with other iterables.
 TypeError – if you give non iterables.
 ValueError – if you give rows of different lengths.

static
identity
()[source]¶ Creates an identity matrix.
Parameters: dimensions (int) – the size of the identity matrix to create. Raises: TypeError – if noninteger dimension is given. Return type: Matrix

transposed
()[source]¶ Returns a transposed version of the matrix. The matrix calling the method is unaffected.
Return type: Matrix

minor
(i, j)[source]¶ Returns the first minor of the value at the position specified.
Parameters:  i (int) – The row to use.
 j (int) – The column to use.
Raises: ValueError – if a nonsquare matrix is given.
Return type: float

cofactor
(i, j)[source]¶ Returns the cofactor of the value at the position specified.
Parameters:  i (int) – The row to use.
 j (int) – The column to use.
Raises: ValueError – if a nonsquare matrix is given.
Return type: float

minors
()[source]¶ Returns the matrix of minors for this matrix.
Raises: ValueError – if a nonsquare matrix is given. Return type: Matrix

cofactors
()[source]¶ Returns the matrix of cofactors for this matrix.
Raises: ValueError – if a nonsquare matrix is given. Return type: Matrix

determinant
()[source]¶ Returns the determinant of the matrix  the matrix must be square for this to happen.
The Laplace expansion is used to calculate matrices of three dimensions and above.
Raises: ValueError – if a nonsquare matrix is given. Return type: float

adjoint
()[source]¶ Returns the adjoint matrix of this matrix.
Raises: ValueError – if a nonsquare matrix is given. Return type: Matrix

inverse
()[source]¶ Returns the inverse matrix of this matrix.
Raises: ValueError – if the matrix is not invertible. Return type: Matrix

column_space
()[source]¶ Returns the column space of matrix  the set of vectors reachable by its column vectors.
Return type: VectorSpan

is_full_rank
()[source]¶ Checks if the matrix is full rank  that is, whether its rank equals the number of dimensions of its column space.
Return type: bool