LagrangeSolution.java

  1. /*
  2.  * Licensed to the Hipparchus project under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * The Hipparchus project licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *      https://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.hipparchus.optim.nonlinear.vector.constrained;

  18. import org.hipparchus.linear.RealVector;

  19. /** Container for Lagrange t-uple.
  20.  * @since 3.1
  21.  */
  22. public class LagrangeSolution {

  23.     /** Solution vector. */
  24.     private final RealVector x;

  25.     /** Lagrange multipliers. */
  26.     private final RealVector lambda;

  27.     /** Objective function value. */
  28.     private final double value;

  29.     /** Simple constructor.
  30.      * @param x solution
  31.      * @param lambda Lagrange multipliers
  32.      * @param value objective function value
  33.      */
  34.     public LagrangeSolution(final RealVector x, final RealVector lambda, final double value){
  35.         this.x      = x;
  36.         this.lambda = lambda;
  37.         this.value  = value;
  38.     }

  39.     /**
  40.      * Returns X solution
  41.      *
  42.      * @return X solution
  43.      */
  44.     public RealVector getX() {
  45.         return x;
  46.     }

  47.     /**
  48.      * Returns Lambda Multiplier
  49.      *
  50.      * @return X Lambda Multiplier
  51.      */
  52.     public RealVector getLambda() {
  53.         return lambda;
  54.     }

  55.     /**
  56.      * Returns min(max) evaluated function at x
  57.      *
  58.      * @return min(max) evaluated function at x
  59.      */
  60.     public double getValue() {
  61.         return value;
  62.     }

  63. }