chore: incremental port

This commit is contained in:
cha0s 2019-09-08 03:20:34 -05:00
parent 1f7763e715
commit a9c1274aa8

View File

@ -4,9 +4,9 @@
// matrix is implemented as an n-element array. Data is stored in row-major
// order.
export copy = (matrix) => matrix.map((row) => [...row])
export const copy = (matrix) => matrix.map((row) => [...row])
export equals = (l, r) ->
export const equals = (l, r) =>
return false unless l.length is r.length
return true if l.length is 0
@ -20,12 +20,12 @@ export equals = (l, r) ->
return true
export size = (matrix) ->
export const size = (matrix) =>
return 0 if 0 is matrix.length
return matrix.length * matrix[0].length
export sizeVector = (matrix) ->
export const sizeVector = (matrix) =>
return [0, 0] if 0 is matrix.length
return [matrix[0].length, matrix.length]