Add a constraint

@param c     the cumulative capacity of the aliased resources
@param cUse  the usage of each of the c-slices
@param dUse  the usage of each of the d-slices
@param alias the resource identifiers that compose the alias
183359
@Override
    public void addDim(int c, int[] cUse, IntVar[] dUse, int[] alias) {
        capacities.add(c);
        cUsages.add(cUse);
        dUsages.add(dUse);
        aliases.add(alias);
    }
1076416
public static void addTableSRIDConstraint(Connection connection, TableLocation tableLocation, int srid)
            throws SQLException {
        //Alter table to set the SRID constraint
        if (srid > 0) {
            connection.createStatement().execute(String.format("ALTER TABLE %s ADD CHECK ST_SRID(the_geom)=%d",
                    tableLocation.toString(), srid));
        }
    }
1005615
public void addDependency(final ProcessorGraphNode node) {
        Assert.isTrue(node != this, "A processor can't depends on himself");

        this.dependencies.add(node);
        node.addRequirement(this);
    }
446950
public void addCc(String cc) {
        if (this.cc.length() > 0) {
            this.cc.append(",");
        }
        this.cc.append(cc);
    }
622467
Table REFERENTIAL_CONSTRAINTS() {

        Table t = sysTables[REFERENTIAL_CONSTRAINTS];

        if (t == null) {
            t = createBlankTable(sysTableHsqlNames[REFERENTIAL_CONSTRAINTS]);

            addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
            addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
            addColumn(t, "CONSTRAINT_NAME", SQL_IDENTIFIER);              // not null
            addColumn(t, "UNIQUE_CONSTRAINT_CATALOG", SQL_IDENTIFIER);    // not null
            addColumn(t, "UNIQUE_CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
            addColumn(t, "UNIQUE_CONSTRAINT_NAME", SQL_IDENTIFIER);
            addColumn(t, "MATCH_OPTION", CHARACTER_DATA);                 // not null
            addColumn(t, "UPDATE_RULE", CHARACTER_DATA);                  // not null
            addColumn(t, "DELETE_RULE", CHARACTER_DATA);                  // not null

            HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
                sysTableHsqlNames[REFERENTIAL_CONSTRAINTS].name, false,
                SchemaObject.INDEX);

            t.createPrimaryKey(name, new int[] {
                0, 1, 2,
            }, false);

            return t;
        }

        // column number mappings
        final int constraint_catalog        = 0;
        final int constraint_schema         = 1;
        final int constraint_name           = 2;
        final int unique_constraint_catalog = 3;
        final int unique_constraint_schema  = 4;
        final int unique_constraint_name    = 5;
        final int match_option              = 6;
        final int update_rule               = 7;
        final int delete_rule               = 8;

        //
        PersistentStore store = database.persistentStoreCollection.getStore(t);
        Iterator        tables;
        Table           table;
        Constraint[]    constraints;
        Constraint      constraint;
        Object[]        row;

        tables =
            database.schemaManager.databaseObjectIterator(SchemaObject.TABLE);

        while (tables.hasNext()) {
            table = (Table) tables.next();

            if (table.isView()
                    || !session.getGrantee().hasNonSelectTableRight(table)) {
                continue;
            }

            constraints = table.getConstraints();

            for (int i = 0; i < constraints.length; i++) {
                constraint = constraints[i];

                if (constraint.getConstraintType() != Constraint.FOREIGN_KEY) {
                    continue;
                }

                HsqlName uniqueName = constraint.getUniqueName();

                row                     = t.getEmptyRowData();
                row[constraint_catalog] = database.getCatalogName().name;
                row[constraint_schema]  = constraint.getSchemaName().name;
                row[constraint_name]    = constraint.getName().name;

                if (isAccessibleTable(constraint.getMain())) {
                    row[unique_constraint_catalog] =
                        database.getCatalogName().name;
                    row[unique_constraint_schema] = uniqueName.schema.name;
                    row[unique_constraint_name]   = uniqueName.name;
                }

                row[match_option] = Tokens.T_NONE;
                row[update_rule]  = constraint.getUpdateActionString();
                row[delete_rule]  = constraint.getDeleteActionString();

                t.insertSys(store, row);
            }
        }

        return t;
    }
181864
public void addSparseConstraint(int component, int index, double value) {
    constraints.add(new Constraint(component, index, value));
  }
