proteindf_bridge.matrix module

class proteindf_bridge.matrix.Matrix(*args, **kwargs)[source]

Bases: object

>>> a = Matrix()
>>> a.rows
1
>>> a.cols
1
>>> B = Matrix(3, 5)
>>> B.rows
3
>>> B.cols
5
>>> B.set(0, 1, 1.0)
>>> math.fabs(B.get(0, 1) - 1.0) < 1.0E-5
True
>>> C = Matrix([[7, 4, -1], [3, 0, 5]])
>>> math.fabs(C.get(0, 1) - 4.0) < 1.0E-5
True
>>> D = Matrix([[8, 4, 2], [1, 3, -6], [-7, 0, 5]])
>>> CD = C * D
>>> (CD == Matrix([[67, 40, -15], [-11, 12, 31]]))
True
add(row, col, value)[source]
clear()[source]
property cols
copy()[source]
property data

return numpy array

get(row, col)[source]
get_buffer()[source]
get_col_vector(col)[source]
get_ndarray()[source]

return numpy.ndarray object

get_raw_data()[source]
get_row_vector(row)[source]
get_symmetric_matrix()[source]
inverse()[source]
max()[source]
min()[source]
pseudo_inverse()[source]
resize(new_rows, new_cols)[source]
property rows
select(start_row, start_col, end_row, end_col)[source]

select matrix sub-block

set(row, col, value)[source]
set_buffer(b)[source]
transpose()[source]
property type
class proteindf_bridge.matrix.SymmetricMatrix(*args, **kwargs)[source]

Bases: Matrix

>>> A = SymmetricMatrix()
>>> A.rows
1
>>> A.cols
1
>>> B = SymmetricMatrix(5)
>>> B.rows
5
>>> B.cols
5
>>> B.set(0, 1, 1.0)
>>> B.get(0, 1)
1.0
>>> B.get(1, 0)
1.0
property dim
eig()[source]

return the eigenvalues and eigenvectors.

get(row, col)[source]
get_general_matrix()[source]
get_raw_data()[source]
resize(new_dim)[source]
set(row, col, value)[source]
proteindf_bridge.matrix.identity_matrix(dim)[source]