SlideShare a Scribd company logo
CoinMP - Open Source Solver




        New CoinMP Release 1.6:

 A Simple Free C-API Windows DLL and
Unix Solver Library (LP/MIP) based on COIN

                        Presented by

              Bjarni Kristjansson
             Maximal Software, Inc.



        Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                      1
Presentation Overview


•   Why Callable Library of COIN?
•   What COIN functionality is supported?
•   Supported Platforms
•   Why implemented as C-API?
•   Description of the C-API interface
•   New upcoming release 1.6 of CoinMP
•   Future release 2.0 of CoinMP
•   Other open source solvers (GLPK, LPSolve)
•   Recent News and Trends in Optimization
•   New Academic/Free Development Programs




              Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                            2
Why Callable Library Version of COIN?


Main Design Goals for CoinMP:
   •   Easy to use
   •   High portability
   •   No requirement to compile
   •   Larger number of potential users
   •   Can be used from any other application


           Some users just want to use binaries!




                 Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                               3
What COIN functionality is supported?


• Objects
   • ClpSimplex
   • CbcModel
   • OsiClpSolverInterface
• Callbacks
   • CBMessageHandler
   • CBIterHandler
   • CBNodeHandler
• Cuts
   • GglProbing, CglGomory, CglKnapsackCover, CglOddHole,
      CglClique, CglLiftAndProject, CglSimpleRounding
• Algorithmic
   • Pivot Algorithms, Scaling, Crash, Perturbation,
      Primal/Dual, Barrier, Presolve, etc.
• Option Parameters
            Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                          4
Supported Platforms for CoinMP


• Microsoft Windows
   • Microsoft Visual Studio (v2008)
   • Cygwin/gcc
   • MinGW/gcc
   • MSys/cl
• Unix
   • Linux/gcc
   • OSX/gcc
   • SunOS/gcc




             Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                           5
Why implemented as C-API?


• Standard interface
   • Well established
   • Easy portability
   • Simple to learn
• High portability to other programming languages
   • Visual Basic
   • Java
   • C++
   • C#/VB.Net
   • Scripting
• Not object oriented!



             Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                           6
Standard Solver API Interfaces


All Solver Interfaces need to meet certain minimum requirements:
•   Loading and Initializing the solver DLL
•   Query Solver Information
•   Create/Free Problem Object
•   Load Problem Elements
      (matrix, init, integer, priority, semi-cont,
      SOS, quadratic, nonlinear, stochastic)
•   Setup Callbacks/Log Handlers
•   Optimize Problem
•   Get Solution Values and Statistics (attributes)
•   File Handling (logs, basis, MPS, LP, XML, etc.)
•   Option Parameters (get, set)

Use existing standard interfaces – Do not reinvent the wheel!


                    Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                                  7
CoinMP C-API - Initialization


#ifndef _COINMP_H_
#define _COINMP_H_

SOLVAPI int        CoinInitSolver(char* LicenseStr);
SOLVAPI int        CoinFreeSolver(void);

SOLVAPI   int      CoinGetSolverName(char* SolverName, int buflen);
SOLVAPI   int      CoinGetVersionStr(char* VersionStr, int buflen);
SOLVAPI   double   CoinGetVersion(void);
SOLVAPI   int      CoinGetFeatures(void);
SOLVAPI   int      CoinGetMethods(void);
SOLVAPI   double   CoinGetInfinity(void);

SOLVAPI HPROB      CoinCreateProblem(char *ProblemName);

SOLVAPI int        CoinUnloadProb(HPROB hProb);




                       Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                                     8
CoinMP C-API – Loading Problem

SOLVAPI int    CoinLoadProblem(HPROB hProb, int ColCount, int RowCount,
    int NZCount, int RangeCount, int ObjectSense, double ObjectConst,
    double* ObjectCoeffs, double* LowerBounds, double* UpperBounds,
    char* RowType, double* RHSValues, double* RangeValues, int* MatrixBegin,
    int* MatrixCount, int* MatrixIndex, double* MatrixValues,
    char** ColNames, char** RowNames, char* ObjectName);

SOLVAPI int    CoinLoadInitValues(HPROB hProb, double* InitValues);

SOLVAPI int    CoinLoadInteger(HPROB hProb, char* ColumnType);

SOLVAPI int    CoinLoadPriority(HPROB hProb, int PriorCount, int* PriorIndex,
    int* PriorValues, int* BranchDir);

SOLVAPI int    CoinLoadSemiCont(HPROB hProb, int* SemiCount, int* SemiIndex);

