Sees if this is an improvement worth accepting. Adjust dampening parameter and change
the state if accepted.

@return true if it has converged or false if it has not
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;
	}
507094
public boolean onAdd()
    {
        Record record = this.getMainRecord();
        if (record == null)
            return false;

        try {
            if (record.isModified(false))
            {
                if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
                    record.set();
                else if (record.getEditMode() == Constants.EDIT_ADD)
                    record.add();
            }
            record.addNew();
            this.clearStatusText();
        } catch(DBException ex) {
            this.displayError(ex);
            return false;
        }
        return true;
    }
458443
public function accept() {
        switch ($this->state) {
            case self::STATE_SHEDULED:
                $this->counter -= 1;
                if ($this->counter <= 0) {
                    $this->state = self::STATE_NONE;
                    $this->counter = 0;
                }
                break;
        }
        return false;
    }
130660
public boolean performBundleAdjustment()
	{
		// Configure the sparse Levenberg-Marquardt solver
		ConfigLevenbergMarquardt configLM = new ConfigLevenbergMarquardt();
		configLM.hessianScaling = false;

		ConfigBundleAdjustment configSBA = new ConfigBundleAdjustment();
		configSBA.configOptimizer = configLM;

		BundleAdjustment<SceneStructureMetric> bundleAdjustment;
		if( robust ) {
			configLM.mixture = 0;
			bundleAdjustment = FactoryMultiView.bundleDenseMetric(true,configSBA);
		} else {
			bundleAdjustment = FactoryMultiView.bundleSparseMetric(configSBA);
		}

		bundleAdjustment.setVerbose(verbose,0);
		// Specifies convergence criteria
		bundleAdjustment.configure(1e-20, 1e-20, 200);

		bundleAdjustment.setParameters(structure,observations);
		return bundleAdjustment.optimize(structure);
	}
1026832
def _check_convergence(self, F):
        
        normF = linalg.norm(F, Inf)

        if normF < self.tolerance:
            converged = True
        else:
            converged = False
            if self.verbose:
                logger.info("Difference: %.3f" % (normF - self.tolerance))

        return converged
23720
public boolean isExceeded() {
        lastAggregatedValue = getAggregatedValue();
        lastExceededValue = false;
        switch (operator) {
            case lessThan:
                lastExceededValue = (lastAggregatedValue < thresholdValue);
                break;
            case greaterThan: lastExceededValue = (lastAggregatedValue > thresholdValue);
                break;
        }
        return lastExceededValue;
    }
421801
private function hasToBeReloaded()
    {
        if (!$this->getWurflConfig()->allowReload) {
            return false;
        }

        $state = $this->getPersistenceStorage()->load(self::WURFL_API_STATE);

        return !$this->isStateCurrent($state);
    }
592132
def is_converged(self):
        '''
        '''

        # Check for cached result
        if self._converged is None:
            self._converged = self._is_converged()
        return Property(scalars=[Scalar(value=self._converged)])
158977
public boolean isForeignKeyChanged() {
        return CollectionUtils.exists(differences.values(), new Predicate() {
            @Override
            public boolean evaluate(Object object) {
                return ((ModelDiffEntry) object).isForeignKey();
            }
        });
    }
353401
protected boolean updateState()
    {
        if (!overrideKeyboardInput)
        {
            return false;   // Let the class do the default thing.
        }
        // Update movement:
        mTicksSinceLastVelocityChange++;
        if (mTicksSinceLastVelocityChange <= mInertiaTicks)
        {
            mVelocity += (mTargetVelocity - mVelocity) * ((float)mTicksSinceLastVelocityChange/(float)mInertiaTicks);
        }
        else
        {
            mVelocity = mTargetVelocity;
        }
        
        this.overrideMovement.moveForward = mVelocity;

        // This code comes from the Minecraft MovementInput superclass - needed so as not to give the bot an unfair
        // advantage when sneaking!
        if (this.overrideMovement.sneak)
        {
            this.overrideMovement.moveStrafe = (float)((double)this.overrideMovement.moveStrafe * 0.3D);
            this.overrideMovement.moveForward = (float)((double)this.overrideMovement.moveForward * 0.3D);
        }
        updateYawAndPitch();
        return true;
    }
1207546
function() {
        var xUpdated = this._xSpring.update();
        var yUpdated = this._ySpring.update();
        var scaleUpdated = this._scaleSpring.update();
        var degreesUpdated = this._degreesSpring.update();

        if (xUpdated || yUpdated || scaleUpdated || degreesUpdated) {
            this._updateForScale();
            this._needsDraw = true;
            return true;
        }

        return false;
    }
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;
		}
	}
1314555
public function isConvergent()
	{
		for ($i=$this->interval->getStart(); $i<$this->interval->getEnd(); $i++)
		{
			$diff = abs ($this->getValue ($i+1) - $this->getValue ($i));
			if (!$old_diff) $old_diff = $diff;
			else
			{
				if ($diff >= $old_diff)
					return false;
			}
		}
		return true;
	}
1066606
def acceptEdit( self ):
        
        
        if ( self._partsWidget.isVisible() ):
            return False
        
        use_completion = self.completer().popup().isVisible()
        completion     = self.completer().currentCompletion()
        
        self._completerTree.hide()
        self.completer().popup().hide()
        
        if ( use_completion ):
            self.setText(completion)
        else:
            self.rebuild()
            
        return True
273654
public boolean isSyncEnabled() {

        CmsSynchronizeSettings syncSettings = getSettings().getUserSettings().getSynchronizeSettings();
        return (syncSettings != null) && syncSettings.isSyncEnabled();
    }
1261755
private boolean refineWithBundleAdjustment(SceneObservations observations) {
		if( scaleSBA ) {
			scaler.applyScale(structure,observations);
		}

		sba.setVerbose(verbose,verboseLevel);
		sba.setParameters(structure,observations);
		sba.configure(converge.ftol,converge.gtol,converge.maxIterations);

		if( !sba.optimize(structure) ) {
			return false;
		}

		if( scaleSBA ) {
			// only undo scaling on camera matrices since observations are discarded
			for (int i = 0; i < structure.views.length; i++) {
				DMatrixRMaj P = structure.views[i].worldToView;
				scaler.pixelScaling.get(i).remove(P,P);
			}
			scaler.undoScale(structure,observations);
		}
		return true;
	}
924316
function() {
        let shouldContinue = Math.abs(self.__decelerationVelocityX) >= minVelocityToKeepDecelerating || Math.abs(self.__decelerationVelocityY) >= minVelocityToKeepDecelerating
        if (!shouldContinue) {
          self.__didDecelerationComplete = true
        }
        return shouldContinue
      }