View Javadoc
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  
19  import org.hipparchus.linear.RealVector;
20  
21  /** Container for Lagrange t-uple.
22   * @since 3.1
23   */
24  public class LagrangeSolution {
25  
26      /** Solution vector. */
27      private final RealVector x;
28  
29      /** Lagrange multipliers. */
30      private final RealVector lambda;
31  
32      /** Objective function value. */
33      private final double value;
34  
35      /** Simple constructor.
36       * @param x solution
37       * @param lambda Lagrange multipliers
38       * @param value objective function value
39       */
40      public LagrangeSolution(final RealVector x, final RealVector lambda, final double value){
41          this.x      = x;
42          this.lambda = lambda;
43          this.value  = value;
44      }
45  
46      /**
47       * Returns X solution
48       *
49       * @return X solution
50       */
51      public RealVector getX() {
52          return x;
53      }
54  
55      /**
56       * Returns Lambda Multiplier
57       *
58       * @return X Lambda Multiplier
59       */
60      public RealVector getLambda() {
61          return lambda;
62      }
63  
64      /**
65       * Returns min(max) evaluated function at x
66       *
67       * @return min(max) evaluated function at x
68       */
69      public double getValue() {
70          return value;
71      }
72  
73  }