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
018package org.apache.commons.math3.optimization.fitting;
019
020import 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 * @deprecated As of 3.1 (to be removed in 4.0).
026 * @since 2.0
027 */
028@Deprecated
029public class WeightedObservedPoint implements Serializable {
030
031    /** Serializable version id. */
032    private static final long serialVersionUID = 5306874947404636157L;
033
034    /** Weight of the measurement in the fitting process. */
035    private final double weight;
036
037    /** Abscissa of the point. */
038    private final double x;
039
040    /** Observed value of the function at x. */
041    private final double y;
042
043    /** Simple constructor.
044     * @param weight weight of the measurement in the fitting process
045     * @param x abscissa of the measurement
046     * @param y ordinate of the measurement
047     */
048    public WeightedObservedPoint(final double weight, final double x, final double y) {
049        this.weight = weight;
050        this.x      = x;
051        this.y      = y;
052    }
053
054    /** Get the weight of the measurement in the fitting process.
055     * @return weight of the measurement in the fitting process
056     */
057    public double getWeight() {
058        return weight;
059    }
060
061    /** Get the abscissa of the point.
062     * @return abscissa of the point
063     */
064    public double getX() {
065        return x;
066    }
067
068    /** Get the observed value of the function at x.
069     * @return observed value of the function at x
070     */
071    public double getY() {
072        return y;
073    }
074
075}
076