Package cern.colt.list

Examples of cern.colt.list.ObjectArrayList


    }
   
    public SimpleFormula(IPermutation permutation)
    {
        this.permutation = permutation;
        tiers = new ObjectArrayList();
        tiersHash3 = new OpenLongObjectHashMap();
    }
View Full Code Here


    private SimpleFormula(SimpleFormula formula, final boolean fillTiersHash3)
    {
        this.permutation = formula.permutation;
        int tiersCount = formula.tiers.size();
       
        this.tiers = new ObjectArrayList(tiersCount);
        this.tiersHash3 = fillTiersHash3
                        ? new OpenLongObjectHashMap(tiersCount)
                        : null;
                       
        Object[] tiersElements = formula.tiers.elements();
View Full Code Here

    private void addTiersHash1(ITier tier, int varName)
    {
        int key = varName;
       
        //  List of ITier
        ObjectArrayList tiers = (ObjectArrayList) tiersHash1.get(key);
       
        if (tiers == null)
        {
            tiersHash1.put(key, new ObjectArrayList(new ITier[] {tier}));
        }
        else
        {
            tiers.add(tier);
        }
    }
View Full Code Here

   
    private void addTiersHash2(ITier tier, int varName1, int varName2)
    {
        long key = varName1 < varName2 ? (long)varName1 << 21 | varName2 : (long)varName2 << 21 | varName1;
       
        ObjectArrayList tiers = (ObjectArrayList) tiersHash2.get(key);
       
        if (tiers == null)
        {
            tiersHash2.put(key, new ObjectArrayList(new ITier[] {tier}));
        }
        else
        {
            tiers.add(tier);
        }
    }
View Full Code Here

            return;
        }
       
        if (isEmpty())
        {
            ObjectArrayList otherTiers = cts.getTiers();
            for (int i = 0; i < otherTiers.size(); i++)
            {
                ITier otherTier = (ITier) otherTiers.get(i);
                ITier clone = otherTier.clone();
//                ((SimpleTier) clone).setFormula(this);
                tiers.add(clone);
            }
        }
View Full Code Here

    }
   
    @Test
    public void testHabr() throws Exception
    {
        ObjectArrayList ct = new ObjectArrayList(
                    new ITabularFormula[] {
                           
                            Helper.createFormula(1, 2, -6,
                                                 1, -2, 6,
                                                 -1, 2, 6,
                                                 -1, -2, -6),
                            Helper.createFormula(3, 4, -7,
                                                 3, -4, 7,
                                                 -3, 4, 7,
                                                 -3, -4, -7),
                            Helper.createFormula(5, 6, -7,
                                                 5, -6, 7,
                                                 -5, 6, 7,
                                                 -5, -6, -7),
                            Helper.createFormula(1, 2, -8,
                                                 1, -2, 8,
                                                 -1, 2, 8,
                                                 -1, -2, -8),
                            Helper.createFormula(3, 4, -9,
                                                 3, -4, 9,
                                                 -3, 4, 9,
                                                 -3, -4, -9),
                            Helper.createFormula(5, 8, 9,
                                                 5, -8, -9,
                                                 -5, 8, -9,
                                                 -5, -8, 9),
                            Helper.createFormula(10, 11, 12),
                    }
                );
       
        LOGGER.info("Initial CTF set");
        Helper.printFormulas(ct);
       
        IPermutation permutation = new SimplePermutation();
        for (int varName = 1; varName <= 12; varName++)
        {
            permutation.add(varName);
        }
        LOGGER.info("CTF -> CTS");
        Helper.completeToCTS(ct, permutation);
       
        LOGGER.info("CTS set");
        Helper.printFormulas(ct);
       
        LOGGER.info("Unify all CTS");
        Helper.unify(ct);
       
        try
        {
            Properties statistics = new Properties();
            Helper.createHyperStructuresSystem(ct, (ICompactTripletsStructure) ct.get(ct.size() - 1), statistics);
        }
        catch (EmptyStructureException e)
        {
            LOGGER.info("Formula not satisfiable", e);
        }
View Full Code Here

    }
   
    @Test
    public void testStructuresFromReducedHSS() throws Exception
    {
        ObjectArrayList cts = new ObjectArrayList(
                new ITabularFormula[] {
                        Helper.loadFromFile("target/test-classes/xor-chain/basic-cts.cnf"),
                        Helper.loadFromFile("target/test-classes/xor-chain/hss-0-other-cts.cnf"),
                }
            );
       
        Helper.prettyPrint((ITabularFormula) cts.get(0));
        Helper.prettyPrint((ITabularFormula) cts.get(1));
       
        try
        {
            ObjectArrayList hss = Helper.createHyperStructuresSystem(
                    cts, (ICompactTripletsStructure) cts.get(0), new Properties());
           
            System.out.println("Writing HSS(0) image to filesystem...");
            Helper.writeToImage((IHyperStructure) hss.get(0), null, null, "target/test-classes/xor-chain/hs.png");
            System.out.println("Done");
           
            fail("Non-empty HSS for UNSAT instance can't be built according to the Theorem 1");
        }
        catch (EmptyStructureException e)
View Full Code Here

    @Test
    public void testEvaluate()
    {
        ITabularFormula formula = Helper.createFormula(1, 2, 3);
       
        ObjectArrayList route = new ObjectArrayList();
        //  Route contains inverse values
        route.add(new SimpleVertex(new SimpleTripletPermutation(1, 2, 3), 0, _111_instance, null));
       
        assertTrue(formula.evaluate(route));
    }
View Full Code Here

        assertEquals(21, s2.getClausesCount());
       
        Helper.prettyPrint(s2);
       
        //  List of ITabularFormula
        ObjectArrayList cts = new ObjectArrayList(new ITabularFormula[] {s1, s2});
       
        Helper.unify(cts);
       
        assertEquals(13, s1.getClausesCount());
        assertEquals(15, s2.getClausesCount());
View Full Code Here

        {
            try
            {
                System.out.println(n);
                ITabularFormula formula = Helper.createRandomFormula(21, n);
                ObjectArrayList ctf = Helper.createCTF(formula);
                Helper.completeToCTS(ctf, formula.getPermutation());
            }
            catch (EmptyStructureException e)
            {
            }
View Full Code Here

TOP

Related Classes of cern.colt.list.ObjectArrayList

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.