Package edu.ucla.sspace.util.primitive

Examples of edu.ucla.sspace.util.primitive.IntPair


        // ||x - y||^2, which is the square of the distance between the two
        // points.  However, since we use the simiarlity (which is conceptually
        // the inverse of distance), we use the inverse similarity so that
        // elements that are more similarity (i.e., larger values) have smaller
        // probabilities.
  IntPair firstTwoCenters =
            pickFirstTwo(dataPoints, simFunc, weights, inverseSimilarities);
        selected.add(firstTwoCenters.x);
        selected.add(firstTwoCenters.y);

        // For the remaining k-2 points to select, pick a random point, x, with
View Full Code Here


            sim1 = invertSim(sim1);
            double sim2 = simFunc.sim(v, z); // center 2
            sim2 = invertSim(sim2);
            inverseSimilarities[i] = Math.min(sim1, sim2);
        }
        return new IntPair(c1, c2);
    }
View Full Code Here

                        System.out.println("Bad graph? : " + g);
                        throw npe;
                    }
                    int size = edges.size();
                    if (size > 0)
                        connected.add(new IntPair(i, j));
                    if (size > 1)
                        isSimpleAlready = false;
                }
            }
            // If the subgraph was already a simple graph, then just append it
View Full Code Here

    private Collection<Multigraph<T,E>> enumerateSimpleGraphs(
            Multigraph<T,E> input, List<IntPair> connected,
            int curPair, Multigraph<T,E> toCopy) {
       
        List<Multigraph<T,E>> simpleGraphs = new LinkedList<Multigraph<T,E>>();
        IntPair p = connected.get(curPair);
        // Get the set of edges between the current vertex pair
        Set<E> edges = input.getEdges(p.x, p.y);
        // Pick one of the edges and generate a graph from the remaining pairs
        for (E e : edges) {
            // Make a copy of the input graph and add this edge to the graph
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.util.primitive.IntPair

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.