SOLVAPI int    CoinLoadSos(HPROB hProb, int SosCount, int SosNZCount,
    int* SosType, int* SosPrior, int* SosBegin, int* SosIndex, double* SosRef);

SOLVAPI int    CoinLoadQuadratic(HPROB hProb, int* QuadBegin, int* QuadCount,
    int* QuadIndex, double* QuadValues);

SOLVAPI int    CoinLoadNonLinear(HPROB hProb, int NlpTreeCount, int NlpLineCount,
    int* NlpBegin, int* NlpOper, int* NlpArg1, int* NlpArg2, int* NlpIndex1,
    int* NlpIndex2, double* NlpValue1, double* NlpValue2);

                     Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                                   9
CoinMP C-API - Solving

SOLVAPI int   CoinSetMsgLogCallback(HPROB hProb, MSGLOGCALLBACK MsgLogCallback);
SOLVAPI int   CoinSetIterCallback(HPROB hProb, ITERCALLBACK IterCallback);
SOLVAPI int   CoinSetMipNodeCallback(HPROB hProb, MIPNODECALLBACK MipNodeCallback);

SOLVAPI int   CoinOptimizeProblem(HPROB hProb, int Method);

SOLVAPI int    CoinGetSolutionStatus(HPROB hProb);
SOLVAPI int    CoinGetSolutionText(HPROB hProb, int SolutionStatus,
    char* SolutionText, int buflen);
SOLVAPI double CoinGetObjectValue(HPROB hProb);
SOLVAPI double CoinGetMipBestBound(HPROB hProb);

SOLVAPI int   CoinGetIterCount(HPROB hProb);
SOLVAPI int   CoinGetMipNodeCount(HPROB hProb);

SOLVAPI int    CoinGetSolutionValues(HPROB hProb, double* Activity,
    double* ReducedCost, double* SlackValues, double* ShadowPrice);
SOLVAPI int    CoinGetSolutionRanges(HPROB hProb, double* ObjLoRange,
    double* ObjUpRange, double* RhsLoRange, double* RhsUpRange);
SOLVAPI int    CoinGetSolutionBasis(HPROB hProb, int* ColStatus, double* RowStatus);




                     Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                                   10
CoinMP C-API – File/Option Handling

SOLVAPI int    CoinReadFile(HPROB hProb, int FileType, char* ReadFilename);
SOLVAPI int    CoinWriteFile(HPROB hProb, int FileType, char* WriteFilename);

SOLVAPI int    CoinOpenLogFile(HPROB hProb, char* LogFilename);
SOLVAPI int    CoinCloseLogFile(HPROB hProb);

SOLVAPI int    CoinGetOptionCount(HPROB hProb);
SOLVAPI int    CoinGetOptionInfo(HPROB hProb, int OptionNr, int* OptionID,
    int* GroupType, int* OptionType, char* OptionName, char* ShortName, int buflen);

SOLVAPI int    CoinGetIntOptionMinMax(HPROB hProb, int OptionNr, int* MinValue,
    int* MaxValue);
SOLVAPI int    CoinSetRealOptionMinMax(HPROB hProb, int OptionNr, double* MinValue,
    double* MaxValue);

SOLVAPI int    CoinGetIntOption(HPROB hProb, int OptionID);
SOLVAPI int    CoinSetIntOption(HPROB hProb, int OptionID, int IntValue);

SOLVAPI double CoinGetRealOption(HPROB hProb, int OptionID);
SOLVAPI int    CoinSetRealOption(HPROB hProb, int OptionID, double RealValue);

SOLVAPI int    CoinGetStringOption(HPROB hProb, int OptionID, char* StringValue,
    int buflen);
SOLVAPI int    CoinSetStringOption(HPROB hProb, int OptionID, char* StringValue);
                     Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                                   11
CoinMP C-API – Stochastic


SOLVAPI int CoinLoadStochStages(HPROB hProb, int StageCount, int* VarStages,
    int* ConStages, char** StageNames);

SOLVAPI int CoinLoadStochTree(int ScenCount, int TreeType, int* TreeData,
    int* TreeData2);

SOLVAPI int CoinLoadStochScen(HPROB hProb, int ScenCount, double* ProbData,
    int *TreeStageStart, int* ProbData, int* ScenBegin, int RandomCount,
    int *RandomCol, int *RandomRow, double *RandomData, char** ScenNames);

SOLVAPI int CoinLoadStochIndep(HPROB hProb, int IndepCount, int* RandomCol,
    int* RandomRow, int* OutcomeCounts, int EventCount, double *ProbData,
    double *RandomData, char** IndepNames, char** OutcomeNames,
    char** EventNames);

