LetchfordLodiPartitionMap.java

  1. package org.drip.linearprogram.cuttingplane;

  2. /*
  3.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  4.  */

  5. /*!
  6.  * Copyright (C) 2020 Lakshmi Krishnamurthy
  7.  *
  8.  *  This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
  9.  *      asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
  10.  *      analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
  11.  *      equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
  12.  *      numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
  13.  *      and computational support.
  14.  *  
  15.  *      https://lakshmidrip.github.io/DROP/
  16.  *  
  17.  *  DROP is composed of three modules:
  18.  *  
  19.  *  - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
  20.  *  - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
  21.  *  - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
  22.  *
  23.  *  DROP Product Core implements libraries for the following:
  24.  *  - Fixed Income Analytics
  25.  *  - Loan Analytics
  26.  *  - Transaction Cost Analytics
  27.  *
  28.  *  DROP Portfolio Core implements libraries for the following:
  29.  *  - Asset Allocation Analytics
  30.  *  - Asset Liability Management Analytics
  31.  *  - Capital Estimation Analytics
  32.  *  - Exposure Analytics
  33.  *  - Margin Analytics
  34.  *  - XVA Analytics
  35.  *
  36.  *  DROP Computational Core implements libraries for the following:
  37.  *  - Algorithm Support
  38.  *  - Computation Support
  39.  *  - Function Analysis
  40.  *  - Model Validation
  41.  *  - Numerical Analysis
  42.  *  - Numerical Optimizer
  43.  *  - Spline Builder
  44.  *  - Statistical Learning
  45.  *
  46.  *  Documentation for DROP is Spread Over:
  47.  *
  48.  *  - Main                     => https://lakshmidrip.github.io/DROP/
  49.  *  - Wiki                     => https://github.com/lakshmiDRIP/DROP/wiki
  50.  *  - GitHub                   => https://github.com/lakshmiDRIP/DROP
  51.  *  - Repo Layout Taxonomy     => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
  52.  *  - Javadoc                  => https://lakshmidrip.github.io/DROP/Javadoc/index.html
  53.  *  - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
  54.  *  - Release Versions         => https://lakshmidrip.github.io/DROP/version.html
  55.  *  - Community Credits        => https://lakshmidrip.github.io/DROP/credits.html
  56.  *  - Issues Catalog           => https://github.com/lakshmiDRIP/DROP/issues
  57.  *  - JUnit                    => https://lakshmidrip.github.io/DROP/junit/index.html
  58.  *  - Jacoco                   => https://lakshmidrip.github.io/DROP/jacoco/index.html
  59.  *
  60.  *  Licensed under the Apache License, Version 2.0 (the "License");
  61.  *      you may not use this file except in compliance with the License.
  62.  *  
  63.  *  You may obtain a copy of the License at
  64.  *      http://www.apache.org/licenses/LICENSE-2.0
  65.  *  
  66.  *  Unless required by applicable law or agreed to in writing, software
  67.  *      distributed under the License is distributed on an "AS IS" BASIS,
  68.  *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  69.  *  
  70.  *  See the License for the specific language governing permissions and
  71.  *      limitations under the License.
  72.  */

  73. /**
  74.  * <i>LetchfordLodiPartitionMap</i> implements the Partition Map dictated by the Letchford-Lodi Cut. The
  75.  *  References are:
  76.  *
  77.  * <br><br>
  78.  *  <ul>
  79.  *      <li>
  80.  *          Burdet, C. A., and E. L. Johnson (1977): A Sub-additive Approach to Solve Linear Integer Programs
  81.  *              <i>Annals of Discrete Mathematics</i> <b>1</b> 117-143
  82.  *      </li>
  83.  *      <li>
  84.  *          Chvatal, V. (1973): Edmonds Polytopes in a Hierarchy of Combinatorial Problems <i>Discrete
  85.  *              Mathematics</i> <b>4 (4)</b> 305-337
  86.  *      </li>
  87.  *      <li>
  88.  *          Gomory, R. E. (1958): Outline of an Algorithm for Integer Solutions to Linear Programs
  89.  *              <i>Bulletin of the American Mathematical Society</i> <b>64 (5)</b> 275-278
  90.  *      </li>
  91.  *      <li>
  92.  *          Kelley, J. E. (1960): The Cutting Plane Method for Solving Convex Problems <i>Journal for the
  93.  *              Society of the Industrial and Applied Mathematics</i> <b>8 (4)</b> 703-712
  94.  *      </li>
  95.  *      <li>
  96.  *          Letchford, A. N. and A. Lodi (2002): Strengthening Chvatal-Gomory Cuts and Gomory Fractional Cuts
  97.  *              <i>Operations Research Letters</i> <b>30 (2)</b> 74-82
  98.  *      </li>
  99.  *  </ul>
  100.  *
  101.  *  <br><br>
  102.  *  <ul>
  103.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  104.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/AssetAllocationAnalyticsLibrary.md">Asset Allocation Analytics</a></li>
  105.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/linearprogram/README.md">Linear Programming Solution Suite</a></li>
  106.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/linearprogram/cuttingplane/README.md">Polyhedral Cutting Plane Generation Schemes</a></li>
  107.  *  </ul>
  108.  *
  109.  * @author Lakshmi Krishnamurthy
  110.  */

  111. public class LetchfordLodiPartitionMap
  112. {
  113.     private int _k = -1;
  114.     private double[] _unadjustedCoefficientArray = null;
  115.     private java.util.TreeMap<java.lang.Integer, java.util.Set<java.lang.Integer>> _partitionMap = null;

  116.     /**
  117.      * LetchfordLodiPartitionMap Constructor
  118.      *
  119.      * @param k The a0 Reciprocal Integer Floor
  120.      * @param unadjustedCoefficientArray The Unadjusted Coefficient Array
  121.      * @param partitionMap The Partition Map
  122.      *
  123.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  124.      */

  125.     public LetchfordLodiPartitionMap (
  126.         final int k,
  127.         final double[] unadjustedCoefficientArray,
  128.         final java.util.TreeMap<java.lang.Integer, java.util.Set<java.lang.Integer>> partitionMap)
  129.         throws java.lang.Exception
  130.     {
  131.         if (0 >= (_k = k) ||
  132.             null == (_unadjustedCoefficientArray = unadjustedCoefficientArray) ||
  133.                 0 == _unadjustedCoefficientArray.length ||
  134.             null == (_partitionMap = partitionMap) || 0 == partitionMap.size())
  135.         {
  136.             throw new java.lang.Exception (
  137.                 "LetchfordLodiPartitionMap Constructor => Invalid Inputs"
  138.             );
  139.         }
  140.     }

  141.     /**
  142.      * Retrieve the a0 Reciprocal Integer Floor
  143.      *
  144.      * @return The a0 Reciprocal Integer Floor
  145.      */

  146.     public int k()
  147.     {
  148.         return _k;
  149.     }

  150.     /**
  151.      * Retrieve the Unadjusted Coefficient Array
  152.      *
  153.      * @return The Unadjusted Coefficient Array
  154.      */

  155.     public double[] unadjustedCoefficientArray()
  156.     {
  157.         return _unadjustedCoefficientArray;
  158.     }

  159.     /**
  160.      * Retrieve the Partition Map
  161.      *
  162.      * @return The Partition Map
  163.      */

  164.     public java.util.TreeMap<java.lang.Integer, java.util.Set<java.lang.Integer>> partitionMap()
  165.     {
  166.         return _partitionMap;
  167.     }
  168. }