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.math4.legacy.optim.univariate; 019 020/** 021 * This class holds a point and the value of an objective function at this 022 * point. 023 * This is a simple immutable container. 024 * 025 * @since 3.0 026 */ 027public class UnivariatePointValuePair { 028 /** Point. */ 029 private final double point; 030 /** Value of the objective function at the point. */ 031 private final double value; 032 033 /** 034 * Build a point/objective function value pair. 035 * 036 * @param point Point. 037 * @param value Value of an objective function at the point 038 */ 039 public UnivariatePointValuePair(final double point, 040 final double value) { 041 this.point = point; 042 this.value = value; 043 } 044 045 /** 046 * Get the point. 047 * 048 * @return the point. 049 */ 050 public double getPoint() { 051 return point; 052 } 053 054 /** 055 * Get the value of the objective function. 056 * 057 * @return the stored value of the objective function. 058 */ 059 public double getValue() { 060 return value; 061 } 062}