SOLVAPI int CoinLoadStochBlocks(HPROB hProb, int IndepCount, int* OutcomeCounts,
    int EventCount, double *ProbData, int* RandomCol, int* RandomRow,
    double *RandomData, char** IndepNames, char** OutcomeNames, char** EventNames);




                     Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                                   12
New Release 1.6 of CoinMP


• New additions to the CoinMP API Interface
   • String arguments
   • Additional Option functions
   • Attribute handling (Gurobi style)
• CoinMP.cpp broken into separate modules:
   • CoinProblem.c
   • CoinOption.c
   • CoinAttr.c
   • CoinSolver.c
   • CoinCbc.cpp (driver)
   • CoinResult.c
• Preparations for the ability to support additional solvers
• New example codes for Visual Basic, C#, and Java


              Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                            13
Future Release 2.0 of CoinMP


• Add new solver drivers to CoinMP
   • OSI (DyLP, Volume, etc.)
   • Symphony
   • SMI (Stochastic)
   • IPOPT
   • CppAD
   • OS
   • Other
• Ability to switch between different solvers
• Challenges
   • More dependencies (checkout / compile)
   • Third-party libraries (Blas, HSL, Lapack, Mumps)
   • Complicates the release cycle (coordination issues)


             Copyright © 2011 Maximal Software, Inc. All rights reserved
                                                                           14

More Related Content

What's hot

A Post About Analyzing PHP
A Post About Analyzing PHPA Post About Analyzing PHP
A Post About Analyzing PHP
Andrey Karpov
 
HHVM and Hack: A quick introduction
HHVM and Hack: A quick introductionHHVM and Hack: A quick introduction
HHVM and Hack: A quick introduction
Kuan Yen Heng
 
Why choose Hack/HHVM over PHP7
Why choose Hack/HHVM over PHP7Why choose Hack/HHVM over PHP7
Why choose Hack/HHVM over PHP7
Yuji Otani
 
2021.laravelconf.tw.slides2
2021.laravelconf.tw.slides22021.laravelconf.tw.slides2
2021.laravelconf.tw.slides2
LiviaLiaoFontech
 
MidwestPHP Symfony2 Internals
MidwestPHP Symfony2 InternalsMidwestPHP Symfony2 Internals
MidwestPHP Symfony2 Internals
Raul Fraile
 
Java8
Java8Java8
From V8 to Modern Compilers
From V8 to Modern CompilersFrom V8 to Modern Compilers
From V8 to Modern Compilers
Min-Yih Hsu
 
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
goccy
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backend
Min-Yih Hsu
 
Intro to Hack Language
Intro to Hack LanguageIntro to Hack Language
Intro to Hack Language
Kyle Ferguson
 
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
rivierarb
 
PHP7 is coming
PHP7 is comingPHP7 is coming
PHP7 is coming
julien pauli
 
Static Analysis of PHP Code – IPC Berlin 2016
Static Analysis of PHP Code – IPC Berlin 2016Static Analysis of PHP Code – IPC Berlin 2016
Static Analysis of PHP Code – IPC Berlin 2016
Rouven Weßling
 
Statically Compiling Ruby with LLVM
Statically Compiling Ruby with LLVMStatically Compiling Ruby with LLVM
Statically Compiling Ruby with LLVM
Laurent Sansonetti
 
PHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacyPHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacy
Damien Seguy
 
Should i Go there
Should i Go thereShould i Go there
Should i Go there
Shimi Bandiel
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPC
Anthony Ferrara
 
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
frank2
 
Hack Programming Language
Hack Programming LanguageHack Programming Language
Hack Programming Language
Radu Murzea
 
Hack and HHVM
Hack and HHVMHack and HHVM
Hack and HHVM
Ewere Diagboya
 

What's hot (20)

A Post About Analyzing PHP
A Post About Analyzing PHPA Post About Analyzing PHP
A Post About Analyzing PHP
 
HHVM and Hack: A quick introduction
HHVM and Hack: A quick introductionHHVM and Hack: A quick introduction
HHVM and Hack: A quick introduction
 
Why choose Hack/HHVM over PHP7
Why choose Hack/HHVM over PHP7Why choose Hack/HHVM over PHP7
Why choose Hack/HHVM over PHP7
 
2021.laravelconf.tw.slides2
2021.laravelconf.tw.slides22021.laravelconf.tw.slides2
2021.laravelconf.tw.slides2
 
MidwestPHP Symfony2 Internals
MidwestPHP Symfony2 InternalsMidwestPHP Symfony2 Internals
MidwestPHP Symfony2 Internals
 
Java8
Java8Java8
Java8
 
