congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RealPointValuePair.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.apache.commons.math.optimization.RealPointValuePair

Best Java code snippets using org.apache.commons.math.optimization.RealPointValuePair.getValue (Showing top 11 results out of 315)

origin: org.apache.commons/commons-math

  public int compare(final RealPointValuePair o1,
            final RealPointValuePair o2) {
    final double v1 = o1.getValue();
    final double v2 = o2.getValue();
    return (goalType == GoalType.MINIMIZE) ?
        Double.compare(v1, v2) : Double.compare(v2, v1);
  }
};
origin: org.apache.commons/commons-math

  public int compare(final RealPointValuePair o1, final RealPointValuePair o2) {
    if (o1 == null) {
      return (o2 == null) ? 0 : +1;
    } else if (o2 == null) {
      return -1;
    }
    final double v1 = o1.getValue();
    final double v2 = o2.getValue();
    return (goalType == GoalType.MINIMIZE) ?
        Double.compare(v1, v2) : Double.compare(v2, v1);
  }
});
origin: org.apache.commons/commons-math

  public int compare(final RealPointValuePair o1, final RealPointValuePair o2) {
    if (o1 == null) {
      return (o2 == null) ? 0 : +1;
    } else if (o2 == null) {
      return -1;
    }
    final double v1 = o1.getValue();
    final double v2 = o2.getValue();
    return (goalType == GoalType.MINIMIZE) ?
        Double.compare(v1, v2) : Double.compare(v2, v1);
  }
});
origin: org.apache.commons/math

  public int compare(final RealPointValuePair o1, final RealPointValuePair o2) {
    if (o1 == null) {
      return (o2 == null) ? 0 : +1;
    } else if (o2 == null) {
      return -1;
    }
    final double v1 = o1.getValue();
    final double v2 = o2.getValue();
    return (goalType == GoalType.MINIMIZE) ?
        Double.compare(v1, v2) : Double.compare(v2, v1);
  }
});
origin: org.apache.commons/math

  public int compare(final RealPointValuePair o1,
            final RealPointValuePair o2) {
    final double v1 = o1.getValue();
    final double v2 = o2.getValue();
    return (goalType == GoalType.MINIMIZE) ?
        Double.compare(v1, v2) : Double.compare(v2, v1);
  }
};
origin: org.apache.commons/math

  public int compare(final RealPointValuePair o1, final RealPointValuePair o2) {
    if (o1 == null) {
      return (o2 == null) ? 0 : +1;
    } else if (o2 == null) {
      return -1;
    }
    final double v1 = o1.getValue();
    final double v2 = o2.getValue();
    return (goalType == GoalType.MINIMIZE) ?
        Double.compare(v1, v2) : Double.compare(v2, v1);
  }
});
origin: org.apache.commons/math

/** {@inheritDoc} */
public boolean converged(final int iteration,
             final RealPointValuePair previous,
             final RealPointValuePair current) {
  final double p          = previous.getValue();
  final double c          = current.getValue();
  final double difference = Math.abs(p - c);
  final double size       = Math.max(Math.abs(p), Math.abs(c));
  return (difference <= (size * relativeThreshold)) || (difference <= absoluteThreshold);
}
origin: org.apache.commons/commons-math

  /** {@inheritDoc} */
  public boolean converged(final int iteration,
               final RealPointValuePair previous,
               final RealPointValuePair current) {
    final double p          = previous.getValue();
    final double c          = current.getValue();
    final double difference = FastMath.abs(p - c);
    final double size       = FastMath.max(FastMath.abs(p), FastMath.abs(c));
    return (difference <= (size * relativeThreshold)) || (difference <= absoluteThreshold);
  }
}
origin: org.apache.commons/commons-math

/** Evaluate all the non-evaluated points of the simplex.
 * @param comparator comparator to use to sort simplex vertices from best to worst
 * @exception FunctionEvaluationException if no value can be computed for the parameters
 * @exception OptimizationException if the maximal number of evaluations is exceeded
 */
protected void evaluateSimplex(final Comparator<RealPointValuePair> comparator)
  throws FunctionEvaluationException, OptimizationException {
  // evaluate the objective function at all non-evaluated simplex points
  for (int i = 0; i < simplex.length; ++i) {
    final RealPointValuePair vertex = simplex[i];
    final double[] point = vertex.getPointRef();
    if (Double.isNaN(vertex.getValue())) {
      simplex[i] = new RealPointValuePair(point, evaluate(point), false);
    }
  }
  // sort the simplex from best to worst
  Arrays.sort(simplex, comparator);
}
origin: org.apache.commons/math

/** Evaluate all the non-evaluated points of the simplex.
 * @param comparator comparator to use to sort simplex vertices from best to worst
 * @exception FunctionEvaluationException if no value can be computed for the parameters
 * @exception OptimizationException if the maximal number of evaluations is exceeded
 */
protected void evaluateSimplex(final Comparator<RealPointValuePair> comparator)
  throws FunctionEvaluationException, OptimizationException {
  // evaluate the objective function at all non-evaluated simplex points
  for (int i = 0; i < simplex.length; ++i) {
    final RealPointValuePair vertex = simplex[i];
    final double[] point = vertex.getPointRef();
    if (Double.isNaN(vertex.getValue())) {
      simplex[i] = new RealPointValuePair(point, evaluate(point), false);
    }
  }
  // sort the simplex from best to worst
  Arrays.sort(simplex, comparator);
}
origin: usethesource/rascal

  public IValue llOptimize(IBool minimize, IBool nonNegative, ISet constraints, IConstructor f) {
    SimplexSolver solver = new SimplexSolver();
    ArrayList<LinearConstraint> constraintsJ =
        new ArrayList<LinearConstraint>(constraints.size());
    for(IValue v : constraints ){
      constraintsJ.add(convertConstraint((IConstructor)v));
    }
    LinearObjectiveFunction fJ = convertLinObjFun(f);
    GoalType goal = minimize.getValue() ? 
            GoalType.MINIMIZE : GoalType.MAXIMIZE;
    IValueFactory vf = values;
    boolean nonNegativeJ =  nonNegative.getValue();
    try {
      RealPointValuePair res = 
          solver.optimize(fJ, constraintsJ, goal,nonNegativeJ);
      return vf.constructor(Maybe_just, 
          vf.constructor(
              LLSolution_llSolution, convertToRealList(res.getPoint(), vf), 
              vf.real(res.getValue()) )
          );
    } catch (Exception e) {
      return  vf.constructor(Maybe_nothing); 
    }

  }
}
org.apache.commons.math.optimizationRealPointValuePairgetValue

Javadoc

Get the value of the objective function.

Popular methods of RealPointValuePair

  • getPoint
    Get the point.
  • <init>
    Build a point/objective function value pair.
  • getPointRef
    Get a reference to the point.This method is provided as a convenience to avoid copying the array, th

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Option (scala)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now