View Javadoc
1   /*
2    * Copyright (C) 2016 Alberto Irurueta Carro (alberto@irurueta.com)
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.irurueta.numerical.polynomials.estimators;
17  
18  /**
19   * Contains an evaluation of a polynomial and the point where the polynomial
20   * has been evaluated.
21   */
22  public class DirectPolynomialEvaluation extends PolynomialEvaluation {
23      /**
24       * Point where polynomial has been evaluated.
25       */
26      private double x;
27  
28      /**
29       * Constructor.
30       */
31      public DirectPolynomialEvaluation() {
32          super();
33      }
34  
35      /**
36       * Constructor.
37       *
38       * @param x          point where polynomial has been evaluated.
39       * @param evaluation evaluation of polynomial at point x.
40       */
41      public DirectPolynomialEvaluation(final double x, final double evaluation) {
42          super(evaluation);
43          this.x = x;
44      }
45  
46      /**
47       * Gets point where polynomial has been evaluated.
48       *
49       * @return point where polynomial has been evaluated.
50       */
51      public double getX() {
52          return x;
53      }
54  
55      /**
56       * Sets point where polynomial has been evaluated.
57       *
58       * @param x point where polynomial has been evaluated.
59       */
60      public void setX(final double x) {
61          this.x = x;
62      }
63  
64      /**
65       * Gets type of polynomial evaluation.
66       *
67       * @return type of polynomial evaluation.
68       */
69      @Override
70      public PolynomialEvaluationType getType() {
71          return PolynomialEvaluationType.DIRECT_EVALUATION;
72      }
73  }