From V8 to Modern Compilers
From V8 to Modern CompilersFrom V8 to Modern Compilers
From V8 to Modern Compilers
 
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backend
 
Intro to Hack Language
Intro to Hack LanguageIntro to Hack Language
Intro to Hack Language
 
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
 
PHP7 is coming
PHP7 is comingPHP7 is coming
PHP7 is coming
 
Static Analysis of PHP Code – IPC Berlin 2016
Static Analysis of PHP Code – IPC Berlin 2016Static Analysis of PHP Code – IPC Berlin 2016
Static Analysis of PHP Code – IPC Berlin 2016
 
Statically Compiling Ruby with LLVM
Statically Compiling Ruby with LLVMStatically Compiling Ruby with LLVM
Statically Compiling Ruby with LLVM
 
PHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacyPHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacy
 
Should i Go there
Should i Go thereShould i Go there
Should i Go there
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPC
 
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
 
Hack Programming Language
Hack Programming LanguageHack Programming Language
Hack Programming Language
 
Hack and HHVM
Hack and HHVMHack and HHVM
Hack and HHVM
 

Similar to Seminar: CoinMP - Open Source Solver - Nov 2011

Os Lattner
Os LattnerOs Lattner
Os Lattner
oscon2007
 
Seminar: New Stochastic Programming Features for MPL - Nov 2011
Seminar: New Stochastic Programming Features for MPL - Nov 2011Seminar: New Stochastic Programming Features for MPL - Nov 2011
Seminar: New Stochastic Programming Features for MPL - Nov 2011
Bjarni Kristjánsson
 
Surviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-studySurviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-study
peter_ibuildings
 
OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Symposium_Python Bindings_9.21.11OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Foundation
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
Dmitri Nesteruk
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
Mark Stoodley
 
NativeBoost
NativeBoostNativeBoost
NativeBoost
ESUG
 
Streaming 101: Hello World
Streaming 101:  Hello WorldStreaming 101:  Hello World
Streaming 101: Hello World
Josh Fischer
 
Rich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentationRich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentation
Nicko Borodachuk
 
Combining Phase Identification and Statistic Modeling for Automated Parallel ...
Combining Phase Identification and Statistic Modeling for Automated Parallel ...Combining Phase Identification and Statistic Modeling for Automated Parallel ...
Combining Phase Identification and Statistic Modeling for Automated Parallel ...
Mingliang Liu
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOps
Matt Ray
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
Jung Kim
 
Experiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRubyExperiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRuby
Matthew Gaudet
 
I18n
I18nI18n
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
Serge Stinckwich
 
Monitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopMonitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntop
PyCon Italia
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
How to Use OpenMP on Native Activity
How to Use OpenMP on Native ActivityHow to Use OpenMP on Native Activity
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
fukamachi
 
Introduction to .NET Micro Framework Development
Introduction to .NET Micro Framework DevelopmentIntroduction to .NET Micro Framework Development
Introduction to .NET Micro Framework Development
christopherfairbairn
 

Similar to Seminar: CoinMP - Open Source Solver - Nov 2011 (20)

Os Lattner
Os LattnerOs Lattner
Os Lattner
 
Seminar: New Stochastic Programming Features for MPL - Nov 2011
Seminar: New Stochastic Programming Features for MPL - Nov 2011Seminar: New Stochastic Programming Features for MPL - Nov 2011
Seminar: New Stochastic Programming Features for MPL - Nov 2011
 
Surviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-studySurviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-study
 
OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Symposium_Python Bindings_9.21.11OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Symposium_Python Bindings_9.21.11
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
 
NativeBoost
NativeBoostNativeBoost
NativeBoost
 
Streaming 101: Hello World
Streaming 101:  Hello WorldStreaming 101:  Hello World
Streaming 101: Hello World
 
Rich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentationRich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentation
 
Combining Phase Identification and Statistic Modeling for Automated Parallel ...
Combining Phase Identification and Statistic Modeling for Automated Parallel ...Combining Phase Identification and Statistic Modeling for Automated Parallel ...
Combining Phase Identification and Statistic Modeling for Automated Parallel ...
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOps
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
Experiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRubyExperiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRuby
 
I18n
I18nI18n
I18n
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
 
Monitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopMonitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntop
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
 
How to Use OpenMP on Native Activity
How to Use OpenMP on Native ActivityHow to Use OpenMP on Native Activity
How to Use OpenMP on Native Activity
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
 
Introduction to .NET Micro Framework Development
Introduction to .NET Micro Framework DevelopmentIntroduction to .NET Micro Framework Development
Introduction to .NET Micro Framework Development
 

