Determines if the array has a null column for any of the positions given
in the rowColMap array.
325351
public static boolean hasNull(Object[] array, int[] columnMap) {

        int count = columnMap.length;

        for (int i = 0; i < count; i++) {
            if (array[columnMap[i]] == null) {
                return true;
            }
        }

        return false;
    }
850171
private String ifNull(int rowIndex){

        if(params.length != 2){
            throw new IllegalArgumentException("Wrong number of Parameters for if null expression");
        }

        final RecordList.Record currentRecord = recordList.getRecords().get(rowIndex);
        final String field1 = currentRecord.getValueByFieldName(params[0]);

        if (!field1.isEmpty()){
            return field1;
        }
        final String field2 = currentRecord.getValueByFieldName(params[1]);
        return field2;
    }
956654
private void checkColumnSingletons(DoubleMatrix1D c,
			DoubleMatrix2D A, DoubleMatrix1D b, 
			DoubleMatrix1D lb, DoubleMatrix1D ub, 
			DoubleMatrix1D ylb, DoubleMatrix1D yub,
			DoubleMatrix1D zlb, DoubleMatrix1D zub) {
		for(short col=0; col<this.vColPositions.length; col++){
			if(vColPositions[col].length == 1){
				short row = vColPositions[col][0];
				log.debug("found column singleton at row " + row + ", col " + col);
				short[] vRowPositionsRow = vRowPositions[row];
				if(vRowPositionsRow.length < 2){
					continue;//this is a fixed variable
				}

				double ARcol = A.getQuick(row, col);
				double cCol = c.getQuick(col);
				boolean isCColNz = !isZero(cCol);
				double lbCol = lb.getQuick(col);
				double ubCol = ub.getQuick(col);
				boolean isLBUnbounded = isLBUnbounded(lbCol); 
				boolean isUBUnbounded = isUBUnbounded(ubCol);
				
				if(isLBUnbounded || isUBUnbounded){
					//bound on one of the optimal Lagrange multipliers.
					if(isLBUnbounded){
						if(isUBUnbounded){
							//table 2, row 1
							zlb.setQuick(col, 0);
							zub.setQuick(col, 0);
							ylb.setQuick(row, cCol / ARcol);
							yub.setQuick(row, cCol / ARcol);
						}else{
							if(ARcol > 0){
								//table 2, row 4
								zub.setQuick(col, 0);
								ylb.setQuick(row, cCol / ARcol);
							}else{
								//table 2, row 5
								zub.setQuick(col, 0);
								yub.setQuick(row, cCol / ARcol);
							}
						}
					}else{
						if(isUBUnbounded){
							if(ARcol > 0){
								//table 2, row 2
								zlb.setQuick(col, 0);
								yub.setQuick(row, cCol / ARcol);
							}else{
								//table 2, row 3
								zlb.setQuick(col, 0);
								ylb.setQuick(row, cCol / ARcol);
							}
						}
					}
					
					if(isLBUnbounded && isUBUnbounded){
						//free column singleton: one constraint and	one variable 
						//is removed from the problem without generating any fill-ins in A, 
						//although	the objective function is modified
						log.debug("free column singleton");
						//substitution into the objective function
						short[] xi = new short[vRowPositionsRow.length-1];
						double[] mi = new double[vRowPositionsRow.length - 1];
						int cntXi = 0;
						for (int j = 0; j < vRowPositionsRow.length; j++) {
							short nzJ = vRowPositionsRow[j];
							if (nzJ != col){
								xi[cntXi] = nzJ;
								mi[cntXi] = -A.getQuick(row, nzJ) / ARcol;
								cntXi++;
								if (isCColNz){
									c.setQuick(nzJ, c.getQuick(nzJ) - cCol * A.getQuick(row, nzJ) / ARcol);
								}
							}
						}
						//see Andersen & Andersen, eq (10) [that is incorrect!]
						addToPresolvingStack(new LinearDependency(col, xi, mi, b.getQuick(row)));
						for(short j = 0; j < vRowPositionsRow.length; j++){
							short column = vRowPositionsRow[j];//the nz column index
							if(column!=col && vColPositions[column].length == 1){
								//this is also a column singleton, we do not want an empty final column
								//so we fix the value of the variable
								//@TODO: fix this for unbounded bounds
								if(c.getQuick(column)<0){
									lb.setQuick(column, ub.getQuick(column));
								}else if(c.getQuick(column)>0){
									ub.setQuick(column, lb.getQuick(column));
								}else{
									ub.setQuick(column, lb.getQuick(column));
								}
								log.debug("found fixed variables: x[" + column + "]="+lb.getQuick(column));
								addToPresolvingStack(new LinearDependency(column, null, null, lb.getQuick(column)));
								pruneFixedVariable(column, c, A, b, lb, ub, ylb, yub, zlb, zub);
							}
							changeColumnsLengthPosition(column, vColPositions[column].length, vColPositions[column].length-1);
							vColPositions[column] = removeElementFromSortedArray(vColPositions[column], row);
							A.setQuick(row, column, 0.);
						}
						changeRowsLengthPosition(row, vRowPositions[row].length, 0);
						vRowPositions[row] = new short[]{};
						if(vColPositions[col].length > 0){
							log.debug("Expected empty column "+col+" but was not empty");
							throw new IllegalStateException("Expected empty column "+col+" but was not empty");
						}
						vColPositions[col] = new short[]{};
						ylb.setQuick(row, cCol / ARcol);//ok, but jet stated above
						yub.setQuick(row, cCol / ARcol);//ok, but jet stated above
						b.setQuick(row, 0);
						lb.setQuick(col, this.unboundedLBValue);
						ub.setQuick(col, this.unboundedUBValue);
						c.setQuick(col, 0);
						this.someReductionDone = true;
						continue;
					}
				}
				
				double impliedL;
				double impliedU;
				if(ARcol>0){
					impliedL = (b.getQuick(row) - h[row])/ARcol + ubCol;
					impliedU = (b.getQuick(row) - g[row])/ARcol + lbCol;
				}else{
					impliedL = (b.getQuick(row) - g[row])/ARcol + ubCol;
					impliedU = (b.getQuick(row) - h[row])/ARcol + lbCol;
				}
				boolean ifl = impliedL > lbCol;//do not use =, it will cause a loop
				boolean ifu = impliedU < ubCol;//do not use =, it will cause a loop
				if(ifl){
				  lb.setQuick(col, impliedL);//tighten the bounds
				  lbCol = impliedL;
				  this.someReductionDone = true;
				}
				if(ifu){
				  ub.setQuick(col, impliedU);//tighten the bounds
				  ubCol = impliedU;
				  this.someReductionDone = true;
				}
				boolean isImpliedFree = (ifl && ifu) || (isZero(impliedL - lbCol) && isZero(impliedU - ubCol));
								
				if(vRowPositionsRow.length == 2 || isImpliedFree){
					//substitution
					short y = -1;
					double q=0., m=0.;
					short[] xi = new short[vRowPositionsRow.length-1];
					double[] mi = new double[vRowPositionsRow.length-1];
					StringBuffer sb = new StringBuffer("x["+col+"]=");
					q = b.getQuick(row)/ARcol;
					sb.append(q);
					int cntXi = 0;
					for(int j=0; j<vRowPositionsRow.length; j++){
						short nzJ = vRowPositionsRow[j];  
						if(nzJ != col){
							double ARnzJ = A.getQuick(row, nzJ);
							m = -ARnzJ/ARcol;
							xi[cntXi] = nzJ;
							mi[cntXi] = m;
							cntXi++;
							sb.append(" + " + m + "*x["+nzJ+"]");
							if(isCColNz){
								//the objective function is modified
								double cc = c.getQuick(col) * ARnzJ / ARcol;
								c.setQuick(nzJ, c.getQuick(nzJ) - cc);
							}
							y = nzJ;
						}
					}
					addToPresolvingStack(new LinearDependency(col, xi, mi, q));
					
					if(vRowPositionsRow.length == 2){
					//NOTE: the row and the column are removed
						log.debug("doubleton equation combined with a column singleton: " + sb.toString());
						//x = m*y + q, x column singleton
						//addToDoubletonMap(col, y, m, q);
						//the bounds on the variable y are modified so	that the feasible region is unchanged even if the bounds on x are removed
						//y = x/m - q/m
						double lbY = lb.getQuick(y);
						double ubY = ub.getQuick(y);
						boolean isLBYUnbounded = isLBUnbounded(lbY);
						boolean isUBYUnbounded = isLBUnbounded(ubY);
						if(m>0){
							if(!isLBUnbounded){
								double l = lbCol/m - q/m;
								lb.setQuick(y, (isLBYUnbounded)? l : Math.max(lbY, l));
							}
							if(!isUBUnbounded){
								double u = ubCol/m - q/m;
								ub.setQuick(y, (isUBYUnbounded)? u : Math.min(ubY, u));
							}
						}else{
							if(!isUBUnbounded){
								double u = ubCol/m - q/m;
								lb.setQuick(y, (isLBYUnbounded)? u : Math.max(lbY, u));
							}
							if(!isLBUnbounded){
								double l = lbCol/m - q/m;
								ub.setQuick(y, (isUBYUnbounded)? l : Math.min(ubY, l));
							}
						}
						if(vColPositions[y].length == 1){
							//this is also a column singleton, we do not want an empty final column
							//so we fix the value of the variable
							if(c.getQuick(y)<0){
								if(isUBUnbounded(ub.getQuick(y))){
									throw new RuntimeException("unbounded problem");
								}
								lb.setQuick(y, ub.getQuick(y));
							}else if(c.getQuick(y)>0){
								if(isLBUnbounded(lb.getQuick(y))){
									throw new RuntimeException("unbounded problem");
								}
								ub.setQuick(y, lb.getQuick(y));
							}else{
								//any value is good
								if(isLBUnbounded(lb.getQuick(y)) && isUBUnbounded(ub.getQuick(y))){
									throw new RuntimeException("unbounded problem");
								}else if(!isLBUnbounded(lb.getQuick(y)) && !isUBUnbounded(ub.getQuick(y))){
									double d = (ub.getQuick(y)-lb.getQuick(y))/2;
									lb.setQuick(y, d);
									ub.setQuick(y, d);
								}else if(!isLBUnbounded(lb.getQuick(y))){
									ub.setQuick(y, lb.getQuick(y));
								}else{
									lb.setQuick(y, ub.getQuick(y));
								}
							}
						}
						//remove the bounds on col
						lb.setQuick(col, this.unboundedLBValue);
						ub.setQuick(col, this.unboundedUBValue);
						//remove the variable
						A.setQuick(row, col, 0.);
						A.setQuick(row, y, 0.);
						b.setQuick(row, 0.);
						changeColumnsLengthPosition(col, vColPositions[col].length, 0);
						vColPositions[col] = new short[]{};
						vRowPositionsRow = removeElementFromSortedArray(vRowPositionsRow, col);//just to have vRowPositionsRow[0] 
						changeRowsLengthPosition(row, vRowPositionsRow.length+1, vRowPositionsRow.length);
						changeColumnsLengthPosition(vRowPositionsRow[0], vColPositions[vRowPositionsRow[0]].length, vColPositions[vRowPositionsRow[0]].length-1);
						vColPositions[vRowPositionsRow[0]] = removeElementFromSortedArray(vColPositions[vRowPositionsRow[0]], row);
						vRowPositions[row] = new short[]{};
						this.someReductionDone = true;
						continue;
					} else {
						//NOTE: one constraint and	one variable is removed from the problem 
						//without generating any fill-ins in A, 
						//although the objective function is modified
						log.debug("implied free column singletons: " + sb.toString());
						ylb.setQuick(row, c.getQuick(col) / A.getQuick(row, col));//ok, but already stated above 
						yub.setQuick(row, c.getQuick(col) / A.getQuick(row, col));//ok, but already stated above
						for(short cc=0; cc<vRowPositions[row].length; cc++){
							short column = vRowPositions[row][cc];
							if(column == col){
								continue;
							}
							if(vColPositions[column].length == 1){
								//this is also a column singleton, we do not want an empty final column
								//so we fix the value of the variable
								if(c.getQuick(column)<0){
									//no problem of unbounded bound, this is an implied free column
									if(isUBUnbounded(ub.getQuick(column))){
										throw new RuntimeException("unbounded problem");
									}
									lb.setQuick(column, ub.getQuick(column));
								}else if(c.getQuick(column)>0){
									//no problem of unbounded bound, this is an implied free column
									if(isLBUnbounded(lb.getQuick(column))){
										throw new RuntimeException("unbounded problem");
									}
									ub.setQuick(column, lb.getQuick(column));
								}else{
									//no problem of unbounded bound, this is an implied free column
									if(isLBUnbounded(lb.getQuick(column)) || isUBUnbounded(ub.getQuick(column))){
										throw new RuntimeException("unbounded problem");
									}
									double d = (ub.getQuick(y) - lb.getQuick(y)) / 2;
									lb.setQuick(y, d);
									ub.setQuick(y, d);
								}
								log.debug("found fixed variables: x[" + column + "]="+lb.getQuick(column));
								addToPresolvingStack(new LinearDependency(column, null, null, lb.getQuick(column)));
								pruneFixedVariable(column, c, A, b, lb, ub, ylb, yub, zlb, zub);
							}
							changeColumnsLengthPosition(column, vColPositions[column].length, vColPositions[column].length-1);
							vColPositions[column] = removeElementFromSortedArray(vColPositions[column], row);
							A.setQuick(row, column, 0.);
						}
						A.setQuick(row, col, 0.);
						b.setQuick(row, 0);
						lb.setQuick(col, this.unboundedLBValue);
						ub.setQuick(col, this.unboundedUBValue);
						c.setQuick(col, 0);
						changeColumnsLengthPosition(col, vColPositions[col].length, 0);
						vColPositions[col] = new short[]{};
						changeRowsLengthPosition(row, vRowPositions[row].length, 0);
						vRowPositions[row] = new short[]{};
						this.someReductionDone = true;
						//checkProgress(c, A, b, lb, ub, ylb, yub, zlb, zub);
						continue;
					}
				}
			}		
		}
	}
