void MaxSizeMatch::Allocate( ) { // augment as many times as possible // (this is an O(N^3) maximum-size matching algorithm) while( _ShortestAugmenting( ) ); // next time, start at next input to ensure fairness _prio = (_prio + 1) % _inputs; }
void MaxSizeMatch::Allocate( ) { // clear matching for ( int i = 0; i < _inputs; ++i ) { _inmatch[i] = -1; } for ( int j = 0; j < _outputs; ++j ) { _outmatch[j] = -1; } // augment as many times as possible // (this is an O(N^3) maximum-size matching algorithm) while( _ShortestAugmenting( ) ); }
void MaxSizeMatch::Allocate( ) { // clear matching for ( int i = 0; i < _inputs; ++i ) { _inmatch[i] = -1; } for ( int j = 0; j < _outputs; ++j ) { _outmatch[j] = -1; } // augment as many times as possible // (this is an O(N^3) maximum-size matching algorithm) while( _ShortestAugmenting( ) ); // next time, start at next input to ensure fairness _prio = (_prio + 1) % _inputs; }