DerivativeGenerator.java

  1. /* Copyright 2013-2022 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS 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. package org.orekit.rugged.utils;

  18. import java.util.List;

  19. import org.hipparchus.Field;
  20. import org.hipparchus.analysis.differentiation.Derivative;
  21. import org.orekit.utils.ParameterDriver;

  22. /** Generator for {@link Derivative} instances from {@link ParameterDriver}.
  23.  * <p>
  24.  * Note that this interface is for Rugged library internal use only.
  25.  * </p>
  26.  * @author Luc Maisonobe
  27.  * @since 2.0
  28.  */
  29. public interface DerivativeGenerator<T extends Derivative<T>> {

  30.     /** Get the parameters selected for estimation.
  31.      * @return parameters selected for estimation
  32.      */
  33.     List<ParameterDriver> getSelected();

  34.     /** Generate a constant {@link Derivative}.
  35.      * @param value value of the constant
  36.      * @return constant {@link Derivative}
  37.      */
  38.     T constant(double value);

  39.     /** Generate a {@link Derivative} representing the
  40.      * parameter driver either as a canonical variable or a constant.
  41.      * <p>
  42.      * The instance created is a variable only if the parameter
  43.      * has been selected for estimation, otherwise it is a constant.
  44.      * </p>
  45.      * @param driver driver for the variable
  46.      * @return variable {@link Derivative}
  47.      */
  48.     T variable(ParameterDriver driver);

  49.     /** Get the {@link Field} to which the generated derivatives belongs.
  50.      * @return {@link Field} to which the generated derivatives belongs
  51.      * @since 2.2
  52.      */
  53.     default Field<T> getField() {
  54.         return constant(0).getField();
  55.     }

  56. }