624393
public static boolean checkIndicesSorted( DMatrixSparseCSC A ) {
        for (int j = 0; j < A.numCols; j++) {
            int idx0 = A.col_idx[j];
            int idx1 = A.col_idx[j+1];

            if( idx0 != idx1 && A.nz_rows[idx0] >= A.numRows )
                return false;

            for (int i = idx0+1; i < idx1; i++) {
                int row = A.nz_rows[i];
                if( A.nz_rows[i-1] >= row)
                    return false;
                if( row >= A.numRows )
                    return false;
            }
        }
        return true;
    }
1310804
public void contains(@NullableDecl Object rowKey, @NullableDecl Object columnKey) {
    if (!actual().contains(rowKey, columnKey)) {
      fail("contains mapping for row/column", rowKey, columnKey);
    }
  }
577116
public String[] getColumnTexts(int columnIndex) {
        int count = getCount();
        if (count > 0) {
            String[] texts = new String[count];
            for (int i = 1; i <= count; i++) {
                texts[i - 1] = getText(i, columnIndex);
            }
            return texts;
        } else {
            return null;
        }
    }
297277
public function rowNumColumns($position = null)
    {
        if ($position === null) {
            $position = $this->position();
        }

        $row = $this->rowData($position);
        if ($row === null) {
            return null;
        } else {
            return array_sum($row['columns']);
        }
    }
