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  import java.io.Serializable;
19  
20  /**
21   * Contains an evaluation of a polynomial and the point where the
22   * polynomial has been evaluated.
23   */
24  public abstract class PolynomialEvaluation implements Serializable {
25      /**
26       * Evaluation of polynomial at point x.
27       */
28      private double evaluation;
29  
30      /**
31       * Constructor.
32       */
33      protected PolynomialEvaluation() {
34      }
35  
36      /**
37       * Constructor.
38       *
39       * @param evaluation evaluation of polynomial at a point x.
40       */
41      protected PolynomialEvaluation(final double evaluation) {
42          this.evaluation = evaluation;
43      }
44  
45      /**
46       * Gets evaluation of polynomial at point x.
47       *
48       * @return evaluation of polynomial at point x.
49       */
50      public double getEvaluation() {
51          return evaluation;
52      }
53  
54      /**
55       * Sets evaluation of polynomial at point x.
56       *
57       * @param evaluation evaluation of polynomial at point x.
58       */
59      public void setEvaluation(final double evaluation) {
60          this.evaluation = evaluation;
61      }
62  
63      /**
64       * Gets type of polynomial evaluation.
65       *
66       * @return type of polynomial evaluation.
67       */
68      public abstract PolynomialEvaluationType getType();
69  }