471599
public final void addCaseClosure(int c, UnicodeSet set) {
        /*
         * Hardcode the case closure of i and its relatives and ignore the
         * data file data for these characters.
         * The Turkic dotless i and dotted I with their case mapping conditions
         * and case folding option make the related characters behave specially.
         * This code matches their closure behavior to their case folding behavior.
         */

        switch(c) {
        case 0x49:
            /* regular i and I are in one equivalence class */
            set.add(0x69);
            return;
        case 0x69:
            set.add(0x49);
            return;
        case 0x130:
            /* dotted I is in a class with <0069 0307> (for canonical equivalence with <0049 0307>) */
            set.add(iDot);
            return;
        case 0x131:
            /* dotless i is in a class by itself */
            return;
        default:
            /* otherwise use the data file data */
            break;
        }

        int props=trie.get(c);
        if(!propsHasException(props)) {
            if(getTypeFromProps(props)!=NONE) {
                /* add the one simple case mapping, no matter what type it is */
                int delta=getDelta(props);
                if(delta!=0) {
                    set.add(c+delta);
                }
            }
        } else {
            /*
             * c has exceptions, so there may be multiple simple and/or
             * full case mappings. Add them all.
             */
            int excOffset0, excOffset=getExceptionsOffset(props);
            int closureOffset;
            int excWord=exceptions.charAt(excOffset++);
            int index, closureLength, fullLength, length;

            excOffset0=excOffset;

            /* add all simple case mappings */
            for(index=EXC_LOWER; index<=EXC_TITLE; ++index) {
                if(hasSlot(excWord, index)) {
                    excOffset=excOffset0;
                    c=getSlotValue(excWord, index, excOffset);
                    set.add(c);
                }
            }

            /* get the closure string pointer & length */
            if(hasSlot(excWord, EXC_CLOSURE)) {
                excOffset=excOffset0;
                long value=getSlotValueAndOffset(excWord, EXC_CLOSURE, excOffset);
                closureLength=(int)value&CLOSURE_MAX_LENGTH; /* higher bits are reserved */
                closureOffset=(int)(value>>32)+1; /* behind this slot, unless there are full case mappings */
            } else {
                closureLength=0;
                closureOffset=0;
            }

            /* add the full case folding */
            if(hasSlot(excWord, EXC_FULL_MAPPINGS)) {
                excOffset=excOffset0;
                long value=getSlotValueAndOffset(excWord, EXC_FULL_MAPPINGS, excOffset);
                fullLength=(int)value;

                /* start of full case mapping strings */
                excOffset=(int)(value>>32)+1;

                fullLength&=0xffff; /* bits 16 and higher are reserved */

                /* skip the lowercase result string */
                excOffset+=fullLength&FULL_LOWER;
                fullLength>>=4;

                /* add the full case folding string */
                length=fullLength&0xf;
                if(length!=0) {
                    set.add(exceptions.substring(excOffset, excOffset+length));
                    excOffset+=length;
                }

                /* skip the uppercase and titlecase strings */
                fullLength>>=4;
                excOffset+=fullLength&0xf;
                fullLength>>=4;
                excOffset+=fullLength;

                closureOffset=excOffset; /* behind full case mappings */
            }

            /* add each code point in the closure string */
            int limit=closureOffset+closureLength;
            for(index=closureOffset; index<limit; index+=UTF16.getCharCount(c)) {
                c=exceptions.codePointAt(index);
                set.add(c);
            }
        }
    }
746131
public static int cusparseScsc2dense(
        cusparseHandle handle, 
        int m, 
        int n, 
        cusparseMatDescr descrA, 
        Pointer cscSortedValA, 
        Pointer cscSortedRowIndA, 
        Pointer cscSortedColPtrA, 
        Pointer A, 
        int lda)
    {
        return checkResult(cusparseScsc2denseNative(handle, m, n, descrA, cscSortedValA, cscSortedRowIndA, cscSortedColPtrA, A, lda));
    }
515099
public void addTransition(Character c, State s) {
        transitions.put(c, s);
        d_recomputeHash = true;
    }
50300
public void addCacheConfiguration(final String alias, final CacheConfiguration<?, ?> config) {
    if (caches.put(alias, config) != null) {
      throw new IllegalStateException("Cache '" + alias + "' already present!");
    }
  }
516339
private void bumpClause(final CLClause c) {
        switch (this.config.cbump) {
            case INC:
                c.setActivity(c.activity() + 1);
                break;
            case LRU:
                c.setActivity(this.stats.conflicts);
                break;
            case AVG:
                c.setActivity((this.stats.conflicts + c.activity()) / 2);
                break;
            case NONE:
            default:
                assert this.config.cbump == CleaneLingConfig.ClauseBumping.NONE;
                break;
        }
    }
