Performs one iteration

@return true if it has converged or false if not
550383
public boolean iterate() {
		boolean converged;
		switch( mode ) {
			case COMPUTE_DERIVATIVES:
				totalFullSteps++;
				converged = updateDerivates();
				if( !converged ) {
					totalSelectSteps++;
					converged = computeStep();
				}
				break;

			case DETERMINE_STEP:
				totalSelectSteps++;
				converged = computeStep();
				break;

			case CONVERGED:
				return true;

			default:
				throw new RuntimeException("BUG! mode="+mode);
		}

		if( converged ) {
			mode = Mode.CONVERGED;
			return true;
		} else {
			return false;
		}
	}
1309208
public boolean hasNext()
  {
    boolean hasNext = false;

    if(_currentSubIterator == null || !_currentSubIterator.hasNext())
    {
      nextQueue();
    }

    if(_currentSubIterator != null)
    {
      hasNext = _currentSubIterator.hasNext(); 
    }
    
    return hasNext;
  }
1207760
public boolean find() {
    if (findIterator == null) {
      findIterator = root.iterator();
    }
    if (findCurrent != null && matches()) {
      return true;
    }
    while (findIterator.hasNext()) {
      findCurrent = findIterator.next();
      resetChildIter(findCurrent);
      if (matches()) {
        return true;
      }
    }
    return false;
  }
1164892
public boolean nextBatch() throws IOException {
    for (WritableColumnVector vector : columnVectors) {
      vector.reset();
    }
    columnarBatch.setNumRows(0);
    if (rowsReturned >= totalRowCount) return false;
    checkEndOfRowGroup();

    int num = (int) Math.min((long) capacity, totalCountLoadedSoFar - rowsReturned);
    for (int i = 0; i < columnReaders.length; ++i) {
      if (columnReaders[i] == null) continue;
      columnReaders[i].readBatch(num, columnVectors[i]);
    }
    rowsReturned += num;
    columnarBatch.setNumRows(num);
    numBatched = num;
    batchIdx = 0;
    return true;
  }
