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 * https://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 /*
19 * This is not the original file distributed by the Apache Software Foundation
20 * It has been modified by the Hipparchus project
21 */
22
23 package org.hipparchus.ode.sampling;
24
25 /** {@link StepNormalizer Step normalizer} bounds settings. They influence
26 * whether the underlying fixed step size step handler is called for the first
27 * and last points. Note that if the last point coincides with a normalized
28 * point, then the underlying fixed step size step handler is always called,
29 * regardless of these settings.
30 * @see FieldStepNormalizer
31 * @see StepNormalizer
32 * @see StepNormalizerMode
33 */
34 public enum StepNormalizerBounds {
35 /** Do not include the first and last points. */
36 NEITHER(false, false),
37
38 /** Include the first point, but not the last point. */
39 FIRST(true, false),
40
41 /** Include the last point, but not the first point. */
42 LAST(false, true),
43
44 /** Include both the first and last points. */
45 BOTH(true, true);
46
47 /** Whether the first point should be passed to the underlying fixed
48 * step size step handler.
49 */
50 private final boolean first;
51
52 /** Whether the last point should be passed to the underlying fixed
53 * step size step handler.
54 */
55 private final boolean last;
56
57 /**
58 * Simple constructor.
59 * @param first Whether the first point should be passed to the
60 * underlying fixed step size step handler.
61 * @param last Whether the last point should be passed to the
62 * underlying fixed step size step handler.
63 */
64 StepNormalizerBounds(final boolean first, final boolean last) {
65 this.first = first;
66 this.last = last;
67 }
68
69 /**
70 * Returns a value indicating whether the first point should be passed
71 * to the underlying fixed step size step handler.
72 * @return value indicating whether the first point should be passed
73 * to the underlying fixed step size step handler.
74 */
75 public boolean firstIncluded() {
76 return first;
77 }
78
79 /**
80 * Returns a value indicating whether the last point should be passed
81 * to the underlying fixed step size step handler.
82 * @return value indicating whether the last point should be passed
83 * to the underlying fixed step size step handler.
84 */
85 public boolean lastIncluded() {
86 return last;
87 }
88 }