Skip to content

Commit

Permalink
bugfix in AddArc
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio68 committed May 15, 2019
1 parent 833a36a commit 3cc9e52
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
8 changes: 4 additions & 4 deletions MCFSimplex/MCFSimplex.C
Original file line number Diff line number Diff line change
Expand Up @@ -1925,9 +1925,9 @@ MCFSimplex::Index MCFSimplex::AddArc( cIndex Start , cIndex End ,
if( usePrimalSimplex ) {
arcPType *arc = arcsP;
#if( QUADRATICCOST )
while( ( arc->upper != -Inf<FNumber>() ) && ( arc != stopArcsP ) )
while( ( arc != stopArcsP ) && ( arc->upper != -Inf<FNumber>() ) )
#else
while( ( arc->ident > DELETED ) && ( arc != stopArcsP ) )
while( ( arc != stopArcsP ) && ( arc->ident > DELETED ) )
#endif
arc++;

Expand All @@ -1939,7 +1939,7 @@ MCFSimplex::Index MCFSimplex::AddArc( cIndex Start , cIndex End ,
stopArcsP++;
}

Index pos = ( arc - arcsP ) + 1;
Index pos = arc - arcsP;
arc->tail = nodesP + Start + USENAME0 - 1;
arc->head = nodesP + End + USENAME0 - 1;
arc->upper = aU;
Expand Down Expand Up @@ -1967,7 +1967,7 @@ MCFSimplex::Index MCFSimplex::AddArc( cIndex Start , cIndex End ,
stopArcsD++;
}

Index pos = ( arc - arcsD ) + 1;
Index pos = arc - arcsD;
arc->tail = nodesD + Start + USENAME0 - 1;
arc->head = nodesD + End + USENAME0 - 1;
arc->upper = aU;
Expand Down
9 changes: 8 additions & 1 deletion RelaxIV/RelaxIV.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@

/*----------------------------- DYNMC_MCF_RIV ------------------------------*/

#define DYNMC_MCF_RIV 0
#define DYNMC_MCF_RIV 3

/**< Decides if the graph topology (arcs, nodes) can be changed.
If DYNMC_MCF_RIV > 0, the methods of the public interface of class that
Expand Down Expand Up @@ -297,6 +297,13 @@ class RelaxIV : public MCFClass {

/*--------------------------------------------------------------------------*/

virtual inline void GetPar( int par , double &val ) const override
{
MCFClass::GetPar( par , val );
}

/*--------------------------------------------------------------------------*/

void PreProcess( void ) override;

/**< If this method is called, a preprocessing phase is performed trying to
Expand Down
2 changes: 1 addition & 1 deletion RelaxIV/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ MCFR4INC = -I$(MCFR4DIR)

# dependencies: every .o from its .C + every recursively included .h- - - - -

$(MCFR4OBJ): $(MCFR4DIR)RelaxIV.C $(MCFClH)
$(MCFR4OBJ): $(MCFR4DIR)RelaxIV.C $(MCFR4H) $(MCFClH)
$(CC) -c $*.C -o $@ $(MCFClINC) $(SW)

############################# End of makefile ################################
4 changes: 2 additions & 2 deletions lib/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ include $(MCFSxDIR)makefile
#include $(MCFZBDIR)makefile

# RelaxIV
#MCFR4DIR = $(libMCFClDIR)RelaxIV/
#include $(MCFR4DIR)makefile
MCFR4DIR = $(libMCFClDIR)RelaxIV/
include $(MCFR4DIR)makefile

# SPTree
MCFSTDIR = $(libMCFClDIR)SPTree/
Expand Down

0 comments on commit 3cc9e52

Please sign in to comment.