def test_matrix_rank(model): """ Show rank of the S-Matrix. This test will return the rank of the S-Matrix of the model. This test is not scored, as the rank depends on the S-Matrix constructed, which is system-specific. """ ann = test_matrix_rank.annotation ann["data"] = matrix.matrix_rank(model) ann["message"] = wrapper.fill("""The rank of the S-Matrix is {}.""".format( ann["data"]))
def test_matrix_rank(model): """ Show the rank of the stoichiometric matrix. The rank of the stoichiometric matrix is system specific. It is calculated using singular value decomposition (SVD). Implementation: Compose the stoichiometric matrix, then estimate the rank, i.e. the dimension of the column space, of a matrix. The algorithm used by this function is based on the singular value decomposition of the matrix. """ ann = test_matrix_rank.annotation ann["data"] = matrix.matrix_rank(model) # Report the rank scaled by the number of reactions. ann["metric"] = ann["data"] / len(model.reactions) ann["message"] = wrapper.fill( """The rank of the S-Matrix is {}.""".format(ann["data"]))
def test_matrix_rank(model, num): assert matrix.matrix_rank(model) == num