Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions lib/util/matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -1316,33 +1316,43 @@ export default class Matrix {
return r
}

/**
* Returns a matrix reduced along all element with the callback function.
* @overload
* @param {function (T, T, number[], Matrix<T>): T} cb Reducing function
* @param {undefined | null} [init] Initial value
* @returns {T} Reduced value
*/
/**
* Returns a matrix reduced along all element with the callback function.
* @template U
* @overload
* @param {function (U, T, number[], Matrix<T>): U} cb Reducing function
* @param {U} [init] Initial value
* @param {U} init Initial value
* @returns {U} Reduced value
*/
/**
* Returns a matrix reduced along the axis with the callback function.
* @template U
* @template {number | number[]} A
* @template {boolean} F
* @overload
* @param {function (U, T, number[], Matrix<T>): U} cb Reducing function
* @param {U} init Initial value
* @param {0 | 1} axis Axis to be reduced
* @param {boolean} [keepdims] Keep dimensions or not. If null, negative axis retuns number and other axis returns Matrix.
* @returns {Matrix<U>} Reduced matrix
* @param {function (T, T, number[], Matrix<T>): T} cb Reducing function
* @param {undefined | null} init Initial value
* @param {A} axis Axis to be reduced
* @param {F} [keepdims] Keep dimensions or not. If null, negative axis retuns number and other axis returns Matrix.
* @returns {Matrix<T> | (A extends 0 | 1 ? never : F extends true ? never : T)} Reduced matrix
*/
/**
* Returns a matrix reduced along the axis with the callback function.
* @template U
* @template {number | number[]} A
* @template {boolean} F
* @overload
* @param {function (U, T, number[], Matrix<T>): U} cb Reducing function
* @param {U} init Initial value
* @param {number | number[]} axis Axis to be reduced. If negative, reduce along all elements.
* @param {boolean} [keepdims] Keep dimensions or not. If null, negative axis retuns number and other axis returns Matrix.
* @returns {Matrix<U> | U} Reduced matrix or value
* @param {A} axis Axis to be reduced
* @param {F} [keepdims] Keep dimensions or not. If null, negative axis retuns number and other axis returns Matrix.
* @returns {Matrix<U> | (A extends 0 | 1 ? never : F extends true ? never : U)} Reduced matrix
*/
/**
* @template U
Expand Down
Loading