1 | /*
|
---|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | * contributor license agreements. See the NOTICE file distributed with
|
---|
4 | * this work for additional information regarding copyright ownership.
|
---|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | * (the "License"); you may not use this file except in compliance with
|
---|
7 | * the License. You may obtain a copy of the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | * See the License for the specific language governing permissions and
|
---|
15 | * limitations under the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | package agents.anac.y2019.harddealer.math3.optimization.univariate;
|
---|
19 |
|
---|
20 | import agents.anac.y2019.harddealer.math3.analysis.UnivariateFunction;
|
---|
21 | import agents.anac.y2019.harddealer.math3.optimization.BaseOptimizer;
|
---|
22 | import agents.anac.y2019.harddealer.math3.optimization.GoalType;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * This interface is mainly intended to enforce the internal coherence of
|
---|
26 | * Commons-Math. Users of the API are advised to base their code on
|
---|
27 | * the following interfaces:
|
---|
28 | * <ul>
|
---|
29 | * <li>{@link agents.anac.y2019.harddealer.math3.optimization.univariate.UnivariateOptimizer}</li>
|
---|
30 | * </ul>
|
---|
31 | *
|
---|
32 | * @param <FUNC> Type of the objective function to be optimized.
|
---|
33 | *
|
---|
34 | * @deprecated As of 3.1 (to be removed in 4.0).
|
---|
35 | * @since 3.0
|
---|
36 | */
|
---|
37 | @Deprecated
|
---|
38 | public interface BaseUnivariateOptimizer<FUNC extends UnivariateFunction>
|
---|
39 | extends BaseOptimizer<UnivariatePointValuePair> {
|
---|
40 | /**
|
---|
41 | * Find an optimum in the given interval.
|
---|
42 | *
|
---|
43 | * An optimizer may require that the interval brackets a single optimum.
|
---|
44 | *
|
---|
45 | * @param f Function to optimize.
|
---|
46 | * @param goalType Type of optimization goal: either
|
---|
47 | * {@link GoalType#MAXIMIZE} or {@link GoalType#MINIMIZE}.
|
---|
48 | * @param min Lower bound for the interval.
|
---|
49 | * @param max Upper bound for the interval.
|
---|
50 | * @param maxEval Maximum number of function evaluations.
|
---|
51 | * @return a (point, value) pair where the function is optimum.
|
---|
52 | * @throws agents.anac.y2019.harddealer.math3.exception.TooManyEvaluationsException
|
---|
53 | * if the maximum evaluation count is exceeded.
|
---|
54 | * @throws agents.anac.y2019.harddealer.math3.exception.ConvergenceException
|
---|
55 | * if the optimizer detects a convergence problem.
|
---|
56 | * @throws IllegalArgumentException if {@code min > max} or the endpoints
|
---|
57 | * do not satisfy the requirements specified by the optimizer.
|
---|
58 | */
|
---|
59 | UnivariatePointValuePair optimize(int maxEval, FUNC f, GoalType goalType,
|
---|
60 | double min, double max);
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * Find an optimum in the given interval, start at startValue.
|
---|
64 | * An optimizer may require that the interval brackets a single optimum.
|
---|
65 | *
|
---|
66 | * @param f Function to optimize.
|
---|
67 | * @param goalType Type of optimization goal: either
|
---|
68 | * {@link GoalType#MAXIMIZE} or {@link GoalType#MINIMIZE}.
|
---|
69 | * @param min Lower bound for the interval.
|
---|
70 | * @param max Upper bound for the interval.
|
---|
71 | * @param startValue Start value to use.
|
---|
72 | * @param maxEval Maximum number of function evaluations.
|
---|
73 | * @return a (point, value) pair where the function is optimum.
|
---|
74 | * @throws agents.anac.y2019.harddealer.math3.exception.TooManyEvaluationsException
|
---|
75 | * if the maximum evaluation count is exceeded.
|
---|
76 | * @throws agents.anac.y2019.harddealer.math3.exception.ConvergenceException if the
|
---|
77 | * optimizer detects a convergence problem.
|
---|
78 | * @throws IllegalArgumentException if {@code min > max} or the endpoints
|
---|
79 | * do not satisfy the requirements specified by the optimizer.
|
---|
80 | * @throws agents.anac.y2019.harddealer.math3.exception.NullArgumentException if any
|
---|
81 | * argument is {@code null}.
|
---|
82 | */
|
---|
83 | UnivariatePointValuePair optimize(int maxEval, FUNC f, GoalType goalType,
|
---|
84 | double min, double max,
|
---|
85 | double startValue);
|
---|
86 | }
|
---|