198460
public void containsRow(@NullableDecl Object rowKey) {
    check("rowKeySet()").that(actual().rowKeySet()).contains(rowKey);
  }
322635
private void checkColumn(int column) throws SQLException {

        if (column < 1 || column > columnCount) {
            throw Util.sqlException(ErrorCode.JDBC_COLUMN_NOT_FOUND,
                                    String.valueOf(column));
        }
    }
42312
@Override
    public boolean contains(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        return indexForColumnName(key) >= 0;
    }
655190
public function isLocalColumnsRequired()
    {
        foreach ($this->localColumns as $columnName) {
            if (!$this->parentTable->getColumn($columnName)->isNotNull()) {
                return false;
            }
        }

        return true;
    }
263113
public boolean hasColumns(Collection<String> columns) {
        return columns != null && this.columns.equals(new TreeSet<String>(columns));
    }
533207
private boolean checkGroupedColumn() {
        boolean allowEdit = true;
        if (getTreeTableRow().getTreeItem() != null) {
            Object rowObject = getTreeTableRow().getTreeItem().getValue();
            if (rowObject instanceof RecursiveTreeObject && rowObject.getClass() == RecursiveTreeObject.class) {
                allowEdit = false;
            } else {
                // check grouped columns in the tableview
                if (getTableColumn() instanceof JFXTreeTableColumn && ((JFXTreeTableColumn) getTableColumn()).isGrouped()) {
                    // make sure that the object is a direct child to a group node
                    if (getTreeTableRow().getTreeItem().getParent() != null &&
                        getTreeTableRow().getTreeItem().getParent().getValue().getClass() == RecursiveTreeObject.class) {
                        allowEdit = false;
                    }
                }
            }
        }
        return allowEdit;
    }
