Package org.apache.mahout.math.matrix.impl

Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix2D.rows()


            }
        }

        // Convert stemsToInclude into tdMatrixStemIndices
        final IntIntOpenHashMap stemToRowIndex = new IntIntOpenHashMap();
        for (int i = 0; i < stemWeightOrder.length && i < tdMatrix.rows(); i++)
        {
            stemToRowIndex.put(stemsToInclude[stemWeightOrder[i]], i);
        }

        // Store the results
View Full Code Here


            // Assign documents to the nearest centroid
            for (int c = 0; c < similarities.columns(); c++)
            {
                int maxRow = 0;
                double max = similarities.get(0, c);
                for (int r = 1; r < similarities.rows(); r++)
                {
                    if (max < similarities.get(r, c))
                    {
                        max = similarities.get(r, c);
                        maxRow = r;
View Full Code Here

    }

    private static DenseDoubleMatrix2D toColtMatrix(Matrix m)
    {
        DenseDoubleMatrix2D result = new DenseDoubleMatrix2D(m.rowSize(), m.columnSize());
        for (int r = 0; r < result.rows(); r++)
        {
            for (int c = 0; c < result.columns(); c++)
            {
                result.setQuick(r, c, m.getQuick(r, c));
            }           
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.