MCPcopy Create free account
hub / github.com/Jack-Lee-Hiter/AlgorithmsByPython / matrixTrans

Function matrixTrans

Target Offer/transSparseMatrix.py:35–40  ·  view source on GitHub ↗
(matrix)

Source from the content-addressed store, hash-verified

33 return outMatrix
34
35def matrixTrans(matrix):
36 m, n = shape(matrix)
37 triple = sparseToTriple(matrix)
38 transedTriple = transTriple(triple)
39 transedMatrix = tripleToSparse(transedTriple, m, n)
40 return transedMatrix
41
42matrix = [[0, 0, 0, 0, 0, 0, 6, 0, 0],
43 [0, 0, 2, 0, 0, 1, 0, 0, 0],

Callers 1

Calls 3

transTripleFunction · 0.85
sparseToTripleFunction · 0.70
tripleToSparseFunction · 0.70

Tested by

no test coverage detected