ADMMQPSolution.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. /** Internal Solution for ADMM QP Optimizer.
  20.  * @since 3.1
  21.  */
  22. public class ADMMQPSolution extends LagrangeSolution {

  23.     /** V-tilde auxiliary variable. */
  24.     private final RealVector v;

  25.     /** Z auxiliary variable. */
  26.     private final RealVector z;

  27.     /** Simple constructor.
  28.      * @param x solution
  29.      * @param lambda Lagrange multipliers
  30.      * @param value objective function value
  31.      */
  32.     public ADMMQPSolution(RealVector x, RealVector lambda, Double value) {
  33.         super(x, lambda, value);
  34.         this.v = null;
  35.         this.z = null;
  36.     }

  37.     /** Simple constructor.
  38.      * @param x solution
  39.      * @param v V-tilde auxiliary variable
  40.      */
  41.     public ADMMQPSolution(RealVector x, RealVector v) {
  42.         super(x, null, 0.0);
  43.         this.v = v;
  44.         this.z = null;
  45.     }

  46.     /** Simple constructor.
  47.      * @param x solution
  48.      * @param v V-tilde auxiliary variable
  49.      * @param y Lagrange multipliers
  50.      * @param z Z auxiliary variable
  51.      */
  52.     public ADMMQPSolution(final RealVector x, final RealVector v, final RealVector y, final RealVector z) {
  53.         super(x, y, 0.0);
  54.         this.v = v;
  55.         this.z = z;
  56.     }

  57.     /** Simple constructor.
  58.      * @param x solution
  59.      * @param v V-tilde auxiliary variable
  60.      * @param y Lagrange multipliers
  61.      * @param z Z auxiliary variable
  62.      * @param value objective function value
  63.      */
  64.     public ADMMQPSolution(final RealVector x, final RealVector v, final RealVector y, final RealVector z, double value) {
  65.         super(x, y, value);
  66.         this.v = v;
  67.         this.z = z;
  68.     }

  69.     /**
  70.      * Returns V tilde auxiliary Variable
  71.      *
  72.      * @return V tilde auxiliary Variable
  73.      */
  74.     public RealVector getV() {
  75.         return this.v;
  76.     }

  77.     /**
  78.      * Returns Z auxiliary Variable
  79.      *
  80.      * @return Z auxiliary Variable
  81.      */
  82.     public RealVector getZ() {
  83.         return this.z;
  84.     }

  85. }