Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#NO_OPTIMUM_COMPUTED_YET

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#NO_OPTIMUM_COMPUTED_YET . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UnivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method returns the best point only. This method returns all the points
 * found at the end of each starts, including the best one already
 * returned by the {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method did throw an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 2
Source File: MultiStartUnivariateOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Gets all the optima found during the last call to {@code optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@code optimize} method returns the best point only.
 * This method returns all the points found at the end of each starts,
 * including the best one already returned by the {@code optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@code optimize} method did throw
 * an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link #optimize(OptimizationData[])
 * optimize} has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 3
Source File: MultiStartUnivariateOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Gets all the optima found during the last call to {@code optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@code optimize} method returns the best point only.
 * This method returns all the points found at the end of each starts,
 * including the best one already returned by the {@code optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@code optimize} method did throw
 * an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link #optimize(OptimizationData[])
 * optimize} has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 4
Source File: UnivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method returns the best point only. This method returns all the points
 * found at the end of each starts, including the best one already
 * returned by the {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method did throw an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 5
Source File: BaseMultivariateVectorMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateVectorFunction,double[],double[],double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts, including
 * the best one already returned by the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e. in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method did
 * throw a {@link ConvergenceException}). This also means that if
 * the first element is not {@code null}, it is the best point found
 * across all starts.
 *
 * @return array containing the optima
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} has not been
 * called.
 */
public PointVectorValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 6
Source File: BaseMultivariateVectorMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateVectorFunction,double[],double[],double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts, including
 * the best one already returned by the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e. in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method did
 * throw a {@link ConvergenceException}). This also means that if
 * the first element is not {@code null}, it is the best point found
 * across all starts.
 *
 * @return array containing the optima
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} has not been
 * called.
 */
public PointVectorValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 7
Source File: UnivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method returns the best point only. This method returns all the points
 * found at the end of each starts, including the best one already
 * returned by the {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method did throw an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 8
Source File: MultiStartUnivariateOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Gets all the optima found during the last call to {@code optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@code optimize} method returns the best point only.
 * This method returns all the points found at the end of each starts,
 * including the best one already returned by the {@code optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@code optimize} method did throw
 * an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link #optimize(OptimizationData[])
 * optimize} has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 9
Source File: BaseMultivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts,
 * including the best one already returned by the {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method did throw an exception.
 * This also means that if the first element is not {@code null}, it
 * is the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}
 * has not been called.
 */
public PointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 10
Source File: BaseMultivariateVectorMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateVectorFunction,double[],double[],double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts, including
 * the best one already returned by the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e. in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method did
 * throw a {@link ConvergenceException}). This also means that if
 * the first element is not {@code null}, it is the best point found
 * across all starts.
 *
 * @return array containing the optima
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} has not been
 * called.
 */
public PointVectorValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 11
Source File: BaseMultivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts,
 * including the best one already returned by the {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method did throw an exception.
 * This also means that if the first element is not {@code null}, it
 * is the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}
 * has not been called.
 */
public PointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 12
Source File: BaseMultivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts,
 * including the best one already returned by the {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method did throw an exception.
 * This also means that if the first element is not {@code null}, it
 * is the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}
 * has not been called.
 */
public PointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 13
Source File: UnivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method returns the best point only. This method returns all the points
 * found at the end of each starts, including the best one already
 * returned by the {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method did throw an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 14
Source File: UnivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method returns the best point only. This method returns all the points
 * found at the end of each starts, including the best one already
 * returned by the {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method did throw an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 15
Source File: BaseMultivariateVectorMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateVectorFunction,double[],double[],double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts, including
 * the best one already returned by the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e. in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method did
 * throw a {@link ConvergenceException}). This also means that if
 * the first element is not {@code null}, it is the best point found
 * across all starts.
 *
 * @return array containing the optima
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} has not been
 * called.
 */
public PointVectorValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 16
Source File: BaseMultivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts,
 * including the best one already returned by the {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method did throw an exception.
 * This also means that if the first element is not {@code null}, it
 * is the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}
 * has not been called.
 */
public PointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 17
Source File: UnivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method returns the best point only. This method returns all the points
 * found at the end of each starts, including the best one already
 * returned by the {@link #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * method did throw an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,UnivariateFunction,GoalType,double,double) optimize}
 * has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 18
Source File: MultiStartUnivariateOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Gets all the optima found during the last call to {@code optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@code optimize} method returns the best point only.
 * This method returns all the points found at the end of each starts,
 * including the best one already returned by the {@code optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by {@code null} elements
 * corresponding to the runs that did not converge. This means all
 * elements will be {@code null} if the {@code optimize} method did throw
 * an exception.
 * This also means that if the first element is not {@code null}, it is
 * the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link #optimize(OptimizationData[])
 * optimize} has not been called.
 */
public UnivariatePointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 19
Source File: BaseMultivariateMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts,
 * including the best one already returned by the {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link #optimize(int,MultivariateFunction,GoalType,double[])
 * optimize} method did throw an exception.
 * This also means that if the first element is not {@code null}, it
 * is the best point found across all starts.
 *
 * @return an array containing the optima.
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateFunction,GoalType,double[]) optimize}
 * has not been called.
 */
public PointValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}
 
Example 20
Source File: BaseMultivariateVectorMultiStartOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Get all the optima found during the last call to {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize}.
 * The optimizer stores all the optima found during a set of
 * restarts. The {@link #optimize(int,MultivariateVectorFunction,double[],double[],double[])
 * optimize} method returns the best point only. This method
 * returns all the points found at the end of each starts, including
 * the best one already returned by the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method.
 * <br/>
 * The returned array as one element for each start as specified
 * in the constructor. It is ordered with the results from the
 * runs that did converge first, sorted from best to worst
 * objective value (i.e. in ascending order if minimizing and in
 * descending order if maximizing), followed by and null elements
 * corresponding to the runs that did not converge. This means all
 * elements will be null if the {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} method did
 * throw a {@link ConvergenceException}). This also means that if
 * the first element is not {@code null}, it is the best point found
 * across all starts.
 *
 * @return array containing the optima
 * @throws MathIllegalStateException if {@link
 * #optimize(int,MultivariateVectorFunction,double[],double[],double[]) optimize} has not been
 * called.
 */
public PointVectorValuePair[] getOptima() {
    if (optima == null) {
        throw new MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
    }
    return optima.clone();
}