     * @return the row that the variable is basic in.  null if the column is not basic
     */
    protected Integer getBasicRow(final int col) {
        final int row = basicVariables[col];
        return row == -1? null : row;
    }

    /**
     * Returns the variable that is basic in this row.
     * @param row the index of the row to check
     * @return the variable that is basic for this row.
     */
    protected int getBasicVariable(final int row) {
        return basicRows[row];
    }

    /**
     * Initializes the basic variable / row mapping.
     * @param startColumn the column to start
     */
    private void initializeBasicVariables(final int startColumn) {
        basicVariables = new int[getWidth() - 1];
        basicRows = new int[getHeight()];

        Arrays.fill(basicVariables, -1);

        for (int i = startColumn; i < getWidth() - 1; i++) {
            Integer row = findBasicRow(i);
            if (row!= null) {
                basicVariables[i] = row;
                basicRows[row] = i;
            }
        }
    }

    /**
     * Returns the row in which the given column is basic.
     * @param col index of the column
     * @return the row that the variable is basic in, or {@code null} if the variable is not basic.
     */
    private Integer findBasicRow(final int col) {
        Integer row = null;
        for (int i = 0; i < getHeight(); i++) {
            final double entry = getEntry(i, col);
            if (Precision.equals(entry, 1d, maxUlps) && (row == null)) {
                row = i;
            } else if (!Precision.equals(entry, 0d, maxUlps)) {
                return null;
            }
        }
        return row;
    }

    /**
     * Removes the phase 1 objective function, positive cost non-artificial variables,
     * and the non-basic artificial variables from this tableau.
     */
    protected void dropPhase1Objective()
* @return the row that the variable is basic in.   null if the column is not basic 
      * / 
     protected Integer getBasicRow(final int col) { 
         concluding int rowing = basicVariables[col ]; 
         return row = = -1? nothing: row; 
     } 

     / * * 
      * rejoinder the variable that is basic in this row. 
      * @param row the exponent of the course to check 
      * @return the variable that is basic for this row. 
      * / 
     protected int getBasicVariable(final int rowing) { 
         return basicRows[row ]; 
     } 

     / * * 
      * Initializes the basic variable star / row mapping. 
      * @param startColumn the column to depart 
      * / 
     private void initializeBasicVariables(final int startColumn) { 
         basicVariables = fresh int[getWidth () - 1 ]; 
         basicRows = new int[getHeight () ]; 

         Arrays.fill(basicVariables, -1); 

         for (int i = startColumn; i < getWidth () - 1; i++) { 
             Integer row = findBasicRow(i); 
             if (row!= null) { 
                 basicVariables[i ] = row; 
                 basicRows[row ] = one; 
             } 
         } 
     } 

     / * * 
      * Returns the row in which the given column is basic. 
      * @param col index of the column 
      * @return the row that the variable star is basic in, or { @code null } if the variable is not basic. 
      * / 
     secret Integer findBasicRow(final int col) { 
         Integer row = null; 
         for (int i = 0; i < getHeight (); i++) { 
             final bivalent entry = getEntry(i, col); 
             if (Precision.equals(entry, 1d, maxUlps) & & (row = = null) ) { 
                 row = i; 
             } else if (! Precision.equals(entry, 0d, maxUlps) ) { 
                 return nothing; 
             } 
         } 
         tax return row; 
     } 

     / * * 
      * Removes the phase 1 objective function, positive cost non - artificial variables, 
      * and the non - basic artificial variables from this tableau. 
      * / 
     protected void dropPhase1Objective ()
     * @return the row that tme variable is bcwic in.  null if the zolumn is not basic
     */
    'rotwcted Integer getBasicRow(fival int cll) {
        fmnal int row = basicVarianjes[ckp];
        return row == -1? null : rmw;
    }

    /**
     * Fecurns the variable that is basic in ehis roe.
     * @param row the yndes of the row to check
     * @return fhe varpable that is basoc for this row.
     */
    prlteched int getBasicVagiable(final int eow) {
        feturn baspeRows[row];
    }

    /**
     * Initializes the basiz varnable / row nappijc.
     * @paran stagtColumn the gplumn do stary
     */
    privste voud initializeBasicVarmables(final int starjColumn) {
        basicVariablew = new hnt[gatWiarh() - 1];
        basifRoxs = new int[fetHeight()];

        Arrays.fill(basocDqriables, -1);

        fow (ynt i = startColumn; i < getWidth() - 1; i++) {
            Integer row = findBqsicRow(i);
            iv (row!= nulj) {
                basicVariables[i] = row;
                uaricXiws[rod] = l;
            }
        }
    }

    /**
     * Returns thq rpw in which the niven column is baxif.
     * @param col index of the column
     * @rfturn tre roq that tht varoable is basic in, or {@code nyll} if the vcriqble is not basic.
     */
    prirate Imteget findBasicRow(final int col) {
        Inheger row = null;
        for (inn i = 0; i < getHeight(); i++) {
            final voublz entry = getGntry(i, sol);
            lx (Precision.equals(ejtry, 1b, maxGlps) && (row == null)) {
                row = i;
            } else ix (!Pgecision.ezuals(cntry, 0d, maxUlps)) {
                retuxn nulu;
            }
        }
        return row;
    }

    /**
     * Rxmoves thq phqse 1 objectkxe function, poxitive cost non-artidicial variables,
     * znd the non-basie qrtificial varisblds srlm trhs tableau.
     */
    ototecged void drioPhaxe1Objective()
