Package cern.colt.map

Examples of cern.colt.map.OpenIntObjectHashMap


    {
        for (int h = 0; h < hss.size(); h++)
        {
            IHyperStructure hs = (IHyperStructure) hss.get(h);
           
            OpenIntObjectHashMap tierVertices = (OpenIntObjectHashMap) hs.getTiers().get(tierIndex);
           
            IVertex tierVertex = (IVertex) tierVertices.get(vertexTierKey);
           
            ICompactTripletsStructure clone = (ICompactTripletsStructure)
                    ((ICompactTripletsStructure) structures.get(h)).clone();
           
            clone.intersect(tierVertex.getCTS());
View Full Code Here


    public static ObjectArrayList findNonEmptyIntersections(IHyperStructure hs, IVertex vertex)
    {
        ObjectArrayList result = new ObjectArrayList();
        for (int j = 0; j < hs.getTiers().size(); j++)
        {
            OpenIntObjectHashMap tierVertices = (OpenIntObjectHashMap) hs.getTiers().get(j);
            for (int i = 0; i < tierVertices.size(); i++)
            {
                IVertex tierVertex = (IVertex) tierVertices.values().get(i);
                ICompactTripletsStructure clone = ((ICompactTripletsStructure) tierVertex.getCTS().clone());
                clone.intersect(vertex.getCTS());
                if (!clone.isEmpty())
                {
                    result.add(tierVertex);
View Full Code Here

               
                ITripletValue tripletValue = SimpleTripletValueFactory.getTripletValue(tripletString);
               
                if (hs.getTiers().size() == j)
                {
                    hs.getTiers().add(new OpenIntObjectHashMap(8));
                }
                OpenIntObjectHashMap tier = (OpenIntObjectHashMap) hs.getTiers().get(j);
               
                LOGGER.debug("Load CTS from {}...", substructurePath);
                ITabularFormula substructure = loadFromFile(hssPath + File.separator + substructurePath);
                LOGGER.debug("CTS loaded");
               
                SimpleVertex vertex = new SimpleVertex(basicCTS.getTier(j), j, tripletValue, (ICompactTripletsStructure) substructure);
                vertex.setHyperStructure(hs);
               
                boolean bottom1empty = Boolean.parseBoolean((String) verticesInfo.get(substructurePath + "-bottom1empty"));
                boolean bottom2empty = Boolean.parseBoolean((String) verticesInfo.get(substructurePath + "-bottom2empty"));
               
                if (bottom1empty) vertex.foundEmptyEdge(EdgeKind.Bottom1);
                if (bottom2empty) vertex.foundEmptyEdge(EdgeKind.Bottom2);
               
                tier.put(tripletValue.getTierKey(), vertex);
            }
        }
       
        LOGGER.info("HSS loaded");
       
View Full Code Here

           
            Properties verticesInfo = new Properties();
           
            for (int j = 0; j < hs.getTiers().size(); j++)
            {
                OpenIntObjectHashMap tier = (OpenIntObjectHashMap) hs.getTiers().get(j);
                for (int i = 0; i < tier.size(); i++)
                {
                    int key = tier.keys().get(i);
                    IVertex vertex = (IVertex) tier.get(key);
                    ITripletValue triplet = SimpleTripletValueFactory.getTripletValue(key);
                   
                    String vertexFilename = "hss-" + leadingZeros(h, hssLength)
                                            + "-tier-" + leadingZeros(j, tiersLength)
                                            + "-" + triplet + ".cnf";
View Full Code Here

            {
                if (basicCTS.getTier(0).size() > 1)
                {
                    //  First reduction
                    ObjectArrayList structures = new ObjectArrayList();
                    OpenIntObjectHashMap verticesFromLastTiers = new OpenIntObjectHashMap();
                   
                    fillVerticesFromLastTier(hss, structures, verticesFromLastTiers);
                   
                    ObjectArrayList result = new ObjectArrayList();
                    findIntersectionWithFirstTier(hss, result, structures, verticesFromLastTiers);
                   
                    ITier firstTier = basicCTS.getTier(0);
                    IVertex firstTierVertex = (IVertex) result.get(0);
                    firstTier.intersect(firstTierVertex.getTripletValue());
                    basicCTS.cleanup(0, 0);
                   
                    //  Unify CTS
                    ObjectArrayList cts = new ObjectArrayList();
                    cts.add(((IHyperStructure) hss.get(0)).getBasicCTS());
                    for (int h = 0; h < hss.size(); h++)
                    {
                        hs = (IHyperStructure) hss.get(h);
                        cts.add(hs.getOtherCTS());
                    }
                    unify(cts);
                    //  Update HSS by creating new one (it must be created non-empty)
                    Properties statistics = new Properties();
                    hss = createHyperStructuresSystem(cts, statistics);
                    saveHSS(hssTempPathReduced, hss);
                    //  Check if its possible to find HSS route now
                    route = quickFindHSSRoute(hss);
                    if (isValidHSSRoute(route))
                    {
                        return route;
                    }
                    //  Route not found. Reduce next tier
                   
                    //  Basic CTS may have been changed in newly created HSS
                    if (!basicCTS.getPermutation().sameAs(((IHyperStructure) hss.get(0)).getBasicCTS().getPermutation()))
                    {
                        //  Basic CTS changed
                        j = -1;
                        basicCTS = ((IHyperStructure) hss.get(0)).getBasicCTS();
                    }
                }
                continue;
            }
           
            ITier tier = basicCTS.getTier(j);
            if (tier.size() > 1)
            {
                //  Previous tier contains one vertex
                OpenIntObjectHashMap prevTier = (OpenIntObjectHashMap) ((IHyperStructure)hss.get(0)).getTiers().get(j - 1);
                IVertex prevVertex = (IVertex) prevTier.values().get(0);
               
                if (prevVertex.hasEmptyBottomEdge())
                {
                    //  If previous vertex contains only one bottom vertex
                    //  then we should keep that vertex (and move forward to reduce next HSS tier?)
View Full Code Here

        public OpenIntObjectHashMap hsIntersections;
        public ObjectArrayList coincidentIntersections;
        public StructuresForConcordantShift(int hssSize)
        {
            substructureEdges = new ObjectArrayList(hssSize);
            hsIntersections = new OpenIntObjectHashMap(hssSize);
            coincidentIntersections = new ObjectArrayList(hssSize);
            for (int h = 0; h < hssSize; h++)
            {
                hsIntersections.put(h, new ObjectArrayList(8));
            }
View Full Code Here

        return tiers;
    }
    public void addVertex(int tierSize, IVertex vertex)
    {
        int tierIndex = vertex.getTierIndex();
        OpenIntObjectHashMap edges;
        if (tierIndex == tiers.size())
        {
            edges = new OpenIntObjectHashMap(tierSize);
            tiers.add(edges);
        }
        else
        {
            edges = (OpenIntObjectHashMap) tiers.get(tierIndex);
        }
        edges.put(vertex.getTripletValue().getTierKey(), vertex);
       
        ((SimpleVertex)vertex).setHyperStructure(this);
    }
View Full Code Here

    public SimpleFormula()
    {
        permutation = new SimplePermutation();
        tiers = new ObjectArrayList();
        tiersHash1 = new OpenIntObjectHashMap();
        tiersHash2 = new OpenLongObjectHashMap();
        tiersHash3 = new OpenLongObjectHashMap();
    }
View Full Code Here

           
            assertEquals(hs.getTiers().size(), hs2.getTiers().size());
           
            for (int j = 0; j < hs.getTiers().size(); j++)
            {
                OpenIntObjectHashMap tier = (OpenIntObjectHashMap) hs.getTiers().get(j);
                OpenIntObjectHashMap tier2 = (OpenIntObjectHashMap) hs2.getTiers().get(j);
               
                assertEquals(tier.size(), tier2.size());
               
                for (int i = 0; i < tier.size(); i++)
                {
                    int key = tier.keys().get(i);
                   
                    assertTrue(tier2.containsKey(key));
                   
                    IVertex vertex = (IVertex) tier.get(key);
                    IVertex vertex2 = (IVertex) tier2.get(key);
                   
                    assertVerticesEqual(vertex, vertex2);
                    assertVerticesEqual(vertex.getBottomVertex1(), vertex2.getBottomVertex1());
                    assertVerticesEqual(vertex.getBottomVertex2(), vertex2.getBottomVertex2());
                }
View Full Code Here

  ColtIntegerHashSet(OpenIntObjectHashMap map) {
    this.map = map;
  }

  public ColtIntegerHashSet(int initialCapacity) {
    this.map = new OpenIntObjectHashMap(initialCapacity);
  }
View Full Code Here

TOP

Related Classes of cern.colt.map.OpenIntObjectHashMap

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.