ILP.java

  1. package org.drip.linearprogram.canonical;

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

  110. public class ILP
  111. {
  112.     private org.drip.linearprogram.canonical.ILPObjective _objective = null;
  113.     private org.drip.linearprogram.canonical.ILPConstraint _constraint = null;

  114.     /**
  115.      * ILP Constructor
  116.      *
  117.      * @param objective The Objective Term
  118.      * @param constraint The Constraint Term
  119.      *
  120.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  121.      */

  122.     public ILP (
  123.         final org.drip.linearprogram.canonical.ILPObjective objective,
  124.         final org.drip.linearprogram.canonical.ILPConstraint constraint)
  125.         throws java.lang.Exception
  126.     {
  127.         if (null == (_objective = objective) ||
  128.             null == (_constraint = constraint) ||
  129.             _objective.dimension() != _constraint.dimension()
  130.         )
  131.         {
  132.             throw new java.lang.Exception (
  133.                 "ILP Constructor => Invalid Inputs"
  134.             );
  135.         }
  136.     }

  137.     /**
  138.      * Retrieve the Objective Term
  139.      *
  140.      * @return The Objective Term
  141.      */

  142.     public org.drip.linearprogram.canonical.ILPObjective objective()
  143.     {
  144.         return _objective;
  145.     }

  146.     /**
  147.      * Retrieve the Constraint Term
  148.      *
  149.      * @return The Constraint Term
  150.      */

  151.     public org.drip.linearprogram.canonical.ILPConstraint constraint()
  152.     {
  153.         return _constraint;
  154.     }
  155. }