1138725
static Table addTableConstraintDefinitions(Session session, Table table,
            HsqlArrayList tempConstraints, HsqlArrayList constraintList) {

        Constraint c        = (Constraint) tempConstraints.get(0);
        String     namePart = c.getName() == null ? null
                                                  : c.getName().name;
        HsqlName indexName = session.database.nameManager.newAutoName("IDX",
            namePart, table.getSchemaName(), table.getName(),
            SchemaObject.INDEX);

        if (c.mainColSet != null) {
            c.core.mainCols = table.getColumnIndexes(c.mainColSet);
        }

        table.createPrimaryKey(indexName, c.core.mainCols, true);

        if (c.core.mainCols != null) {
            Constraint newconstraint = new Constraint(c.getName(), c.getIsAutogeneratedName(), table,
                table.getPrimaryIndex(), Constraint.PRIMARY_KEY);

            table.addConstraint(newconstraint);
            session.database.schemaManager.addSchemaObject(newconstraint);
        }

        for (int i = 1; i < tempConstraints.size(); i++) {
            c = (Constraint) tempConstraints.get(i);

            switch (c.constType) {

                case Constraint.UNIQUE : {
                    c.setColumnsIndexes(table);

                    // A VoltDB extension to support indexed expressions and the assume unique attribute
                    if (c.indexExprs != null) {
                        // Special case handling for VoltDB indexed expressions
                        if (table.getUniqueConstraintForExprs(c.indexExprs) != null) {
                            throw Error.error(ErrorCode.X_42522);
                        }
                    }
                    else
                    // End of VoltDB extension
                    if (table.getUniqueConstraintForColumns(c.core.mainCols)
                            != null) {
                        throw Error.error(ErrorCode.X_42522);
                    }

                    // create an autonamed index
                    indexName = session.database.nameManager.newAutoName("IDX",
                            c.getName().name, table.getSchemaName(),
                            table.getName(), SchemaObject.INDEX);

                    // A VoltDB extension to support indexed expressions and the assume unique attribute
                    Index index = null;
                    if (c.indexExprs != null) {
                        // Special case handling for VoltDB indexed expressions
                        index = table.createAndAddExprIndexStructure(
                                indexName, c.core.mainCols, c.indexExprs, true, false, true)
                                .setAssumeUnique(c.assumeUnique);
                    } else {
                        index = table.createAndAddIndexStructure(
                                indexName, c.core.mainCols, null, null, true, false, true, false)
                                .setAssumeUnique(c.assumeUnique);
                    }

                    Constraint newconstraint = new Constraint(c.getName(), c.getIsAutogeneratedName(),
                        table, index, Constraint.UNIQUE);
                    // A VoltDB extension to support the assume unique attribute
                    newconstraint = newconstraint.setAssumeUnique(c.assumeUnique);
                    // End of VoltDB extension

                    table.addConstraint(newconstraint);
                    session.database.schemaManager.addSchemaObject(
                        newconstraint);

                    break;
                }
                case Constraint.MIGRATING : {
                    // TODO
                    Index index = table.createAndAddIndexStructure(indexName,
                            c.core.mainCols, null, null, true, true, false, false);
                    Constraint newconstraint = new Constraint(c.getName(), c.getIsAutogeneratedName(),
                            table, index, Constraint.MIGRATING)
                            .setMigrating(c.migrating);

                    table.addConstraint(newconstraint);
                    session.database.schemaManager.addSchemaObject(
                            newconstraint);
                }
                case Constraint.FOREIGN_KEY : {
                    addForeignKey(session, table, c, constraintList);

                    break;
                }
                case Constraint.CHECK : {
                    c.prepareCheckConstraint(session, table, false);
                    table.addConstraint(c);

                    if (c.isNotNull()) {
                        ColumnSchema column =
                            table.getColumn(c.notNullColumnIndex);

                        column.setNullable(false);
                        table.setColumnTypeVars(c.notNullColumnIndex);
                    }

                    session.database.schemaManager.addSchemaObject(c);

                    break;
                }
                // A VoltDB extension to support LIMIT PARTITION ROWS
                case Constraint.LIMIT : {
                    table.addConstraint(c);
                    session.database.schemaManager.addSchemaObject(c);

                    break;
                }
                // End of VoltDB extension
            }
        }

        return table;
    }
850562
public void addTransition(DuzztAction action, DuzztState succ) {
		transitions.put(action, new DuzztTransition(action, succ));
	}
1131544
public void add(final WComponent component, final Serializable... constraints) {
		add(component);

		if (constraints != null && constraints.length > 0) {
			PanelModel model = getOrCreateComponentModel();

			if (model.layoutConstraints == null) {
				model.layoutConstraints = new HashMap<>();
			}

			model.layoutConstraints.put(component, constraints);
		}
	}
933064
protected void noteConstraints (int constrain, int size)
    {
        switch (constrain) {
        case HORIZONTAL:
            if (size == 0) {
                _constrain = HORIZONTAL;
            } else {
                _label.setTargetWidth(size);
            }
            break;

        case VERTICAL:
            if (size == 0) {
                _constrain = VERTICAL;
            } else {
                _label.setTargetHeight(size);
            }
            break;

        case GOLDEN:
            _label.setGoldenLayout();
            break;

        case NONE:
            // nothing doing
            break;

        default:
            throw new IllegalArgumentException("Invalid constraint orientation " + constrain);
        }
    }
196722
private void addUnitClause(final MiniSatStyleSolver s, int a, int blocking) {
    assert this.clause.size() == 0;
    assert a != LIT_UNDEF;
    assert var(a) < s.nVars();
    this.clause.push(a);
    if (blocking != LIT_UNDEF)
      this.clause.push(blocking);
    s.addClause(this.clause, null);
    this.clause.clear();
  }
322585
private void add(BitSet cycle) {

        BitSet intersect = and(cycle, cyclic);

        if (intersect.cardinality() > 1) {
            addFused(cycle);
        } else {
            addIsolated(cycle);
        }

        cyclic.or(cycle);

    }