More from Bjarni Kristjánsson

New Release 5.0 of MPL and OptiMax Library - OR Vienna 2015
New Release 5.0 of MPL and OptiMax Library - OR Vienna 2015New Release 5.0 of MPL and OptiMax Library - OR Vienna 2015
New Release 5.0 of MPL and OptiMax Library - OR Vienna 2015
Bjarni Kristjánsson
 
Maximal: Achieving Optimal Solution Performance for your Optimization Modelin...
Maximal: Achieving Optimal Solution Performance for your Optimization Modelin...Maximal: Achieving Optimal Solution Performance for your Optimization Modelin...
Maximal: Achieving Optimal Solution Performance for your Optimization Modelin...
Bjarni Kristjánsson
 
Maximal: Deploying Optimization Models on Servers and Mobile Platforms - Oct ...
Maximal: Deploying Optimization Models on Servers and Mobile Platforms - Oct ...Maximal: Deploying Optimization Models on Servers and Mobile Platforms - Oct ...
Maximal: Deploying Optimization Models on Servers and Mobile Platforms - Oct ...
Bjarni Kristjánsson
 
Maximal: Comparison of Optimization Modeling Software for Python - Oct 2012
Maximal: Comparison of Optimization Modeling Software for Python - Oct 2012Maximal: Comparison of Optimization Modeling Software for Python - Oct 2012
Maximal: Comparison of Optimization Modeling Software for Python - Oct 2012
Bjarni Kristjánsson
 
Maximal: MPL Software Demo - INFORMS Phoenix Oct 2012
Maximal: MPL Software Demo - INFORMS Phoenix Oct 2012Maximal: MPL Software Demo - INFORMS Phoenix Oct 2012
Maximal: MPL Software Demo - INFORMS Phoenix Oct 2012
Bjarni Kristjánsson
 
Seminar: Data Modeling for Optimization with MPL - Oct 2012
Seminar: Data Modeling for Optimization with MPL - Oct 2012Seminar: Data Modeling for Optimization with MPL - Oct 2012
Seminar: Data Modeling for Optimization with MPL - Oct 2012
Bjarni Kristjánsson
 
Seminar: Embedding Optimization in Applications with MPL OptiMax - April 2012
Seminar: Embedding Optimization in Applications with MPL OptiMax - April 2012Seminar: Embedding Optimization in Applications with MPL OptiMax - April 2012
Seminar: Embedding Optimization in Applications with MPL OptiMax - April 2012
Bjarni Kristjánsson
 
Seminar: New Pricing Programs and Free Software Offers by Maximal - Oct 2012
Seminar: New Pricing Programs and Free Software Offers by Maximal - Oct 2012Seminar: New Pricing Programs and Free Software Offers by Maximal - Oct 2012
Seminar: New Pricing Programs and Free Software Offers by Maximal - Oct 2012
Bjarni Kristjánsson
 
Seminar: Introduction to Maximal Software and the MPL Modeling System - Oct 2012
Seminar: Introduction to Maximal Software and the MPL Modeling System - Oct 2012Seminar: Introduction to Maximal Software and the MPL Modeling System - Oct 2012
Seminar: Introduction to Maximal Software and the MPL Modeling System - Oct 2012
Bjarni Kristjánsson
 
OR Connect: A New Web 2.0 Online Initiative for O.R. - INFORMS Jan 2011
OR Connect: A New Web 2.0 Online Initiative for O.R. - INFORMS Jan 2011OR Connect: A New Web 2.0 Online Initiative for O.R. - INFORMS Jan 2011
OR Connect: A New Web 2.0 Online Initiative for O.R. - INFORMS Jan 2011
Bjarni Kristjánsson
 
INFORMS: IT Board Report - April 2011
INFORMS: IT Board Report - April 2011INFORMS: IT Board Report - April 2011
INFORMS: IT Board Report - April 2011
Bjarni Kristjánsson
 
INFORMS: IT Committee Report - August 2011
INFORMS: IT Committee Report - August 2011INFORMS: IT Committee Report - August 2011
INFORMS: IT Committee Report - August 2011
Bjarni Kristjánsson
 

More from Bjarni Kristjánsson (12)

New Release 5.0 of MPL and OptiMax Library - OR Vienna 2015
New Release 5.0 of MPL and OptiMax Library - OR Vienna 2015New Release 5.0 of MPL and OptiMax Library - OR Vienna 2015
New Release 5.0 of MPL and OptiMax Library - OR Vienna 2015
 
