(triple, m, n)
| 23 | return multiMatrix |
| 24 | |
| 25 | def 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 | |
| 34 | def matrixMultiple(matrixA, matrixB): |
| 35 | mA, nA = shape(matrixA) |