UserManual | (Japanese)
matrix module provides matrices.
A factory function to create an instance of RingMatrix, RingSquareMatrix, FieldMatrix or FieldSquareMatrix.
Your input determines the class automatically by examining the matrix size and the coefficient ring.
row and column must be interger, and coeff_ring must be an instance of ring.Ring.
compo must be one of these forms below.
matrix.createMatrix(3, 2, [1,2]+[3,4]+[5,6])
matrix.createMatrix(3, 2, [[1,2], [3,4], [5,6]])
matrix.createMatrix(3, 2, [(1,3,5), (2,4,6)])
matrix.createMatrix(3, 2, [vector.Vector([1,3,5]), vector.Vector([2,4,6])])The examples above represent the same matrix form as follows:
1 2 3 4 5 6
If you abbreviate compo, it will be deemed to all zero list.
Ex.
>>> print matrix.createMatrix(3, [1,2,3]+[4,5,6]+[7,8,9]) 1 2 3 4 5 6 7 8 9
return unit matrix of size. coeff enables us to create matrix not in integer but in coefficient ring which is determined by coeff. coeff must be an instance of ring.Ring or a multiplication unit(one).
return zero matrix whose row is row and column is column. coeff enables us to create matrix not in integer but in coefficient ring which is determined by coeff. coeff must be an instance of ring.Ring or an addition unit(zero).