MCPcopy
hub / github.com/trekhleb/javascript-algorithms / recWalk

Function recWalk

src/algorithms/math/matrix/Matrix.js:188–199  ·  view source on GitHub ↗
(recM, cellIndices)

Source from the content-addressed store, hash-verified

186 * @return {Matrix}
187 */
188 const recWalk = (recM, cellIndices) => {
189 const recMShape = shape(recM);
190
191 if (recMShape.length === 1) {
192 for (let i = 0; i < recM.length; i += 1) {
193 visit([...cellIndices, i], recM[i]);
194 }
195 }
196 for (let i = 0; i < recM.length; i += 1) {
197 recWalk(recM[i], [...cellIndices, i]);
198 }
199 };
200
201 recWalk(m, []);
202};

Callers 1

walkFunction · 0.85

Calls 1

shapeFunction · 0.85

Tested by

no test coverage detected