*     *************************************************************************

      subroutine updtfl( x, obj, alpmax, rgmx, itmp,
     +                   bep, ncycle, iflag )

*     *************************************************************************

*     Purpose :
*     ---------

*     Given the maximum steplength ALPMAX allowed for keeping
*     feasibility, this routine updates the flow vector X and
*     the value of the linear objective function OBJ.

*     Parameters :
*     ------------

*     x       ( dble )

*       input  : the current iterate vector.
*       output : the component corresponding to the nonbasic
*                arc ITMP and the components corresponding to
*                the basic arcs included in the flow augmenting
*                path of arc ITMP, are updated.

*     obj     ( dble )

*       input  : the value of the linear objective function.
*       output : this value is updated.

*     alpmax  ( dble )

*       input  : the maximum steplength allowed for keeping
*                feasibility.
*       output : unmodified.

*     rgmx    ( dble )

*       input  : the reduced cost of the nonbasic arc ITMP.
*       output : unmodified.

*     itmp    ( int )

*       input  : the indice of the nonbasic variable.
*       output : unmodified.

*     bep     ( int )

*       input  : array containing the flow augmenting path
*                of the nonbasic arc ITMP.
*       output : unmodified.

*     ncycle  ( int )

*       input  : the length of the flow augmenting path
*                of the nonbasic arc ITMP.
*       output : unmodified.

*     iflag   ( int )

*       input  : must be equal to zero when the routine is
*                called.
*       output : = 14, if the value of the linear objective
*                      function does not decrease.
*                Otherwise, it remains unmodified.

*     Routines used :
*     ---------------

*     None.

*     Programming :
*     -------------

*     D. Tuyttens

*     =========================================================================

*     Routine parameters

      integer           ncycle, bep(*), itmp, iflag
      double precision  x(*), alpmax, obj, rgmx

*     Internal variables

      integer           i, iptmp
      double precision  oldobj

*     common specifications

      integer           arcs, nodes, elem
      common / prbdim / arcs, nodes, elem

*
*     We update the flow of the nonbasic variable ITMP
*     and the value of the objective function OBJ.
*
      oldobj  = obj
      if( rgmx.gt.0.0d0 ) alpmax = -alpmax
      x(itmp) = x(itmp) + alpmax
      obj     = obj     + alpmax * rgmx
*
*     We update the flows of the basic variables included
*     in the flow augmenting path of the nonbasic arc ITMP.
*
      do 10 i = 1 , ncycle
        iptmp = bep (i)
        if( iptmp.lt.0 ) then
          iptmp    = -iptmp
          x(iptmp) = x(iptmp) - alpmax
        else
          x(iptmp) = x(iptmp) + alpmax
        endif
 10   continue
*
*     We test if the value of the objective
*     function decreases.
*
      if( oldobj.lt.obj ) then
        iflag = 14
      endif
*
      return
      end