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; }
for (InputType input : inputs) result.add(create(input, output));
@Override public String toString() { return super.toString() + ", Slope: " + this.getSlope(); }
/** * Creates a new {@code DefaultInputOutputPair} with the given input and * output. * * @param input * The input to store. * @param output * The output to store. */ public DefaultInputOutputPair( final InputType input, final OutputType output) { super(); this.setInput(input); this.setOutput(output); }
@Override final protected InputOutputPair<Vector, Vector> completeSolver() { InputOutputPair<Vector, Vector> result = new DefaultInputOutputPair<Vector, Vector>(x0, x); A = null; residual = null; x = null; delta = 0; return result; }
localSimplex.add( DefaultInputOutputPair.create( initialPoint.getInput(), initialPoint.getOutput()) ); xi.setElement( i, x0.getElement(i) + offsetValue ); Double yi = this.data.evaluate( xi ); localSimplex.add( new DefaultInputOutputPair<Vector, Double>( xi, yi ) );
@Override public InputOutputSlopeTriplet clone() { InputOutputSlopeTriplet clone = (InputOutputSlopeTriplet) super.clone(); clone.setSlope(this.getSlope()); return clone; }
@Override final protected InputOutputPair<Vector, Vector> completeSolver() { InputOutputPair<Vector, Vector> result = new DefaultInputOutputPair<Vector, Vector>(x0, x); A = null; residual = null; x = null; delta = 0; return result; }
localSimplex.add( DefaultInputOutputPair.create( initialPoint.getInput(), initialPoint.getOutput()) ); xi.setElement( i, x0.getElement(i) + offsetValue ); Double yi = this.data.evaluate( xi ); localSimplex.add( new DefaultInputOutputPair<Vector, Double>( xi, yi ) );
/** * Creates a new {@code DefaultInputOutputPair} with the given input and * output. * * @param input * The input to store. * @param output * The output to store. */ public DefaultInputOutputPair( final InputType input, final OutputType output) { super(); this.setInput(input); this.setOutput(output); }
@Override public InputOutputSlopeTriplet clone() { InputOutputSlopeTriplet clone = (InputOutputSlopeTriplet) super.clone(); clone.setSlope(this.getSlope()); return clone; }
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; }
@Override final protected InputOutputPair<Vector, Vector> completeSolver() { InputOutputPair<Vector, Vector> result = new DefaultInputOutputPair<Vector, Vector>(x0, x); A = null; residual = null; x = null; delta = 0; AtransB = null; return result; }
for (InputType input : inputs) result.add(create(input, output));
localSimplex.add( DefaultInputOutputPair.create( initialPoint.getInput(), initialPoint.getOutput()) ); xi.setElement( i, x0.getElement(i) + offsetValue ); Double yi = this.data.evaluate( xi ); localSimplex.add( new DefaultInputOutputPair<Vector, Double>( xi, yi ) );
/** * Creates a new {@code DefaultInputOutputPair} with the given input and * output. * * @param input * The input to store. * @param output * The output to store. */ public DefaultInputOutputPair( final InputType input, final OutputType output) { super(); this.setInput(input); this.setOutput(output); }
@Override public String toString() { return super.toString() + ", Slope: " + this.getSlope(); }
@Override public InputOutputSlopeTriplet clone() { InputOutputSlopeTriplet clone = (InputOutputSlopeTriplet) super.clone(); clone.setSlope(this.getSlope()); return clone; }
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; }
@Override final protected InputOutputPair<Vector, Vector> completeSolver() { InputOutputPair<Vector, Vector> result = new DefaultInputOutputPair<Vector, Vector>(x0, x); A = null; residual = null; x = null; delta = 0; AtransB = null; return result; }