940453
private boolean hasNextLazy() {
        try {
            while (true) {
                switch (this.queryState) {
                    case REGULAR:
                        if (this.elements != null) {
                            return true;
                        } else {
                            if (this.queryResult != null) {
                                iterateRegularQueries();
                                this.first = false;
                            }
                            if (this.elements == null) {
                                closePreparedStatement();
                                //try the next distinctQueryStack
                                if (this.distinctQueriesIterator.hasNext()) {
                                    this.currentDistinctQueryStack = this.distinctQueriesIterator.next();
                                    this.subQueryStacks = SchemaTableTree.splitIntoSubStacks(this.currentDistinctQueryStack);
                                    this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                    //if there are duplicates in the stack we can not execute drop steps.
                                    //execute the query as per normal and the proper DropStep will do the rest.
                                    if (this.currentDistinctQueryStack.getLast().isDrop() && !this.currentRootSchemaTableTree.duplicatesInStack(currentDistinctQueryStack)) {
                                        executeDropQuery();
                                    } else {
                                        executeRegularQuery();
                                    }
                                    this.first = true;
                                } else {
                                    //try the next rootSchemaTableTree
                                    if (this.rootSchemaTableTreeIterator.hasNext()) {
                                        this.currentRootSchemaTableTree = this.rootSchemaTableTreeIterator.next();
                                        this.distinctQueriesIterator = this.currentRootSchemaTableTree.constructDistinctQueries().iterator();
                                    } else {
                                        if (this.currentRootSchemaTableTree != null) {
                                            this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                        }
                                        this.queryState = QUERY.OPTIONAL;
                                        this.rootSchemaTableTreeIterator = this.rootSchemaTableTrees.iterator();
                                        break;
                                    }
                                }
                            }
                        }
                        break;
                    case OPTIONAL:
                        if (this.elements != null) {
                            return true;
                        } else {
                            if (this.queryResult != null) {
                                iterateOptionalQueries();
                                this.first = false;
                            }
                            if (this.elements == null) {
                                closePreparedStatement();
                                //try the next distinctQueryStack
                                if (this.optionalLeftJoinResultsIterator.hasNext()) {
                                    this.optionalCurrentLeftJoinResult = this.optionalLeftJoinResultsIterator.next();
                                    this.subQueryStacks = SchemaTableTree.splitIntoSubStacks(this.optionalCurrentLeftJoinResult.getLeft());
                                    this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                    executeOptionalQuery();
                                    this.first = true;
                                } else {
                                    //try the next rootSchemaTableTree
                                    if (this.rootSchemaTableTreeIterator.hasNext()) {
                                        this.currentRootSchemaTableTree = this.rootSchemaTableTreeIterator.next();
                                        List<Pair<LinkedList<SchemaTableTree>, Set<SchemaTableTree>>> leftJoinResult = new ArrayList<>();
                                        SchemaTableTree.constructDistinctOptionalQueries(this.currentRootSchemaTableTree, leftJoinResult);
                                        this.optionalLeftJoinResultsIterator = leftJoinResult.iterator();
                                    } else {
                                        if (this.currentRootSchemaTableTree != null) {
                                            this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                        }
                                        this.queryState = QUERY.EMIT;
                                        this.rootSchemaTableTreeIterator = this.rootSchemaTableTrees.iterator();
                                        break;
                                    }
                                }
                            }
                        }
                        break;
                    case EMIT:
                        if (this.elements != null) {
                            return true;
                        } else {
                            if (this.queryResult != null) {
                                iterateEmitQueries();
                                this.first = false;
                            }
                            if (this.elements == null) {
                                closePreparedStatement();
                                //try the next distinctQueryStack
                                if (this.emitLeftJoinResultsIterator.hasNext()) {
                                    this.emitCurrentLeftJoinResult = this.emitLeftJoinResultsIterator.next();
                                    this.subQueryStacks = SchemaTableTree.splitIntoSubStacks(this.emitCurrentLeftJoinResult);
                                    this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                    executeEmitQuery();
                                    this.first = true;
                                } else {
                                    //try the next rootSchemaTableTree
                                    if (this.rootSchemaTableTreeIterator.hasNext()) {
                                        this.currentRootSchemaTableTree = this.rootSchemaTableTreeIterator.next();
                                        List<LinkedList<SchemaTableTree>> leftJoinResult = new ArrayList<>();
                                        SchemaTableTree.constructDistinctEmitBeforeQueries(this.currentRootSchemaTableTree, leftJoinResult);
                                        this.emitLeftJoinResultsIterator = leftJoinResult.iterator();
                                        if (currentRootSchemaTableTree.isFakeEmit()) {
                                            List<Emit<SqlgElement>> fake = new ArrayList<>();
                                            fake.add(new Emit<>());
                                            this.elements = fake;
                                            this.currentRootSchemaTableTree.setFakeEmit(false);
                                        }
                                    } else {
                                        if (this.currentRootSchemaTableTree != null) {
                                            this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                        }
                                        return false;
                                    }
                                }
                            }
                        }
                        break;
                }
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
615451
public boolean performFinish() {
		final String containerName = page.getContainerName();
		final int    mep = page.getSelectedMep();
		final TransportEnum inboundTransport = page.getSelectedInboundTransport();
		final TransportEnum outboundTransport = page.getSelectedOutboundTransport();
		final TransformerEnum transformerType = page.getTransformerType(); 

		IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
		final String mavenHome = prefs.getString(P_MAVEN_HOME);
		final int mavenEclipseGoalType = MavenEclipseGoalEnum.ECLIPSE_ECLIPSE.ordinal();
		
		final String serviceName = page.getServiceName();
		IRunnableWithProgress op = new IRunnableWithProgress() {
			public void run(IProgressMonitor monitor) throws InvocationTargetException {
				try {
					doFinish(mavenHome, mavenEclipseGoalType, containerName, mep, inboundTransport, outboundTransport, transformerType, serviceName, monitor);
				} catch (CoreException e) {
					e.printStackTrace();
					throw new InvocationTargetException(e);
				} catch (Throwable e) {
					e.printStackTrace();
					if (e instanceof RuntimeException) {
						throw (RuntimeException)e;
					} else {
						throw new InvocationTargetException(e);
					}
				} finally {
					monitor.done();
				}
			}
		};
		try {
			getContainer().run(true, false, op);
		} catch (InterruptedException e) {
			return false;
		} catch (InvocationTargetException e) {
			Throwable realException = e.getTargetException();
			MessageDialog.openError(getShell(), "Error", realException.getMessage());
			return false;
		}
		return true;
	}
429257
private boolean processStepResults(double fx_candidate, double actualReduction, double predictedReduction) {
		double ratio = actualReduction/predictedReduction;
		boolean accepted;

		// Accept the new state if the score improved
		if( fx_candidate < fx ) {
			// reduce the amount of dampening.  Magic equation from [1].  My attempts to improve
			// upon it have failed.  It is truly magical.
			lambda = lambda* max(1.0/3.0, 1.0-Math.pow(2.0*ratio-1.0,3.0));
			nu=NU_INITIAL;
			accepted = true;
		} else {
			lambda *= nu;
			nu *= 2;
			accepted = false;
		}

		if( UtilEjml.isUncountable(lambda) || UtilEjml.isUncountable(nu) )
			throw new OptimizationException("BUG! lambda="+lambda+"  nu="+nu);

		if( accepted ) {
			boolean converged = checkConvergenceFTest(fx_candidate,fx);
			if( verbose != null ) {
				double length_p = NormOps_DDRM.normF(p); // TODO compute elsewhere ?
				verbose.printf("%-4d  %9.3E  %10.3E  %9.3E  %9.3E  %9.3E  %6.3f   %6.2E\n",
						totalSelectSteps, fx_candidate, fx_candidate - fx,length_p,ftest_val,gtest_val, ratio, lambda);
				if( converged ) {
					verbose.println("Converged f-test");
				}
			}

			acceptNewState(fx_candidate);
			return maximumLambdaNu() || converged;
		} else
			return false;
	}
476507
public boolean isMultiPoint() {
    boolean mp = true;
    if (this == UNDEFINED) { mp = false; }
    else if (this == NULL) { mp = false; }
    else if (this == POINT) { mp = false; }
    return mp;
  }
1200807
public boolean performFinish() {
		final IEclipsePreferences prefs = SARLEclipsePlugin.getDefault().getPreferences();
		final String login = this.trackerLogin.getText();
		if (Strings.isEmpty(login)) {
			prefs.remove(PREFERENCE_LOGIN);
		} else {
			prefs.put(PREFERENCE_LOGIN, login);
		}
		try {
			prefs.sync();
			return true;
		} catch (BackingStoreException e) {
			ErrorDialog.openError(getShell(), e.getLocalizedMessage(), e.getLocalizedMessage(),
					SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR, e));
			return false;
		}
	}
337278
public synchronized boolean hasMoreElementsR()
                    throws RemoteException, EnumeratorException
    {
        if (elements != null && index < elements.length) {
            return true;

        } else if (!exhausted) {

            // Reset our local cache and attempt to fetch the next batch
            // from the server

            try {
                elements = null;
                index = 0;
                elements = fetchElements(PREFETCH_COUNT);
                return true;
            } catch (NoMoreElementsException ex) {
                // We've exhausted the remote result set
                // FFDCFilter.processException(ex, CLASS_NAME + ".hasMoreElementsR",
                //                             "172", this);
                return false;
            }

        }

        // Exhausted!
        return false;

    }
293803
def done(self):
        """"""
        if self._finished or self._unfinished:
            return False
        # Clear the 'current' values when iteration is done.
        self.current_index = self.current_future = None
        return True
1312638
public boolean previous()
	{
		// see if it is back to the start already
		if( state == 0 )
			return false;
		else
			state = 1;

		for( int i = c; i >= 0; i-- ) {
			bins[i]--;

			if( i == 0 ) {
				if( bins[0] < 0 ) {
					state = 0;
					// put it back into its first combination
					for( int j = 0; j < bins.length; j++ ) {
						bins[j] = j;
					}
					return false;
				}
				break;
			} else if( bins[i] <= bins[i-1] ) {
				bins[i] = N-1-(c-i);
			} else {
				break;
			}
		}
		return true;
	}
1062540
public boolean isDone() {
        int count = 0;
        for (Pair<T, Future<?>> pair: _pairs) {
            if (pair.second.isDone()) ++count;
        }
        return count == _pairs.size();
    }
990521
@Pure
	public boolean isStartingBusHalt() {
		final BusItinerary itinerary = getContainer();
		if (itinerary != null && itinerary.isValidPrimitive()) {
			try {
				return itinerary.getBusHaltAt(0) == this;
			} catch (IndexOutOfBoundsException exception) {
				// invalid halt
			}
		}
		return false;
	}
588459
@Override
    public boolean hasConcurrents() {
        if (concurrents > 0) {
            return true;
        }
        if (CommonUtils.isNotEmpty(methods)) {
            for (MethodConfig methodConfig : methods.values()) {
                if (methodConfig.getConcurrents() != null
                    && methodConfig.getConcurrents() > 0) {
                    return true;
                }
            }
        }
        return false;
    }
480780
protected synchronized boolean isLoopOnce() {
        final String methodName = "isLoopOnce()";
        if (loopOnce) {
            traceDebug(methodName, "cacheName=" + this.cod.cacheName + " isLoopOnce=" + loopOnce + " explicitBuffer=" + explicitBuffer.size()
                    + " scanBuffer=" + this.scanBuffer.size());
        }
        return this.loopOnce;
    }
125230
def still_optimizing(self):
        """"""

        # Check if we need to give up on optimizing.
        if (self.iterations > self.max_iter) or (self.time_elapsed() > self.max_time):
            return False

        # Always optimize for at least 'min_iter' iterations.
        elif not hasattr(self, 'improvement') or (self.iterations < self.min_iter):
            return True

        # Check convergence.
        else:
            self.converged = self.improvement < self.tol
            return False if self.converged else True