@vect/matrix-indicator
Advanced tools
Comparing version 0.2.9 to 0.2.10-alpha.0
@@ -8,4 +8,4 @@ 'use strict'; | ||
const max = function (matrix) { | ||
let fn = this; | ||
return matrix.reduce((prv, r, i) => comparer.max(prv, r.reduce((acc, x, j) => comparer.max(acc, fn(x, i, j)))), fn(matrix[0][0], 0, 0)); | ||
let indicator = this; | ||
return matrix.reduce((prevVal, currRow, i) => comparer.max(prevVal, currRow.reduce((a, b, j) => comparer.max(a, indicator(b, i, j)))), indicator(matrix[0][0], 0, 0)); | ||
}; | ||
@@ -12,0 +12,0 @@ const maxBy = (matrix, indicator) => max.call(indicator, matrix); |
import { max as max$1, min as min$1 } from '@aryth/comparer'; | ||
const max = function (matrix) { | ||
let fn = this; | ||
return matrix.reduce((prv, r, i) => max$1(prv, r.reduce((acc, x, j) => max$1(acc, fn(x, i, j)))), fn(matrix[0][0], 0, 0)); | ||
let indicator = this; | ||
return matrix.reduce((prevVal, currRow, i) => max$1(prevVal, currRow.reduce((a, b, j) => max$1(a, indicator(b, i, j)))), indicator(matrix[0][0], 0, 0)); | ||
}; | ||
@@ -7,0 +7,0 @@ const maxBy = (matrix, indicator) => max.call(indicator, matrix); |
{ | ||
"name": "@vect/matrix-indicator", | ||
"version": "0.2.9", | ||
"version": "0.2.10-alpha.0", | ||
"description": "Indicators for matrix", | ||
@@ -38,3 +38,3 @@ "main": "dist/index.cjs.js", | ||
"homepage": "https://github.com/hoyeungw/vect#readme", | ||
"gitHead": "d1911a29fc0916f90c791b9a763bf1bec11c4eb1" | ||
"gitHead": "eee0c345ff093b93debd1ed926eefe4a85b4cf66" | ||
} |
5395