Maximal: Achieving Optimal Solution Performance for your Optimization Modelin...
Maximal: Achieving Optimal Solution Performance for your Optimization Modelin...Maximal: Achieving Optimal Solution Performance for your Optimization Modelin...
Maximal: Achieving Optimal Solution Performance for your Optimization Modelin...
 
Maximal: Deploying Optimization Models on Servers and Mobile Platforms - Oct ...
Maximal: Deploying Optimization Models on Servers and Mobile Platforms - Oct ...Maximal: Deploying Optimization Models on Servers and Mobile Platforms - Oct ...
Maximal: Deploying Optimization Models on Servers and Mobile Platforms - Oct ...
 
Maximal: Comparison of Optimization Modeling Software for Python - Oct 2012
Maximal: Comparison of Optimization Modeling Software for Python - Oct 2012Maximal: Comparison of Optimization Modeling Software for Python - Oct 2012
Maximal: Comparison of Optimization Modeling Software for Python - Oct 2012
 
Maximal: MPL Software Demo - INFORMS Phoenix Oct 2012
Maximal: MPL Software Demo - INFORMS Phoenix Oct 2012Maximal: MPL Software Demo - INFORMS Phoenix Oct 2012
Maximal: MPL Software Demo - INFORMS Phoenix Oct 2012
 
Seminar: Data Modeling for Optimization with MPL - Oct 2012
Seminar: Data Modeling for Optimization with MPL - Oct 2012Seminar: Data Modeling for Optimization with MPL - Oct 2012
Seminar: Data Modeling for Optimization with MPL - Oct 2012
 
Seminar: Embedding Optimization in Applications with MPL OptiMax - April 2012
Seminar: Embedding Optimization in Applications with MPL OptiMax - April 2012Seminar: Embedding Optimization in Applications with MPL OptiMax - April 2012
Seminar: Embedding Optimization in Applications with MPL OptiMax - April 2012
 
Seminar: New Pricing Programs and Free Software Offers by Maximal - Oct 2012
Seminar: New Pricing Programs and Free Software Offers by Maximal - Oct 2012Seminar: New Pricing Programs and Free Software Offers by Maximal - Oct 2012
Seminar: New Pricing Programs and Free Software Offers by Maximal - Oct 2012
 
Seminar: Introduction to Maximal Software and the MPL Modeling System - Oct 2012
Seminar: Introduction to Maximal Software and the MPL Modeling System - Oct 2012Seminar: Introduction to Maximal Software and the MPL Modeling System - Oct 2012
Seminar: Introduction to Maximal Software and the MPL Modeling System - Oct 2012
 
OR Connect: A New Web 2.0 Online Initiative for O.R. - INFORMS Jan 2011
OR Connect: A New Web 2.0 Online Initiative for O.R. - INFORMS Jan 2011OR Connect: A New Web 2.0 Online Initiative for O.R. - INFORMS Jan 2011
OR Connect: A New Web 2.0 Online Initiative for O.R. - INFORMS Jan 2011
 
INFORMS: IT Board Report - April 2011
INFORMS: IT Board Report - April 2011INFORMS: IT Board Report - April 2011
INFORMS: IT Board Report - April 2011
 
INFORMS: IT Committee Report - August 2011
INFORMS: IT Committee Report - August 2011INFORMS: IT Committee Report - August 2011
INFORMS: IT Committee Report - August 2011
 

