nzmath.matrix | (Japanese)

Matrix

The class is for matrix.

Initialize

Matrix(row, column [, compo, coeff_ring])

This constructor determines the class automatically like createMatrix.

Attribute

row

The row size of the matrix.

column

The column size of the matrix.

coeff_ring

The coefficient ring of the matrix.

Methods

map(function)

Return the matrix whose elements is applied function to. (new in 0.90.0)

reduce(function [,initializer])

Apply function from upper-left to lower-right, so as to reduce the iterable to a single value.(new in 0.90.0)

copy()

create a copy of self (other instance).

set(compo)

setRow(m, arg)

setColumn(n, arg)

getRow(i)

getColumn(j)

swapRow(m1, m2)

swapColumn(n1, n2)

insertRow(i, arg)

insertColumn(j, arg)

extendRow(arg)

extendColumn(arg)

deleteRow(i)

deleteColumn(j)

transpose()

Return the transpose of the matrix.

getBlock(i, j, row [,column])

Return the row * column block matrix from the (i, j)-element. (new in 0.90.0)

subMatrix(I[, J])

Return submatrix deleted I-th row and J-th column. If I and J is a sequence, return the submatrix composed of the rows and the colums assigned by I and J, respectively.

Operators

operatorexplanation
M == NReturn whether M and N are equal or not.
M != NReturn whether M and N are different or not.
M[i, j]Return the coefficient of i-th row, j-th column term of matrix M.
M[i]Return the vector of i-th column term of matrix M.
M[i, j] = cReplace the coefficient of i-th row, j-th column term of matrix M by c.
M[j] = cReplace the vector of i-th column term of matrix M by vector c.
c in MCheck whether some element of M equals c.
repr(M)Return the repr string of the matrix M.
string represents list concatenated row vector lists.
str(M)Return the str string of the matrix M.