protected void dropPhase1Objective(){
  if (getNumObjectiveFunctions() == 1) {
    return;
  }
  final Set<Integer> columnsToDrop=new TreeSet<Integer>();
  columnsToDrop.add(0);
  for (int i=getNumObjectiveFunctions(); i < getArtificialVariableOffset(); i++) {
    final double entry=getEntry(0,i);
    if (Precision.compareTo(entry,0d,epsilon) > 0) {
      columnsToDrop.add(i);
    }
  }
  for (int i=0; i < getNumArtificialVariables(); i++) {
    int col=i + getArtificialVariableOffset();
    if (getBasicRow(col) == null) {
      columnsToDrop.add(col);
    }
  }
  final double[][] matrix=new double[getHeight() - 1][getWidth() - columnsToDrop.size()];
  for (int i=1; i < getHeight(); i++) {
    int col=0;
    for (int j=0; j < getWidth(); j++) {
      if (!columnsToDrop.contains(j)) {
        matrix[i - 1][col++]=getEntry(i,j);
      }
    }
  }
  Integer[] drop=columnsToDrop.toArray(new Integer[columnsToDrop.size()]);
  for (int i=drop.length - 1; i >= 0; i--) {
    columnLabels.remove((int)drop[i]);
  }
  this.tableau=new Array2DRowRealMatrix(matrix);
  this.numArtificialVariables=0;
  initializeBasicVariables(getNumObjectiveFunctions());
}

protected void dropPhase1Objective ( ) { if ( getNumObjectiveFunctions ( ) == 1 ) { return ; } final Set < Integer > columnsToDrop = new TreeSet < Integer > ( ) ; columnsToDrop . add ( 0 ) ; for ( int i = getNumObjectiveFunctions ( ) ; i < getArtificialVariableOffset ( ) ; i ++ ) { final double entry = getEntry ( 0 , i ) ; if ( Precision . compareTo ( entry , 0d , epsilon ) > 0 ) { columnsToDrop . add ( i ) ; } } for ( int i = 0 ; i < getNumArtificialVariables ( ) ; i ++ ) { int col = i + getArtificialVariableOffset ( ) ; if ( getBasicRow ( col ) == null ) { columnsToDrop . add ( col ) ; } } final double [ ] [ ] matrix = new double [ getHeight ( ) - 1 ] [ getWidth ( ) - columnsToDrop . size ( ) ] ; for ( int i = 1 ; i < getHeight ( ) ; i ++ ) { int col = 0 ; for ( int j = 0 ; j < getWidth ( ) ; j ++ ) { if ( ! columnsToDrop . contains ( j ) ) { matrix [ i - 1 ] [ col ++ ] = getEntry ( i , j ) ; } } } Integer [ ] drop = columnsToDrop . toArray ( new Integer [ columnsToDrop . size ( ) ] ) ; for ( int i = drop . length - 1 ; i >= 0 ; i -- ) { columnLabels . remove ( ( int ) drop [ i ] ) ; } this . tableau = new Array2DRowRealMatrix ( matrix ) ; this . numArtificialVariables = 0 ; initializeBasicVariables ( getNumObjectiveFunctions ( ) ) ; }
removes the phase 1 objective function , positive cost non - artificial variables , and the non - basic artificial variables from this tableau .
