Code Monkey home page Code Monkey logo

lipa's Introduction

LIPA

Linear programming Interior-Point Algorithm.

LIPA is a C++ package designed to solve linear optimization problems using interior-point method.

Motivation

On it's current state, the project is implemented as a solution to the GeomsScale GSoC 2020 test task.

Installation

1. Download

Download repo with git clone --recursive https://github.com/AndreyBychkov/LIPA.git

If any issues with submodules arise, try checking out this article.

2. Building

The project strongly depends on BLAS and LAPACK libraries, so make sure you have them in your system. We suggest following guide from Armadillo for general information about installing this dependencies.

Building OpenBLAS

We use OpenBLAS as realisation of BLAS + LAPACK bundle. Consider checking it's building manual.

Our steps for CMake + MinGW:

  1. cd OpenBLAS
  2. mkdir build
  3. cd build
  4. cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
  5. cmake --build . -j --target all

It will produce directory lib in OpenBLAS/build with libopenblas.a in it which we link in Cmake as follows:

target_link_libraries(LIPA ${CMAKE_SOURCE_DIR}/OpenBLAS/build/lib/libopenblas.a)

Replace libraries in function with yours if needed.

Usage

Problem definition

Define linear optimization problem as follows:



In our code it is defined as:
LinearOptimizationProblem problem = LinearOptimizationProblem(A, b, c);

Optimization

  • Maximization:
LinearOptimizationResult result = problem.maximize(x_0, gamma, mir_err, method);
  • Minimization: For minimization replace vector c with negative -c and consider it as maximization problem.
vec c_neg = -c;
LinearOptimizationProblem problem = LinearOptimizationProblem(A, b, c_neg);
LinearOptimizationResult result = problem.maximize(x_0, gamma, mir_err, method);

Results

In LinearOptimizationResult class we store the solution itself as well as utility information like intermediate solutions and the number of iterations.

result.result.print("Solution x:");

lipa's People

Contributors

andreybychkov avatar

Stargazers

Bonkers avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.