001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.math3.optim;
018
019import org.apache.commons.math3.util.Incrementor;
020
021/**
022 * Common settings for all optimization problems. Includes divergence and convergence
023 * criteria.
024 *
025 * @param <PAIR> The type of value the {@link #getConvergenceChecker() convergence
026 *               checker} will operate on. It should include the value of the model
027 *               function and point where it was evaluated.
028 * @since 3.3
029 */
030public interface OptimizationProblem<PAIR> {
031    /**
032     * Get a independent Incrementor that counts up to the maximum number of evaluations
033     * and then throws an exception.
034     *
035     * @return a counter for the evaluations.
036     */
037    Incrementor getEvaluationCounter();
038
039    /**
040     * Get a independent Incrementor that counts up to the maximum number of iterations
041     * and then throws an exception.
042     *
043     * @return a counter for the evaluations.
044     */
045    Incrementor getIterationCounter();
046
047    /**
048     * Gets the convergence checker.
049     *
050     * @return the object used to check for convergence.
051     */
052    ConvergenceChecker<PAIR> getConvergenceChecker();
053}