Drops entries from a sparse matrix;

@param A
column-compressed matrix
@param fkeep
drop aij if fkeep.fkeep(i,j,aij,other) is false
@param other
optional parameter to fkeep
@return nz, new number of entries in A, -1 on error
509896
public static int cs_fkeep(Dcs A, Dcs_ifkeep fkeep, Object other) {
        int j, p, nz = 0, n, Ap[], Ai[];
        double Ax[];
        if (!Dcs_util.CS_CSC(A))
            return (-1); /* check inputs */
        n = A.n;
        Ap = A.p;
        Ai = A.i;
        Ax = A.x;
        for (j = 0; j < n; j++) {
            p = Ap[j]; /* get current location of col j */
            Ap[j] = nz; /* record new location of col j */
            for (; p < Ap[j + 1]; p++) {
                if (fkeep.fkeep(Ai[p], j, Ax != null ? Ax[p] : 1, other)) {
                    if (Ax != null)
                        Ax[nz] = Ax[p]; /* keep A(i,j) */
                    Ai[nz++] = Ai[p];
                }
            }
        }
        Ap[n] = nz; /* finalize A */
        Dcs_util.cs_sprealloc(A, 0); /* remove extra space from A */
        return (nz);
    }
72495
public void copyOut (ActiveMQQueueJmxStats other) {
        other.setCursorPercentUsage(this.getCursorPercentUsage());
        other.setDequeueCount(this.getDequeueCount());
        other.setEnqueueCount(this.getEnqueueCount());
        other.setMemoryPercentUsage(this.getMemoryPercentUsage());
        other.setNumConsumers(this.getNumConsumers());
        other.setNumProducers(this.getNumProducers());
        other.setQueueSize(this.getQueueSize());
        other.setInflightCount(this.getInflightCount());
    }
866603
public void swapColumns(Object columnKeyA, Object columnKeyB) {
        checkFrozen();

        final int columnIndexA = this.getColumnIndex(columnKeyA);
        final int columnIndexB = this.getColumnIndex(columnKeyB);

        final List<C> tmp = new ArrayList<>(rowLength());
        tmp.addAll(_columnKeySet);
        final C tmpColumnKeyA = tmp.get(columnIndexA);
        tmp.set(columnIndexA, tmp.get(columnIndexB));
        tmp.set(columnIndexB, tmpColumnKeyA);

        _columnKeySet.clear();
        _columnKeySet.addAll(tmp);

        _columnKeyIndexMap.forcePut(tmp.get(columnIndexA), columnIndexA);
        _columnKeyIndexMap.forcePut(tmp.get(columnIndexB), columnIndexB);

        if (_initialized && _columnList.size() > 0) {
            final List<E> tmpColumnA = _columnList.get(columnIndexA);

            _columnList.set(columnIndexA, _columnList.get(columnIndexB));
            _columnList.set(columnIndexB, tmpColumnA);
        }
    }