188130
public static int[] columnIndexes(CSTable table, String name) {
        List<Integer> l = new ArrayList<Integer>();
        for (int i = 1; i <= table.getColumnCount(); i++) {
            if (table.getColumnName(i).startsWith(name)) {
                l.add(i);
            }
        }
        if (l.isEmpty()) {
            return null;
        }
        int[] idx = new int[l.size()];
        for (int i = 0; i < idx.length; i++) {
            idx[i] = l.get(i);
        }
        return idx;
    }
1096435
Constraint getFKConstraintForColumns(Table tableMain, int[] mainCols,
                                         int[] refCols) {

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.isEquivalent(tableMain, mainCols, this, refCols)) {
                return c;
            }
        }

        return null;
    }
521633
private void removeDominatedColumns(DoubleMatrix1D c,
			DoubleMatrix2D A, DoubleMatrix1D b, 
			DoubleMatrix1D lb, DoubleMatrix1D ub, 
			DoubleMatrix1D ylb, DoubleMatrix1D yub,
			DoubleMatrix1D zlb, DoubleMatrix1D zub) {
		for(short col=0; col<this.vColPositions.length; col++){
			short[] vColPositionsCol = vColPositions[col];
			if(vColPositionsCol==null || vColPositionsCol.length==0){
				continue;
			}
			double e = 0.;
			double d = 0.;
			//it will be e <= d
			for(int i=0; i<vColPositionsCol.length; i++){
				short row = vColPositionsCol[i]; 
				double AIJ = A.getQuick(row, col);
				if(AIJ > 0){
					e += AIJ * ylb.getQuick(row); 
					d += AIJ * yub.getQuick(row);
				}else{
					e += AIJ * yub.getQuick(row); 
					d += AIJ * ylb.getQuick(row);
				}
			}
			
			double cmd = c.getQuick(col) - d;
			double cme = c.getQuick(col) - e;
			//logger.debug("cmd: " +cmd);
			//logger.debug("cme: " +cme);
			boolean isCmdPositive = cmd > 0 && !isZero(cmd);//strictly > 0
			boolean isCmeNegative = cme < 0 && !isZero(cme);//strictly < 0
			boolean isLBColUnbounded = isLBUnbounded(lb.getQuick(col));
			boolean isUBColUnbounded = isUBUnbounded(ub.getQuick(col));
			
			if(isCmdPositive || isCmeNegative){
			  //dominated column
				log.debug("found dominated column: " + col);
				if(isCmdPositive){
					zlb.setQuick(col, 0);
					if(isLBColUnbounded){
						log.debug("unbounded problem");
						throw new RuntimeException("unbounded problem");
					}
					ub.setQuick(col, lb.getQuick(col));
					log.debug("x[" + col + "]="+lb.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, lb.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
				}else if(isCmeNegative){
					zub.setQuick(col, 0);
					if(isUBColUnbounded){
						log.debug("unbounded problem");
						throw new RuntimeException("unbounded problem");
					}
					lb.setQuick(col, ub.getQuick(col));
					log.debug("x[" + col + "]="+ub.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, ub.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
				}
				continue;
			}
			
			//here we have cmd<=0 and cme>=0 (can even be unbounded)
			
			if(vColPositionsCol.length>1){//the column singletons are used to generate the bounds d and e and therefore they cannot be dropped with this test
				if(!isLBColUnbounded && isZero(cmd)){	
					//weakly dominated column, see A. & A. (27), (28)
					log.debug("found weakly dominated column: " + col);
					ub.setQuick(col, lb.getQuick(col));
					log.debug("x[" + col + "]="+lb.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, lb.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
					continue;
				}
				if(!isUBColUnbounded && isZero(cme)){	
					//weakly dominated column, see A. & A. (27), (28)
					log.debug("found weakly dominated column: " + col);
					lb.setQuick(col, ub.getQuick(col));
					log.debug("x[" + col + "]="+ub.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, ub.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
					continue;
				}
			}
			
			if(!isLBColUnbounded && isUBColUnbounded){
				//new bounds on the optimal Lagrange multipliers y
				for(int i=0; i<vColPositionsCol.length; i++){
					short row = vColPositionsCol[i]; 
					double AIJ = A.getQuick(row, col);
					if(AIJ > 0){
						if(!isUBUnbounded(cme/AIJ + ylb.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							yub.setQuick(row, Math.min(yub.getQuick(row), cme/AIJ + ylb.getQuick(row)));
						}
					}else{
						if(!isLBUnbounded(cme/AIJ + yub.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							ylb.setQuick(row, Math.max(ylb.getQuick(row), cme/AIJ + yub.getQuick(row)));
						}
					}
				}
			}
			if(isLBColUnbounded && !isUBColUnbounded){
			  //new bounds on the optimal Lagrange multipliers y
				for(int i=0; i<vColPositionsCol.length; i++){
					short row = vColPositionsCol[i]; 
					double AIJ = A.getQuick(row, col);
					if(AIJ > 0){
						if(!isLBUnbounded(cmd/AIJ + yub.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							ylb.setQuick(row, Math.max(ylb.getQuick(row), cmd/AIJ + yub.getQuick(row)));
						}
					}else{
						if(!isUBUnbounded(cmd/AIJ + ylb.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							yub.setQuick(row, Math.min(yub.getQuick(row), cmd/AIJ + ylb.getQuick(row)));
						}
					}
				}
			}
		}
	}
900178
private boolean hasNotNull(AnnotationRepository annotationRepository, Annotation annotation)
   {
      Collection<Annotation> values = annotationRepository.getAnnotation(javax.validation.constraints.NotNull.class);

      if (values == null || values.isEmpty())
         return false;

      for (Annotation notNullAnnotation : values)
      {
         if (notNullAnnotation.getClassName().equals(annotation.getClassName()) &&
             notNullAnnotation.getMemberName().equals(annotation.getMemberName()))
            return true;
      }

      return false;
   }