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

Function multiTriple

Target Offer/multiSparse.py:15–23  ·  view source on GitHub ↗
(tripleA, tripleB)

Source from the content-addressed store, hash-verified

13 return triple
14
15def multiTriple(tripleA, tripleB):
16 rowA = shape(tripleA)[0]
17 rowB = shape(tripleB)[0]
18 multiMatrix = []
19 for i in range(rowA):
20 for j in range(rowB):
21 if tripleA[i][1] == tripleB[j][0]:
22 multiMatrix.append([tripleA[i][0], tripleB[j][1], tripleA[i][2]*tripleB[j][2]])
23 return multiMatrix
24
25def tripleToSparse(triple, m, n):
26 outMatrix = zeros([m, n])

Callers 1

matrixMultipleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected