/******************************************************** Xpress-BCL C# Example Problems ============================== file foliolp.cs ``````````````` Modeling a small LP problem to perform portfolio optimization. (c) 2008-2023 Fair Isaac Corporation authors: S.Heipcke, D.Brett. ********************************************************/ using System; using System.Text; using System.IO; using BCL; namespace Examples { public class TestUGFolioLP { const int NSHARES = 10; // Number of shares const int NRISK = 5; // Number of high-risk shares const int NNA = 4; // Number of North-American shares double[] RET = {5,17,26,12,8,9,7,6,31,21}; // Estimated return in investment int[] RISK = {1,2,3,8,9}; // High-risk values among shares int[] NA = {0,1,2,3}; // Shares issued in N.-America public static void Main() { XPRB.init(); int s; XPRBprob p = new XPRBprob("FolioLP"); // Initialize a new problem in BCL XPRBexpr Risk,Na,Return,Cap; XPRBvar[] frac = new XPRBvar[NSHARES]; // Fraction of capital used per share TestUGFolioLP TestInstance = new TestUGFolioLP(); // Create the decision variables for(s=0;s= 0,5); // Spend all the capital Cap = new XPRBexpr(); for(s=0;s