mathjs/lib/function/algebra/sparse/sparse_marked.js
Rogelio J. Baucells 9ab61740e7 sparse algorithms
2015-04-22 23:15:04 -04:00

24 lines
478 B
JavaScript

'use strict';
function factory () {
/**
* Checks if the node at w[j] is marked
*
* @param {Array} w The array
* @param {Number} j The array index
*
* Reference: http://faculty.cse.tamu.edu/davis/publications.html
*/
var sparse_marked = function (w, j) {
// check node is marked
return w[j] < 0;
};
return sparse_marked;
}
exports.name = 'sparse_marked';
exports.path = 'sparse';
exports.factory = factory;