PageSourceSearch

https://pixelcraft.web.app/lib/Matrix.js

js pixelcraft.web.app collected 2026-10-03 12:32:39 UTC 815 bytes, 21 lines download raw bytes

1
2function matrixMult(a, b){
3        /*
4         * This function Multiplies two Matrices (a, b)
5         */
6        let aNumRows = a.length, aNumCols = a[0].length,
7        bNumRows = b.length, bNumCols = b[0].length,
8        m = new Array(aNumRows);  // initialize array of rows
9        for (let r = 0; r < aNumRows; ++r) {
10                 m[r] = new Array(bNumCols); // initialize the current row
11                 for (let c = 0; c < bNumCols; ++c) {
12                         m[r][c] = 0;             // initialize the current cell
13                         for (let i = 0; i < aNumCols; ++i) {
14                                m[r][c] += a[r][i] * b[i][c];
15                        }
16                }
17        }
18        return m;
19}
20
21//console.log(matrixMult([[1,2,3],[1,2,3],[1,2,3]], [[1,0,0], [0,1,0],[0,0,1]]));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.