Examples of SymmetricMatrix


Examples of ch.akuhn.matrix.SymmetricMatrix

    }
    public Mds(DenseMatrix dissimilarities, Points initial, 
            Function fConfigDist, Function fWeights, Function fDtarget) {
        len = dissimilarities.rowCount();
        Dtarget = dissimilarities;
        config_dist = new SymmetricMatrix(len);
        this.pos = initial == null ? new Points(len) : initial;
        this.gradient = new Points(len);
        f_config_dist = fConfigDist;
        f_weights = fWeights;
        f_dtarget = fDtarget;
View Full Code Here

Examples of ch.akuhn.matrix.SymmetricMatrix

        //double this_weight;
        //double local_weight_power = 0.;
        //double local_within_between = 1.;

        this.weights = new SymmetricMatrix(Dtarget.rowCount());
        for (int i = 0; i < Dtarget.rowCount(); i++) {
            for (int j = 0; j < i; j++) {
                this.weights.put(i,j, f_weights.apply(this.Dtarget.get(i,j)));
            }
        }
View Full Code Here

Examples of ch.akuhn.matrix.SymmetricMatrix

            constructCloserThanEpsilonNeighborhoodGraph();
        }
    }
   
    private void constructCloserThanEpsilonNeighborhoodGraph() {
        graph = new SymmetricMatrix(n);
        graph.fill(Double.POSITIVE_INFINITY);
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < i; j++) {
                if (dist(i,j) < e) graph.put(i, j, e);
            }
View Full Code Here

Examples of ch.akuhn.matrix.SymmetricMatrix

            }
        }
    }
   
    private void constructKayNearestNeighborhoodGraph() {
        graph = new SymmetricMatrix(n);
        graph.fill(Double.POSITIVE_INFINITY);
        for (int i = 0; i < n; i++) {
            double[] data = new double[n];
            for (int j = 0; j < n; j++) data[j] = dist(i,j);
            int[] index = indicesOfMinima(data, k+1);
View Full Code Here

Examples of edu.ucla.sspace.matrix.SymmetricMatrix

     * SimilarityFunction} will be used to build a symmetric adjacency matrix
     * and the {@link ClusterLink} will determine how to udpate similarities
     * between newly nerged clusters.
     */
    public Assignments cluster(Matrix m, int numClusters, Properties props) {
        Matrix adj = new SymmetricMatrix(m.rows(), m.rows());
        for (int r = 0; r < m.rows(); ++r) {
            DoubleVector v = m.getRowVector(r);
            for (int c = r+1; c < m.rows(); ++c)
                adj.set(r,c, simFunc.sim(v, m.getRowVector(c)));
        }
        return clusterAdjacencyMatrix(adj, method, numClusters);
    }
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.