162237
private static ResultSet getImportedKeys(String tableDef, String tableName, String catalog,
      MariaDbConnection connection) throws ParseException {
    String[] columnNames = {
        "PKTABLE_CAT", "PKTABLE_SCHEM", "PKTABLE_NAME",
        "PKCOLUMN_NAME", "FKTABLE_CAT", "FKTABLE_SCHEM",
        "FKTABLE_NAME", "FKCOLUMN_NAME", "KEY_SEQ",
        "UPDATE_RULE", "DELETE_RULE", "FK_NAME",
        "PK_NAME", "DEFERRABILITY"
    };
    ColumnType[] columnTypes = {
        ColumnType.VARCHAR, ColumnType.NULL, ColumnType.VARCHAR,
        ColumnType.VARCHAR, ColumnType.VARCHAR, ColumnType.NULL,
        ColumnType.VARCHAR, ColumnType.VARCHAR, ColumnType.SMALLINT,
        ColumnType.SMALLINT, ColumnType.SMALLINT, ColumnType.VARCHAR,
        ColumnType.NULL, ColumnType.SMALLINT};

    String[] parts = tableDef.split("\n");

    List<String[]> data = new ArrayList<>();

    for (String part : parts) {
      part = part.trim();
      if (!part.startsWith("CONSTRAINT") && !part.contains("FOREIGN KEY")) {
        continue;
      }
      char[] partChar = part.toCharArray();

      Identifier constraintName = new Identifier();

      int pos = skipKeyword(partChar, 0, "CONSTRAINT");
      pos = parseIdentifier(partChar, pos, constraintName);
      pos = skipKeyword(partChar, pos, "FOREIGN KEY");
      List<Identifier> foreignKeyCols = new ArrayList<>();
      pos = parseIdentifierList(partChar, pos, foreignKeyCols);
      pos = skipKeyword(partChar, pos, "REFERENCES");
      Identifier pkTable = new Identifier();
      pos = parseIdentifier(partChar, pos, pkTable);
      List<Identifier> primaryKeyCols = new ArrayList<>();
      parseIdentifierList(partChar, pos, primaryKeyCols);
      if (primaryKeyCols.size() != foreignKeyCols.size()) {
        throw new ParseException(tableDef, 0);
      }
      int onUpdateReferenceAction = DatabaseMetaData.importedKeyRestrict;
      int onDeleteReferenceAction = DatabaseMetaData.importedKeyRestrict;

      for (String referenceAction : new String[]{"RESTRICT", "CASCADE", "SET NULL", "NO ACTION"}) {
        if (part.contains("ON UPDATE " + referenceAction)) {
          onUpdateReferenceAction = getImportedKeyAction(referenceAction);
        }
        if (part.contains("ON DELETE " + referenceAction)) {
          onDeleteReferenceAction = getImportedKeyAction(referenceAction);
        }
      }

      for (int i = 0; i < primaryKeyCols.size(); i++) {

        String[] row = new String[columnNames.length];
        row[0] = pkTable.schema;
        if (row[0] == null) {
          row[0] = catalog;
        }
        row[1] = null;
        row[2] = pkTable.name;
        row[3] = primaryKeyCols.get(i).name;
        row[4] = catalog;
        row[5] = null;
        row[6] = tableName;
        row[7] = foreignKeyCols.get(i).name;
        row[8] = Integer.toString(i + 1);
        row[9] = Integer.toString(onUpdateReferenceAction);
        row[10] = Integer.toString(onDeleteReferenceAction);
        row[11] = constraintName.name;
        row[12] = null;
        row[13] = Integer.toString(DatabaseMetaData.importedKeyNotDeferrable);
        data.add(row);
      }
    }
    String[][] arr = data.toArray(new String[0][]);

    /* Sort array by PKTABLE_CAT, PKTABLE_NAME, and KEY_SEQ.*/
    Arrays.sort(arr, (row1, row2) -> {
      int result = row1[0].compareTo(row2[0]);   //PKTABLE_CAT
      if (result == 0) {
        result = row1[2].compareTo(row2[2]);   //PKTABLE_NAME
        if (result == 0) {
          result = row1[8].length() - row2[8].length();  // KEY_SEQ
          if (result == 0) {
            result = row1[8].compareTo(row2[8]);
          }
        }
      }
      return result;
    });
    return SelectResultSet.createResultSet(columnNames, columnTypes, arr, connection.getProtocol());
  }
782522
public void copyFrom(BlockType other) {
        this.isValid = other.isValid;
        this.isTop = other.isTop;
        if (isValid) {
            this.depth = other.depth;
            this.clear();
            this.or(other);
        }
    }
466896
private void fastAddAll(ArrayBackedSortedColumns other)
    {
        if (other.isInsertReversed() == isInsertReversed())
        {
            cells = Arrays.copyOf(other.cells, other.cells.length);
            size = other.size;
            sortedSize = other.sortedSize;
            isSorted = other.isSorted;
        }
        else
        {
            if (cells.length < other.getColumnCount())
                cells = new Cell[Math.max(MINIMAL_CAPACITY, other.getColumnCount())];
            Iterator<Cell> iterator = reversed ? other.reverseIterator() : other.iterator();
            while (iterator.hasNext())
                cells[size++] = iterator.next();
            sortedSize = size;
            isSorted = true;
        }
    }
1355211
public static void swapCols(DenseDoubleMatrix2D matrix, long col1, long col2) {
		double temp = 0;
		long rows = matrix.getRowCount();
		for (long row = 0; row < rows; row++) {
			temp = matrix.getDouble(row, col1);
			matrix.setDouble(matrix.getDouble(row, col2), row, col1);
			matrix.setDouble(temp, row, col2);
		}
	}
61069
function copy_row(nnz,
                  offset,
                  A,
                  /*int* index, // const int*
                    double* value, // const double*
                  */

                  x) // x = sparseVector
{
  for(var i=nnz-1; i>=0; --i) if(A.value[i + offset]){
    x.push_front(new SparseEntry(A.column_index[i + offset], A.value[i + offset]));
  }
  return true;
}
619565
public static void swapCol(Matrix A, int j, int k)
    {
        swapCol(A, j, k, 0, A.rows());
    }
60800
public void remove(BitSet other)
    {
        int idx = Math.min(wlen, other.wlen);
        long [] thisArr = this.bits;
        long [] otherArr = other.bits;
        while (--idx >= 0)
        {
            thisArr[idx] &= ~otherArr[idx];
        }
    }
