## 1 Introduction  
Since the work of [PERSON] [1], portfolio optimization has become one of the most critical operations performed in investment management. In Modern Portfolio Theory, this operation consists in computing the Efficient Frontier, defined as the set of portfolios that yield the highest achievable mean excess return (in excess of the risk-free rate) for any given level of risk (measured in terms of standard deviation). This portfolio optimization problem receives two equivalent formulations: (i) Minimizing the portfolio's standard deviation (or variance) subject to a targeted excess return or (ii) Maximize the portfolio's excess return subject to a targeted standard deviation (or variance). Because the solution to both formulations in the same, we will focus on (i) for the remainder of the paper. Every financial firm is constantly faced with the problem of optimizing a portfolio. Wealth managers determine optimal holdings in order to achieve a strategic goal. Mutual funds attempt to beat a benchmark by placing active bets, based on some tactical superior knowledge with regard to the future expected returns or their covariance. Multi-manager hedge funds must allocate capital to portfolio managers, based on their performance expectations. Portfolio managers allocate capital to a variety of bets, incorporating their views about the future state of the economy. Risk managers may compute the portfolio that delivers the best hedge against a position that cannot be liquidated, _etc_. The current size of the global asset management industry is estimated to be in excess of US $58 trillion at year-end 2011. Thus, robust portfolio optimization software is a necessity of the first order [2].  
Most practitioners are routinely faced with the problem of optimizing a portfolio subject to inequality conditions (a lower and an upper bound for each portfolio weight) and an equality condition (that the weights add up to one). There is no analytic solution to this problem, and an optimization algorithm must be used. [PERSON] [3,4] developed a method for computing such a solution, which he named the \"_critical line algorithm_\" or CLA. [PERSON] [5] developed a Simplex version of CLA to deal with inequality constraints on linear combinations of the optimal weights. These more general constraints make [PERSON]'s algorithm more flexible. However, the standard portfolio optimization problem does not require them, making CLA the approach favored by most practitioners.  
Given the importance of CLA, one would expect a multiplicity of software implementations in a wide range of languages. Yet, we are aware of only one published source-code for CLA, by [PERSON] and [PERSON] [6]. This is written in Excel's Microsoft Visual Basic for Applications (VBA-Excel), and it is the descendant of a previous implementation in an experimental programming language called EAS-E [7]. [PERSON] _et al._[8] point out the inconveniences of working with VBA-Excel, most notably its low computational performance and its limitation to covariance matrices with a maximum order of (256 \(\times\) 256). In addition, the VBA-Excel spreadsheet has to be manually adjusted for different problems, which prevents its industrial use ([PERSON] [9] explains that VBA-Excel implementations are ubiquitous in the financial world, posing a systemic risk. Citing an internal JP Morgan investigation, he mentions that a faulty Excel implementation of the Value-at-Risk model may have been partly responsible for the US $6 billion trading loss suffered by JP Morgan in 2012, popularly known as the \"London whale\" debacle). Hence, it would be highly convenient to have the source code of CLA in a more scientific language, such as C++ or Python. A number of authors seem to have implemented CLA in several languages, however their code does not appear to be publicly available. For example, [PERSON] _et al._[10] mention their implementationof CLA in Java.