Examples of VPTreeSeeker


Examples of edu.mit.simile.vicino.vptree.VPTreeSeeker

        log("Building VPTree...");
        VPTreeBuilder builder = new VPTreeBuilder(d);
        VPTree tree = builder.buildVPTree(strings);
        log("..done");

        VPTreeSeeker seeker = new VPTreeSeeker(d, tree);

        log("type a string|range then hit return:");
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String line = null;
        while ((line = input.readLine()) != null) {
            int index = line.indexOf('|');
            String query = line.substring(0, index);
            float range = Float.parseFloat(line.substring(index + 1));
            long start = System.currentTimeMillis();
            Set<Serializable> results = seeker.range(query, range);
            long stop = System.currentTimeMillis();
            Iterator<Serializable> j = results.iterator();
            if (j.hasNext()) {
                while (j.hasNext()) {
                    String r = (String) j.next();
View Full Code Here

Examples of edu.mit.simile.vicino.vptree.VPTreeSeeker

    public List<Set<Serializable>> getClusters(double radius) {
        VPTree tree = _treeBuilder.buildVPTree();
        System.out.println("distances after the tree: " + _distance.getCount());
        Set<Node> nodes = _treeBuilder.getNodes();
       
        VPTreeSeeker seeker = new VPTreeSeeker(_distance,tree);
        Map<Serializable,Boolean> flags = new HashMap<Serializable,Boolean>();
        for (Node n : nodes) {
            flags.put(n.get(), true);
        }
       
        Map<Serializable,Set<Serializable>> map = new HashMap<Serializable,Set<Serializable>>();
        for (Node n : nodes) {
            Serializable s = n.get();
            if (flags.get(s)) {
                Set<Serializable> results = seeker.range(s, radius);
                for (Serializable ss : results) {
                    flags.put(ss, false);
                }
                if (results.size() > 1) {
                    map.put(s, results);
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.