810305
protected static void multTransABlockSet_lowerTriag( double[] dataA, double []dataB, double []dataC,
                                                         int indexA, int indexB, int indexC,
                                                         final int heightA, final int widthA, final int widthC) {
        for( int i = 0; i < widthA; i++ ) {
            for( int j = 0; j < widthC; j++ ) {
                double val = i < heightA ? dataB[i*widthC + j + indexB] : 0;

                for( int k = i+1; k < heightA; k++ ) {
                    val += dataA[k*widthA + i + indexA] * dataB[k*widthC + j + indexB];
                }

                dataC[ i*widthC + j + indexC ] = val;
            }
        }
    }
564054
def _ixor(self, other):
		
		if isinstance(other, _basebag):
			for elem, other_count in other.counts():
				count = abs(self.count(elem) - other_count)
				self._set_count(elem, count)
		else:
			# Let a = self.count(elem) and b = other.count(elem)
			# if a >= b then elem is removed from self b times leaving a - b
			# if a < b then elem is removed from self a times then added (b - a)
			# times leaving a - a + (b - a) = b - a
			for elem in other:
				try:
					self._increment_count(elem, -1)
				except ValueError:
					self._increment_count(elem, 1)
		return self
84895
public boolean dropColumn (Connection conn, String table, String column) throws SQLException
    {
        if (!tableContainsColumn(conn, table, column)) {
            return false;
        }
        executeQuery(conn, "ALTER TABLE " + tableSQL(table) + " DROP COLUMN " + columnSQL(column));
        log("Database column '" + column + "' removed from table '" + table + "'.");
        return true;
    }
1178496
public void meetWith(LockSet other) {
        for (int i = 0; i + 1 < array.length; i += 2) {
            int valueNumber = array[i];
            if (valueNumber < 0) {
                break;
            }

            int mine = array[i + 1];
            int his = other.getLockCount(valueNumber);
            array[i + 1] = mergeValues(mine, his);
        }

        for (int i = 0; i + 1 < other.array.length; i += 2) {
            int valueNumber = other.array[i];
            if (valueNumber < 0) {
                break;
            }

            int mine = getLockCount(valueNumber);
            int his = other.array[i + 1];
            setLockCount(valueNumber, mergeValues(mine, his));
        }

        setDefaultLockCount(0);
    }
1149129
public boolean remove(Entry<K,V> e) {
    int _hash = modifiedHashCode(e.hashCode);
    OptimisticLock[] _locks = locks;
    int si = _hash & LOCK_MASK;
    OptimisticLock l = _locks[si];
    long _stamp = l.writeLock();
    try {
      Entry<K,V> f; Entry<K,V>[] tab = entries;
      if (tab == null) {
        throw new CacheClosedException(cache);
      }
      int n = tab.length, _mask = n - 1, idx = _hash & (_mask);
      f = tab[idx];
      if (f == e) {
        tab[idx] = f.another;
        segmentSize[si].decrementAndGet();
        return true;
      }
      while (f != null) {
        Entry<K,V> _another = f.another;
        if (_another == e) {
          f.another = _another.another;
          segmentSize[si].decrementAndGet();
          return true;
        }
        f = _another;
      }
    } finally {
      l.unlockWrite(_stamp);
    }
    return false;
  }
847844
@Override
    public String getMethodNameForReference(final ForeignKey foreignKey) {
        final Column c = foreignKey.getColumnReferences().get(0).getForeignKeyColumn();
        // check if only one-column fk
        if (foreignKey.getColumnReferences().size() == 1) {
            return getMethodNameForColumn(c) + getClassNameForTable(c.getReferencedColumn().getParent());
        }

        final StringBuilder nameBuilder = new StringBuilder();
        final List<String> words = new ArrayList<>(Arrays.asList(foreignKey.getName()
                .toLowerCase()
                .replaceAll("(^[0-9]+|[^a-z0-9_-])", "") // Delete every not-alphanumeric or _/- character and numbers at beginning
                .split("_")));
        words.removeAll(Arrays.asList("fk", "", null)); // removes FK_ prefix and empty entries
        final List<String> tableWords = new ArrayList<>(Arrays.asList(c.getParent().getName()
                .toLowerCase()
                .replaceAll("(^[0-9]+|[^a-z0-9_-])", "") // Delete every not-alphanumeric or _/- character and numbers at beginning
                .split("_")));
        words.removeAll(tableWords);
        nameBuilder.append(words.get(0));
        for (int i = 1; i < words.size(); i++) {
            String word = words.get(i);

            nameBuilder.append(word.substring(0, 1).toUpperCase());
            nameBuilder.append(word.substring(1));
        }
        return nameBuilder.toString();
    }
978271
function(otherRecognizer) {
        if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
            return this;
        }

        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
        var index = inArray(this.requireFail, otherRecognizer);
        if (index > -1) {
            this.requireFail.splice(index, 1);
        }
        return this;
    }