Package edu.ucla.sspace.vector

Examples of edu.ucla.sspace.vector.ScaledSparseDoubleVector


    public void addPreference(String relation,
                              SparseDoubleVector vector,
                              double frequency) {

        add(relation, new ScaledSparseDoubleVector(vector, frequency),
            selPreferences);
    }
View Full Code Here


    }

    public void addInversePreference(String relation,
                                     SparseDoubleVector vector,
                                     double frequency) {
        add(relation, new ScaledSparseDoubleVector(vector, frequency),
            inverseSelPreferences);
    }
View Full Code Here

            List<SparseDoubleVector> scaledVectors =
                new ArrayList<SparseDoubleVector>(matrix.rows());
            SparseMatrix sm = (SparseMatrix) matrix;
            for (int r = 0; r < matrix.rows(); ++r) {
                SparseDoubleVector v = sm.getRowVector(r);
                scaledVectors.add(new ScaledSparseDoubleVector(
                            v, 1/v.magnitude()));
            }
            return Matrices.asSparseMatrix(scaledVectors);
        } else {
            List<DoubleVector> scaledVectors =
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public SparseDoubleVector getRowVector(int row) {
        return new ScaledSparseDoubleVector(
                m.getRowVector(row), scales.get(row));
    }
View Full Code Here

        }

        // Scale any non empty clusters by their size.
        for (int c = 0; c < numClusters; ++c)
            if (counts[c] != 0)
                centroids[c] = new ScaledSparseDoubleVector(
                        centroids[c],1d/counts[c]);

        return centroids;
    }
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.vector.ScaledSparseDoubleVector

Copyright © 2018 www.massapicom. 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.