Seminar: CoinMP - Open Source Solver - Nov 2011

  • 1. CoinMP - Open Source Solver New CoinMP Release 1.6: A Simple Free C-API Windows DLL and Unix Solver Library (LP/MIP) based on COIN Presented by Bjarni Kristjansson Maximal Software, Inc. Copyright © 2011 Maximal Software, Inc. All rights reserved 1
  • 2. Presentation Overview • Why Callable Library of COIN? • What COIN functionality is supported? • Supported Platforms • Why implemented as C-API? • Description of the C-API interface • New upcoming release 1.6 of CoinMP • Future release 2.0 of CoinMP • Other open source solvers (GLPK, LPSolve) • Recent News and Trends in Optimization • New Academic/Free Development Programs Copyright © 2011 Maximal Software, Inc. All rights reserved 2
  • 3. Why Callable Library Version of COIN? Main Design Goals for CoinMP: • Easy to use • High portability • No requirement to compile • Larger number of potential users • Can be used from any other application Some users just want to use binaries! Copyright © 2011 Maximal Software, Inc. All rights reserved 3
  • 4. What COIN functionality is supported? • Objects • ClpSimplex • CbcModel • OsiClpSolverInterface • Callbacks • CBMessageHandler • CBIterHandler • CBNodeHandler • Cuts • GglProbing, CglGomory, CglKnapsackCover, CglOddHole, CglClique, CglLiftAndProject, CglSimpleRounding • Algorithmic • Pivot Algorithms, Scaling, Crash, Perturbation, Primal/Dual, Barrier, Presolve, etc. • Option Parameters Copyright © 2011 Maximal Software, Inc. All rights reserved 4
  • 5. Supported Platforms for CoinMP • Microsoft Windows • Microsoft Visual Studio (v2008) • Cygwin/gcc • MinGW/gcc • MSys/cl • Unix • Linux/gcc • OSX/gcc • SunOS/gcc Copyright © 2011 Maximal Software, Inc. All rights reserved 5
  • 6. Why implemented as C-API? • Standard interface • Well established • Easy portability • Simple to learn • High portability to other programming languages • Visual Basic • Java • C++ • C#/VB.Net • Scripting • Not object oriented! Copyright © 2011 Maximal Software, Inc. All rights reserved 6
  • 7. Standard Solver API Interfaces All Solver Interfaces need to meet certain minimum requirements: • Loading and Initializing the solver DLL • Query Solver Information • Create/Free Problem Object • Load Problem Elements (matrix, init, integer, priority, semi-cont, SOS, quadratic, nonlinear, stochastic) • Setup Callbacks/Log Handlers • Optimize Problem • Get Solution Values and Statistics (attributes) • File Handling (logs, basis, MPS, LP, XML, etc.) • Option Parameters (get, set) Use existing standard interfaces – Do not reinvent the wheel! Copyright © 2011 Maximal Software, Inc. All rights reserved 7
  • 8. CoinMP C-API - Initialization #ifndef _COINMP_H_ #define _COINMP_H_ SOLVAPI int CoinInitSolver(char* LicenseStr); SOLVAPI int CoinFreeSolver(void); SOLVAPI int CoinGetSolverName(char* SolverName, int buflen); SOLVAPI int CoinGetVersionStr(char* VersionStr, int buflen); SOLVAPI double CoinGetVersion(void); SOLVAPI int CoinGetFeatures(void); SOLVAPI int CoinGetMethods(void); SOLVAPI double CoinGetInfinity(void); SOLVAPI HPROB CoinCreateProblem(char *ProblemName); SOLVAPI int CoinUnloadProb(HPROB hProb); Copyright © 2011 Maximal Software, Inc. All rights reserved 8
  • 9. CoinMP C-API – Loading Problem SOLVAPI int CoinLoadProblem(HPROB hProb, int ColCount, int RowCount, int NZCount, int RangeCount, int ObjectSense, double ObjectConst, double* ObjectCoeffs, double* LowerBounds, double* UpperBounds, char* RowType, double* RHSValues, double* RangeValues, int* MatrixBegin, int* MatrixCount, int* MatrixIndex, double* MatrixValues, char** ColNames, char** RowNames, char* ObjectName); SOLVAPI int CoinLoadInitValues(HPROB hProb, double* InitValues); SOLVAPI int CoinLoadInteger(HPROB hProb, char* ColumnType); SOLVAPI int CoinLoadPriority(HPROB hProb, int PriorCount, int* PriorIndex, int* PriorValues, int* BranchDir); SOLVAPI int CoinLoadSemiCont(HPROB hProb, int* SemiCount, int* SemiIndex); SOLVAPI int CoinLoadSos(HPROB hProb, int SosCount, int SosNZCount, int* SosType, int* SosPrior, int* SosBegin, int* SosIndex, double* SosRef); SOLVAPI int CoinLoadQuadratic(HPROB hProb, int* QuadBegin, int* QuadCount, int* QuadIndex, double* QuadValues); SOLVAPI int CoinLoadNonLinear(HPROB hProb, int NlpTreeCount, int NlpLineCount, int* NlpBegin, int* NlpOper, int* NlpArg1, int* NlpArg2, int* NlpIndex1, int* NlpIndex2, double* NlpValue1, double* NlpValue2); Copyright © 2011 Maximal Software, Inc. All rights reserved 9
  • 10. CoinMP C-API - Solving SOLVAPI int CoinSetMsgLogCallback(HPROB hProb, MSGLOGCALLBACK MsgLogCallback); SOLVAPI int CoinSetIterCallback(HPROB hProb, ITERCALLBACK IterCallback); SOLVAPI int CoinSetMipNodeCallback(HPROB hProb, MIPNODECALLBACK MipNodeCallback); SOLVAPI int CoinOptimizeProblem(HPROB hProb, int Method); SOLVAPI int CoinGetSolutionStatus(HPROB hProb); SOLVAPI int CoinGetSolutionText(HPROB hProb, int SolutionStatus, char* SolutionText, int buflen); SOLVAPI double CoinGetObjectValue(HPROB hProb); SOLVAPI double CoinGetMipBestBound(HPROB hProb); SOLVAPI int CoinGetIterCount(HPROB hProb); SOLVAPI int CoinGetMipNodeCount(HPROB hProb); SOLVAPI int CoinGetSolutionValues(HPROB hProb, double* Activity, double* ReducedCost, double* SlackValues, double* ShadowPrice); SOLVAPI int CoinGetSolutionRanges(HPROB hProb, double* ObjLoRange, double* ObjUpRange, double* RhsLoRange, double* RhsUpRange); SOLVAPI int CoinGetSolutionBasis(HPROB hProb, int* ColStatus, double* RowStatus); Copyright © 2011 Maximal Software, Inc. All rights reserved 10
  • 11. CoinMP C-API – File/Option Handling SOLVAPI int CoinReadFile(HPROB hProb, int FileType, char* ReadFilename); SOLVAPI int CoinWriteFile(HPROB hProb, int FileType, char* WriteFilename); SOLVAPI int CoinOpenLogFile(HPROB hProb, char* LogFilename); SOLVAPI int CoinCloseLogFile(HPROB hProb); SOLVAPI int CoinGetOptionCount(HPROB hProb); SOLVAPI int CoinGetOptionInfo(HPROB hProb, int OptionNr, int* OptionID, int* GroupType, int* OptionType, char* OptionName, char* ShortName, int buflen); SOLVAPI int CoinGetIntOptionMinMax(HPROB hProb, int OptionNr, int* MinValue, int* MaxValue); SOLVAPI int CoinSetRealOptionMinMax(HPROB hProb, int OptionNr, double* MinValue, double* MaxValue); SOLVAPI int CoinGetIntOption(HPROB hProb, int OptionID); SOLVAPI int CoinSetIntOption(HPROB hProb, int OptionID, int IntValue); SOLVAPI double CoinGetRealOption(HPROB hProb, int OptionID); SOLVAPI int CoinSetRealOption(HPROB hProb, int OptionID, double RealValue); SOLVAPI int CoinGetStringOption(HPROB hProb, int OptionID, char* StringValue, int buflen); SOLVAPI int CoinSetStringOption(HPROB hProb, int OptionID, char* StringValue); Copyright © 2011 Maximal Software, Inc. All rights reserved 11
  • 12. CoinMP C-API – Stochastic SOLVAPI int CoinLoadStochStages(HPROB hProb, int StageCount, int* VarStages, int* ConStages, char** StageNames); SOLVAPI int CoinLoadStochTree(int ScenCount, int TreeType, int* TreeData, int* TreeData2); SOLVAPI int CoinLoadStochScen(HPROB hProb, int ScenCount, double* ProbData, int *TreeStageStart, int* ProbData, int* ScenBegin, int RandomCount, int *RandomCol, int *RandomRow, double *RandomData, char** ScenNames); SOLVAPI int CoinLoadStochIndep(HPROB hProb, int IndepCount, int* RandomCol, int* RandomRow, int* OutcomeCounts, int EventCount, double *ProbData, double *RandomData, char** IndepNames, char** OutcomeNames, char** EventNames); SOLVAPI int CoinLoadStochBlocks(HPROB hProb, int IndepCount, int* OutcomeCounts, int EventCount, double *ProbData, int* RandomCol, int* RandomRow, double *RandomData, char** IndepNames, char** OutcomeNames, char** EventNames); Copyright © 2011 Maximal Software, Inc. All rights reserved 12
  • 13. New Release 1.6 of CoinMP • New additions to the CoinMP API Interface • String arguments • Additional Option functions • Attribute handling (Gurobi style) • CoinMP.cpp broken into separate modules: • CoinProblem.c • CoinOption.c • CoinAttr.c • CoinSolver.c • CoinCbc.cpp (driver) • CoinResult.c • Preparations for the ability to support additional solvers • New example codes for Visual Basic, C#, and Java Copyright © 2011 Maximal Software, Inc. All rights reserved 13
  • 14. Future Release 2.0 of CoinMP • Add new solver drivers to CoinMP • OSI (DyLP, Volume, etc.) • Symphony • SMI (Stochastic) • IPOPT • CppAD • OS • Other • Ability to switch between different solvers • Challenges • More dependencies (checkout / compile) • Third-party libraries (Blas, HSL, Lapack, Mumps) • Complicates the release cycle (coordination issues) Copyright © 2011 Maximal Software, Inc. All rights reserved 14