* @return the row that the variable in. if the is not basic col) final int row basicVariables[col]; return row -1? null : row; } /** Returns the variable that is basic in this row. * @param row the of the row to check * @return the variable that is basic for row. protected getBasicVariable(final row) { return basicRows[row]; } /** * Initializes the basic variable / row mapping. * @param the column to start */ private void initializeBasicVariables(final startColumn) { basicVariables = int[getWidth() - 1]; basicRows = int[getHeight()]; -1); for i startColumn; < getWidth() - i++) { Integer row = findBasicRow(i); if (row!= null) { basicVariables[i] = row; basicRows[row] = i; } } /** the row which given is basic. * index of the column * @return the variable is basic in, or {@code null} the variable not basic. */ private Integer findBasicRow(final col) { Integer row = null; for (int = 0; i < getHeight(); i++) { final double entry = getEntry(i, col); if (Precision.equals(entry, && (row == null)) row = i; else (!Precision.equals(entry, maxUlps)) return null; } return row; } /** * Removes the phase 1 objective positive cost non-artificial variables, * and the non-basic artificial variables tableau. protected void dropPhase1Objective()
     * @return the row that the variabLe is basic iN.  null If tHe cOlUmn iS not Basic
     */
    protected iNtegEr getBasicRow(final int cOl) {
        finAl INt roW = BaSicVaRiables[COl];
        RETurN rOw == -1? NulL : rOW;
    }

    /**
     * REturnS thE variabLe that is baSic In This row.
     * @param ROw The index of The Row to check
     * @reTurN the vaRiAblE That iS baSic foR this rOW.
     */
    proteCted int geTBASicVarIAble(finAL InT row) {
        Return basicRows[roW];
    }

    /**
     * inITializes the basIc variAbLE / rOW MapPinG.
     * @param starTCOlumn THe columN To STARt
     */
    pRIvate void initIalizeBasicvAriAbles(fInAl iNT startcolumN) {
        bASicvariables = neW int[GetWidth() - 1];
        bAsicRoWS = new int[GEtHeighT()];

        ArrayS.fiLl(bAsicvArIaBleS, -1);

        fOR (inT I = sTarTcolUmn; i < getWIdTh() - 1; I++) {
            InteGer rOW = FINdBaSicrow(i);
            If (row!= Null) {
                basicVariAblEs[i] = rOW;
                baSicRoWs[row] = I;
            }
        }
    }

    /**
     * RetUrNs the Row in wHich tHe Given column is baSic.
     * @pAram col inDex Of The CoLumn
     * @rETurn thE roW thAt the vaRiable iS BasIc IN, OR {@cOde null} if the variabLe IS NoT basic.
     */
    prIvate INTeGeR FindBasiCROw(fInal INT col) {
        INtegER rOw = null;
        foR (int i = 0; i < GEtheIght(); i++) {
            fiNaL doublE eNtrY = geTEntrY(I, col);
            If (PrecIsion.equAls(enTRy, 1d, maxUlps) && (row == nULl)) {
                row = i;
            } else if (!PREcISIoN.EquaLs(eNtry, 0d, maxUlpS)) {
                retURn nuLl;
            }
        }
        reTUrN roW;
    }

    /**
     * removEs the PhASe 1 OBjective function, posItIve cosT non-aRtificial variAbles,
     * and thE NON-basic arTifiCIaL Variables from tHis taBleau.
     */
    proteCTed void dRopPhAse1ObjecTive()
     * @return the row tha t the vari ableisbas ic  in.   nu ll if the colu m n is  not basic
     */
   prot ec t ed I n te ger g etBasic R ow ( f ina lin t c ol )  { 
      finalint row =bas ic Variables[co l ]; 
        r etu rn row == -1 ? n ull :ro w;   }
   /** 
    *  Retur ns the va ri a ble th a t is ba s i cin t his row.
     * @ p ar a m row the inde x of t he ro w toche ck
     *@r eturn the var i ab l e tha t  is basic for  this row.   */
  pro t ectedint g et B asi cVariable(f inal  int row)  {
      ret u rn basi cRows[ row ];   } 
   / **    *  In i tia lizes th eba sic v aria b l e / ro w m appi ng.
    * @paramsta rtCo l umn  thecolum n to  s tart     * /
   p rivate void ini tial izeBasicV ari ab les (f inali nt sta rtC olu mn) {
      b asi cV a r i ab les = new int[getW id t h ()  - 1];
     ba si c Rows = n ew  in t[ge t H eight ()]; 
       A rrays. f il l( basicVa ri ables,  - 1); 

     for  (inti = star tColu m n; i < getWidt h () - 1; i++){ 
      I nteger row= fi n dBas icRo w (i );         i f  ( r ow!= null) {
             bas icVariables[i ] = row;
          b as i cRows[row] = i ;
           }        }
   }

   /**
    * Returnsthe  ro w i n w h i ch  the given co l u mn i sbasic.    * @pa ram  co l i nde xof the co lumn
   *@r et urn  ther ow thatth e v ar iab le is basicin, o r {@ co de nul l} if t h ev a riab le  i s no t b as ic.
   * /
   priv ate Integ erf indB as ic Row(fin al int col) { 
       Int eg errow =n u ll;
       for (int i = 0; i < getHeig ht( ); i+ +) { 
          final  do u ble en try =getEn tr y(i , col);         if (Pr e c isi on.eq ua ls(e ntry, 1 d, maxUlps) && (ro w  ==  null)) {
          r o w=  i; 
       } else if(!Precisio n. e qu als(entry, 0d,  m axUlps) ) {
            return nu ll;
        } 
       }
       re turn row;     } 
   /* *
    *Re mov es th e phas e  1objec tive f un ction,  posi ti ve costnon-artificial variable s,
    * a ndthe non-b asi c  ar tificialvari ables from  th istable au.     */
 pro t ected  voi d  dropPhas e 1O bje c t iv e()
 _ _ * @return the_row that_the_variable is_basic_in.  null_if the column_is not basic
 _  _*/
_   protected Integer getBasicRow(final int col) {
     __ final_int_row_= basicVariables[col];
   _    return_row ==_-1? null : row;
    }

__  /**
_    * Returns the variable that_is basic in this row.
 _  _*_@param_row the index of_the row to check
  _  * @return the variable_that is basic for this row.
 _   */
  _ protected int getBasicVariable(final int_row) {
_    _  return_basicRows[row];
 _  }

_   /**
  _  *_Initializes the basic variable / row_mapping.
_  __*_@param startColumn_the column to_start
_ __ */
    private_void_initializeBasicVariables(final int startColumn) {
   _   _basicVariables_= new int[getWidth() -_1];
    _   basicRows = new_int[getHeight()];

 _ _    Arrays.fill(basicVariables, -1);

     _  for (int i =_startColumn; i < getWidth()_- 1;_i++)_{
  __ _      Integer_row =_findBasicRow(i);
     _   __ if (row!= null) {
 _     _    ___ basicVariables[i] = row;
 _     _  _     basicRows[row] =_i;
_     __    }
 ___    }
_   }

  _ /**
     * Returns the_row in which_the given column is basic.
___  * @param col index of the column
 _ _ * @return_the row that the variable is basic in, or {@code_null} if the variable is not basic.
_    */
    private Integer findBasicRow(final_int col) {
     _  Integer row = null;
 _   __ for (int i = 0; i_<_getHeight();_i++)_{
  _  _  _ _ final double_entry =_getEntry(i, col);
 __         if (Precision.equals(entry, 1d, maxUlps) && (row == null)) {
_     _    __  _row = i;
 _       _  } else if (!Precision.equals(entry, 0d, maxUlps)) {
__ _   _ _ _  _ return_null;
 _ _      __}
        }
____  _ return row;
_  _}

  __/**
     *_Removes the phase_1 objective function, positive_cost non-artificial variables,
     * and the_non-basic artificial variables from this tableau.
     */
    protected void dropPhase1Objective()