Examples of TIntArrayList


Examples of gnu.trove.list.array.TIntArrayList

     * @return true if the clause has been added to the clause store
     */
    public static boolean addAtMostNMinusOne(BoolVar[] BOOLVARS) {
        Solver solver = BOOLVARS[0].getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        TIntList lits = new TIntArrayList(BOOLVARS.length);
        for (int i = 0; i < BOOLVARS.length; i++) {
            lits.add(SatSolver.negated(sat.Literal(BOOLVARS[i])));
        }
        sat.addClause(lits);
        return true;
    }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

     * @return true if the clause has been added to the clause store
     */
    public static boolean addSumBoolArrayGreaterEqVar(BoolVar[] BOOLVARS, BoolVar TARGET) {
        Solver solver = BOOLVARS[0].getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        TIntList lits = new TIntArrayList(BOOLVARS.length + 1);
        for (int i = 0; i < BOOLVARS.length; ++i) {
            lits.add(sat.Literal(BOOLVARS[i]));
        }
        lits.add(SatSolver.negated(sat.Literal(TARGET)));
        sat.addClause(lits);
        return true;
    }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

        }

        BoolVar extra = VF.bool(StringUtils.randomName(), solver);
        int tlit = sat.Literal(TARGET);
        int elit = sat.Literal(extra);
        TIntList lits = new TIntArrayList(BOOLVARS.length + 1);
        for (int i = 0; i < BOOLVARS.length; ++i) {
            lits.add(sat.Literal(BOOLVARS[i]));
        }
        lits.add(SatSolver.negated(elit));
        sat.addClause(lits);
        for (int i = 0; i < BOOLVARS.length; ++i) {
            sat.addClause(elit, SatSolver.negated(sat.Literal(BOOLVARS[i])));
        }
        sat.addClause(SatSolver.negated(elit), tlit);
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

    }

    protected int[][] readVAR(String filename) {
        FileReader f;
        String line;
        TIntList values = new TIntArrayList();
        try {
            f = new FileReader(filename);
            BufferedReader r = new BufferedReader(f);
            List<int[]> ints = new ArrayList<int[]>();
            while ((line = r.readLine()) != null) {
                Scanner sc = new Scanner(line);
                while (sc.hasNextInt()) {
                    values.add(sc.nextInt());
                }
                ints.add(values.toArray());
                values.clear();
            }
            int[][] data = new int[ints.size()][];
            for (int i = 0; i < ints.size(); i++) {
                data[i] = ints.get(i);
            }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList


    protected int[][] readCTR(String filename) {
        FileReader f;
        String line;
        TIntList values = new TIntArrayList();
        try {
            f = new FileReader(filename);
            BufferedReader r = new BufferedReader(f);
            List<int[]> ints = new ArrayList<int[]>();
            while ((line = r.readLine()) != null) {
                Scanner sc = new Scanner(line);
                values.add(sc.nextInt());
                values.add(sc.nextInt());
                sc.next();
                values.add(sc.next().equals("=") ? 0 : 1);
                values.add(sc.nextInt());
                ints.add(values.toArray());
                values.clear();
            }
            int[][] data = new int[ints.size()][];
            for (int i = 0; i < ints.size(); i++) {
                data[i] = ints.get(i);
            }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

    }

    public static Domain buildSetDomain(int ds, Random r, double density, boolean homogeneou) {
        int[] env = buildFullDomains(1, 0, ds, r, density, homogeneou)[0];
        int nbK = r.nextInt(env.length);
        TIntArrayList l = new TIntArrayList(env);
        l.shuffle(r);
        int[] ker = new int[nbK];
        for (int i = 0; i < nbK; i++) {
            ker[i] = l.get(i);
        }
        return new Domain(env, ker);
    }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

        num_vars_ = 0;
        this.clauses = new ArrayList<Clause>();
        this.watches_ = new TIntObjectHashMap<ArrayList<Watcher>>();
        this.implies_ = new TIntObjectHashMap<TIntList>();
        this.assignment_ = new TIntObjectHashMap<Boolean>();
        this.trail_ = new TIntArrayList();
        this.trail_markers_ = new TIntArrayList();
        this.temporary_add_vector_ = new TIntArrayList();
        this.touched_variables_ = new TIntArrayList();
    }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

            case 2:
                int l0 = ps.get(0);
                int l1 = ps.get(1);
                TIntList i0 = implies_.get(negated(l0));
                if (i0 == null) {
                    i0 = new TIntArrayList();
                    implies_.put(negated(l0), i0);
                }
                i0.add(l1);

                TIntList i1 = implies_.get(negated(l1));
                if (i1 == null) {
                    i1 = new TIntArrayList();
                    implies_.put(negated(l1), i1);
                }
                i1.add(l0);
                break;
            default:
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

      CC_firstNode = new int[n];
      CC_nextNode = new int[n];
      node_CC = new int[n];
      nodeOfNum = new int[n];
      numOfNode = new int[n];
      isthmusFrom = new TIntArrayList();
      isthmusTo = new TIntArrayList();
      ND = new int[n];
      L = new int[n];
      H = new int[n];
    }
    ISet act = graph.getNodes();
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

        vertex = new int[n];
        bucket = new int[n];
        succs = new ISet[n];
        preds = new ISet[n];
        T = new DirectedGraph(n, SetType.LINKED_LIST, false);
        list = new TIntArrayList();
    }
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.