Returns the rank of the matrix
3579
function() {
            	var M = this.toRightTriangular(), rank = 0;
            	var i = this.elements.length, nj = this.elements[0].length, j;
            	while (i--) {
            	    j = nj;
            	    while (j--) {
            		if (Math.abs(M.elements[i][j]) > sylvester.precision) { rank++; break; }
            	    }
            	}
            	return rank;
                }
1246469
def get_matrix(self):
        
        matrix = Matrix()
        cairo.cairo_pattern_get_matrix(self._pointer, matrix._pointer)
        self._check_status()
        return matrix
1116937
def compute_ranks(x):
    
    assert x.ndim == 1
    ranks = np.empty(len(x), dtype=int)
    ranks[x.argsort()] = np.arange(len(x))
    return ranks
25719
def at_rank(self, rank):
        
        s = self
        while s:
            if s.rank == rank:
                return s
            s = s.parent
        raise ValueError("No node at rank {0} for {1}".format(
            rank, self.tax_id))
104479
def rank(self, score):
        ''''''
        node = self.__head
        rank = 0
        for i in range(self.__level-1, -1, -1):
            while node.next[i] and node.next[i].score <= score:
                rank += node.width[i]
                node = node.next[i]
        if node.score == score:
            return rank - 1
        else:
            return -1 - rank
1350799
public Matrix getS () {
		Matrix X = new Matrix(n,n);
		double[][] S = X.getArray();
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				S[i][j] = 0.0;
			}
			S[i][i] = this.s[i];
		}
		return X;
	}
450396
def real(self):
        """"""
        return matrix(self.tt.real(), n=self.n, m=self.m)
435176
public SimpleMatrix getR() {
        SimpleMatrix R = new SimpleMatrix(QR.numRows(),QR.numCols());

        int N = Math.min(QR.numCols(),QR.numRows());

        for( int i = 0; i < N; i++ ) {
            for( int j = i; j < QR.numCols(); j++ ) {
                R.set(i,j, QR.get(i,j));
            }
        }

        return R;
    }
1268446
public Matrix getP() {
        Matrix P = new DenseMatrix(jpvt.length, jpvt.length);
        for (int i = 0; i < jpvt.length; i++) {
            P.set(jpvt[i], i, 1);
        }
        return P;
    }
632825
public DenseMatrix range() {
        if (!full) {
            throw new IllegalStateException("This is not a FULL singular value decomposition.");
        }

        int nr = 0;
        DenseMatrix rnge = Matrix.zeros(m, rank());
        for (int j = 0; j < n; j++) {
            if (s[j] > tol) {
                for (int i = 0; i < m; i++) {
                    rnge.set(i, nr, U.get(i, j));
                }
                nr++;
            }
        }
        return rnge;
    }
1114887
def get_matrix(self):
        """"""
        matrix = Matrix()
        cairo.cairo_get_matrix(self._pointer, matrix._pointer)
        self._check_status()
        return matrix
206597
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;
}
957328
public Matrix getD () {
      Matrix X = MatrixFactory.createMatrix(n,n);
      for (int i = 0; i < n; i++) {
         X.set(i,i,d[i]);
         if (e[i] > 0) {
				X.set(i,i+1,e[i]);
         } else if (e[i] < 0) {
				X.set(i,i-1,e[i]);
         }
      }
      return X;
   }
1295667
public static double[] pagerank(Matrix A) {
        int n = A.nrows();
        double[] v = new double[n];
        Arrays.fill(v, 1.0 / n);
        return pagerank(A, v);
    }
599517
public AbstractMatrix transpose()
    {
        int m = rows();
        int n = columns();
        AbstractMatrix tr = getInstance(n, m, cls);
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
            {
                Array.set(tr.array, M.at(j, i), Array.get(array, M.at(i, j)));
            }
        }
        return tr;
    }
879773
def getMatrix(self):
        
        if self.mflag:
            m0 = 9.10938215e-31
            e0 = 1.602176487e-19
            c0 = 299792458.0
            rho = np.sqrt(self.gamma ** 2 - 1) * m0 * c0 / self.bend_field / e0
            theta = np.arcsin(self.bend_length / rho)
            self.bangle = theta

            m_rb_1 = transRbend(theta, rho, self.gamma, -1)
            m_rb_2 = transRbend(-theta, -rho, self.gamma, 1)
            m_rb_3 = transRbend(-theta, -rho, self.gamma, -1)
            m_rb_4 = transRbend(theta, rho, self.gamma, 1)
            m_df_12 = transDrift(self.dflist[0], self.gamma)
            m_df_23 = transDrift(self.dflist[1], self.gamma)
            m_df_34 = transDrift(self.dflist[2], self.gamma)

            self.transM = reduce(np.dot, [m_rb_1, m_df_12, m_rb_2, m_df_23, m_rb_3, m_df_34, m_rb_4])

            return self.transM
602274
def ranked_attributes(self):
        
        matrix = javabridge.call(self.jobject, "rankedAttributes", "()[[D")
        if matrix is None:
            return None
        else:
            return typeconv.double_matrix_to_ndarray(matrix)