UNPKG

@rayyamhk/matrix

Version:

A professional, comprehensive and high-performance library for you to manipulate matrices.

24 lines (21 loc) 461 B
"use strict"; /** * Calculates the nullity of any Matrix, which is the dimension * of the nullspace.<br><br> * * The nullity is cached. * @memberof Matrix * @instance * @returns {number} The nullity of the matrix */ function nullity() { if (this._nullity !== undefined) { return this._nullity; } var col = this.size()[1]; var rank = this.rank(); this._nullity = col - rank; return this._nullity; } ; module.exports = nullity;