code: function rank(A, tol) {
      var S = svd(A, false, false)[0];
      if (tol === undefined) {
          tol = common_1.EPSILON; // TODO : use numpy's formula
      }
      var rank = 0;
      for (var _i = 0, _a = S.toArray(); _i < _a.length; _i++) {
          var n = _a[_i];
          if (n > tol) {
              rank++;
          }
      }
      return rank;
  }
docs: Rank of a matrix is defined by number of singular values of the matrix that
  are non-zero (within given tolerance)
  @param A Matrix to determine rank of
  @param tol Tolerance for zero-check of singular values