* ************************************************************************ subroutine wkorg( liwk, pr, thr, rthr, depth, naibs, ba, su, + iss, ftstem, iw1, iw2, iw3, beptr, bep, elptr, + lwk, dir, olgra, rgra, prec, wpre, dw1, + dw2, dw3, dw4, iflag, info ) * ************************************************************************ * Purpose : * --------- * This routine organizes the integer workspace IWK and the * double precision workspace DWK. It checks if the reserved * length LIWK for the integer workspace and the reserved * length LWK for the double precision workspace are high enough. * If it is not the case, the routine exits with an error code * and the minimum necessary length for storage is set in INFO. * Parameters : * ------------ * liwk ( int ) * input : the reserved length for the integer workspace. * output : unmodified. * pr ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the predecessor vector. * thr ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the traversal vector. * rthr ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the reverse vector. * depth ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the depth vector. * naibs ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the vector containing the * number of superbasic variables in each independent * superbasic set. * ba ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the vector containing the * indices of the basic variables. * su ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the vector containing the * indices of the superbasic variables. * iss ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the vector containing for * each variable the indice of the independent set * in which it is included. * ftstem ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the vector containing for * each superbasic variable the length from the * origine node of the arc to the stem node and * the total length of its flow augmenting path. * iw1 ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the first workspace vector. * * iw2 ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the second workspace vector. * iw3 ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the third workspace vector. * beptr ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the vector containing for * each superbasic variable the position in BEP * of the first component of its flow augmenting * path. * bep ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the vector storing the flow * augmenting paths of the superbasic variables. * elptr ( int ) * input : meaningless. * output : the position in the integer array IWK, of the * first component of the vector whose kth value * is the position of the first variable of element * k in the list ELVAR. * lwk ( int ) * input : the reserved space for the double precision workspace. * output : unmodified. * dir ( int ) * input : meaningless. * output : the position in the double precision array DWK, * of the first component of the search direction * vector. * olgra ( int ) * input : meaningless. * output : the position in the double precision array DWK, * of the first component of a vector containing * the element gradients. * rgra ( int ) * input : meaningless. * output : the position in the double precision array DWK, * of the first component of the reduced gradient * vector. * prec ( log ) * input : .true. iff a diagonal preconditioner is used. * .false. iff no preconditioner is used. * output : unmodified. * wpre ( int ) * input : meaningless. * output : the position in the double precision array DWK, * of the first component of the preconditioner * vector. * dw1 ( int ) * input : meaningless. * output : the position in the double precision array DWK, * of the first component of the first double * precision workspace vector. * dw2 ( int ) * input : meaningless. * output : the position in the double precision array DWK, * of the first component of the second double * precision workspace vector. * dw3 ( int ) * input : meaningless. * output : the position in the double precision array DWK, * of the first component of the third double * precision workspace vector. * dw4 ( int ) * input : meaningless. * output : the position in the double precision array DWK, * of the first component of the fourth double * precision workspace vector. * iflag ( int ) * input : should be zero. * output : 0 iff the reserved lengths LIWK and LWK are high enough. * 1 iff the reserved length LWK for the double * precision vector DWK is too small. * 2 iff the reserved length LIWK for the integer * vector IWK is too small. * info ( int ) * input : meaningless. * output : if IFLAG = 0, meaningless. * if IFLAG = 1, the minimum necessary length for DWK. * if IFLAG = 2, the minimum necessary length for IWK. * Routine used : * -------------- * None. * Programming : * ------------- * D. Tuyttens * ======================================================================== * Routine parameters. integer liwk, pr, thr, rthr, depth, naibs, ba, su, + iss, ftstem, iw1, iw2, beptr, bep, elptr(*), + lwk, dir, olgra, rgra, wpre, dw1, dw2, dw3, + dw4, iflag, info, iw3 logical prec * Internal variables. integer eldsum, iwktot, dwktot * Common specifications integer arcs, nodes, elem common / prbdim / arcs, nodes, elem iflag = 0 eldsum = elptr(elem+1) * * Integer workspace organization. * pr = 1 thr = pr + nodes + 1 rthr = thr + nodes + 1 depth = rthr + nodes + 1 naibs = depth + nodes + 1 ba = naibs + 100 su = ba + nodes iss = su + arcs - nodes + 1 ftstem = iss + arcs iw1 = ftstem + arcs iw2 = iw1 + max( elem, max ( arcs+2 , eldsum ) ) iw3 = iw2 + max( elem, max ( arcs+2 , eldsum ) ) beptr = iw3 + elem bep = beptr + arcs * * Test length of integer workspace IWK. * iwktot = bep + 4 * arcs if ( iwktot.gt.liwk ) then iflag = 2 info = iwktot return endif * * Double precision workspace organization. * dir = 1 olgra = dir + arcs rgra = olgra + max( eldsum, arcs ) wpre = rgra + arcs if( prec ) then dw1 = wpre + arcs + eldsum + eldsum else dw1 = wpre + arcs + eldsum endif dw2 = dw1 + arcs dw3 = dw2 + arcs dw4 = dw3 + max( arcs , elem ) * * Test length of double precision workspace DWK. * dwktot = dw4 + 2*arcs if ( dwktot.gt.lwk ) then iflag = 1 info = dwktot endif * return end