if( pHigh.getOutput() < pi.getOutput() ) || (pSecondHighest.getOutput() < pi.getOutput()) ) if( pLow.getOutput() > pi.getOutput() ) double fhigh = pHigh.getOutput(); double flow = pLow.getOutput(); if( pnew.getOutput() <= pLow.getOutput() ) if( pnew.getOutput() <= pLow.getOutput() ) else if( pnew.getOutput() >= pSecondHighest.getOutput() ) double yHighSave = pHigh.getOutput(); pnew = this.pointTry( pHigh, 0.5 ); if( pnew.getOutput() > yHighSave )
if( pHigh.getOutput() < pi.getOutput() ) || (pSecondHighest.getOutput() < pi.getOutput()) ) if( pLow.getOutput() > pi.getOutput() ) double fhigh = pHigh.getOutput(); double flow = pLow.getOutput(); if( pnew.getOutput() <= pLow.getOutput() ) if( pnew.getOutput() <= pLow.getOutput() ) else if( pnew.getOutput() >= pSecondHighest.getOutput() ) double yHighSave = pHigh.getOutput(); pnew = this.pointTry( pHigh, 0.5 ); if( pnew.getOutput() > yHighSave )
if( pHigh.getOutput() < pi.getOutput() ) || (pSecondHighest.getOutput() < pi.getOutput()) ) if( pLow.getOutput() > pi.getOutput() ) double fhigh = pHigh.getOutput(); double flow = pLow.getOutput(); if( pnew.getOutput() <= pLow.getOutput() ) if( pnew.getOutput() <= pLow.getOutput() ) else if( pnew.getOutput() >= pSecondHighest.getOutput() ) double yHighSave = pHigh.getOutput(); pnew = this.pointTry( pHigh, 0.5 ); if( pnew.getOutput() > yHighSave )
public double differentiate( double input ) { double output; if( this.lastEvaluation == null ) { output = this.evaluate(input); this.lastEvaluation = new DefaultInputOutputPair<Double, Double>(input,output); } else if( this.lastEvaluation.getInput() == input ) { output = this.lastEvaluation.getOutput(); } else { output = this.evaluate(input); this.lastEvaluation.setInput(input); this.lastEvaluation.setOutput(output); } double dx = FORWARD_DIFFERENCE; double dy = this.evaluate( input + dx ) - output; return dy / dx; }
public double differentiate( double input ) { double output; if( this.lastEvaluation == null ) { output = this.evaluate(input); this.lastEvaluation = new DefaultInputOutputPair<Double, Double>(input,output); } else if( this.lastEvaluation.getInput() == input ) { output = this.lastEvaluation.getOutput(); } else { output = this.evaluate(input); this.lastEvaluation.setInput(input); this.lastEvaluation.setOutput(output); } double dx = FORWARD_DIFFERENCE; double dy = this.evaluate( input + dx ) - output; return dy / dx; }
public double differentiate( double input ) { double output; if( this.lastEvaluation == null ) { output = this.evaluate(input); this.lastEvaluation = new DefaultInputOutputPair<Double, Double>(input,output); } else if( this.lastEvaluation.getInput() == input ) { output = this.lastEvaluation.getOutput(); } else { output = this.evaluate(input); this.lastEvaluation.setInput(input); this.lastEvaluation.setOutput(output); } double dx = FORWARD_DIFFERENCE; double dy = this.evaluate( input + dx ) - output; return dy / dx; }
return this.lastEvaluation.getOutput();
return this.lastEvaluation.getOutput();
return this.lastEvaluation.getOutput();
if( ynew < pold.getOutput() )
if( ynew < pold.getOutput() )
if( ynew < pold.getOutput() )