001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 package org.apache.commons.math3.optimization.fitting;
019
020 import java.io.Serializable;
021
022 /** This class is a simple container for weighted observed point in
023 * {@link CurveFitter curve fitting}.
024 * <p>Instances of this class are guaranteed to be immutable.</p>
025 * @version $Id: WeightedObservedPoint.java 1422230 2012-12-15 12:11:13Z erans $
026 * @deprecated As of 3.1 (to be removed in 4.0).
027 * @since 2.0
028 */
029 @Deprecated
030 public class WeightedObservedPoint implements Serializable {
031
032 /** Serializable version id. */
033 private static final long serialVersionUID = 5306874947404636157L;
034
035 /** Weight of the measurement in the fitting process. */
036 private final double weight;
037
038 /** Abscissa of the point. */
039 private final double x;
040
041 /** Observed value of the function at x. */
042 private final double y;
043
044 /** Simple constructor.
045 * @param weight weight of the measurement in the fitting process
046 * @param x abscissa of the measurement
047 * @param y ordinate of the measurement
048 */
049 public WeightedObservedPoint(final double weight, final double x, final double y) {
050 this.weight = weight;
051 this.x = x;
052 this.y = y;
053 }
054
055 /** Get the weight of the measurement in the fitting process.
056 * @return weight of the measurement in the fitting process
057 */
058 public double getWeight() {
059 return weight;
060 }
061
062 /** Get the abscissa of the point.
063 * @return abscissa of the point
064 */
065 public double getX() {
066 return x;
067 }
068
069 /** Get the observed value of the function at x.
070 * @return observed value of the function at x
071 */
072 public double getY() {
073 return y;
074 }
075
076 }
077