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

Function tripleToSparse

Target Offer/multiSparse.py:25–32  ·  view source on GitHub ↗
(triple, m, n)

Source from the content-addressed store, hash-verified

23 return multiMatrix
24
25def tripleToSparse(triple, m, n):
26 outMatrix = zeros([m, n])
27 for pointTuple in triple:
28 mLocation = pointTuple[0]
29 nLocation = pointTuple[1]
30 value = pointTuple[2]
31 outMatrix[mLocation][nLocation] = value
32 return outMatrix
33
34def matrixMultiple(matrixA, matrixB):
35 mA, nA = shape(matrixA)

Callers 1

matrixMultipleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected