GLPKMEX - GLPK Matlab MEX Interface
********************************


1.1 What is GLPKMEX?
---------------------

  GLPKMEX is a Matlab MEX interface for GLPK package. It allows to
  utilize GLPK in Matlab as a good alternative to the linear and 
  mixed integer part of the optimization toolbox in solving problems of 
  linear or discrete optimization. 
  
  Author: Nicolo' Giorgetti <giorgetti@dii.unisi.it>
          DII, University of Siena, Italy.


1.2 What does it consist of?
-----------------------------
  
  GLPKMEX consists of three files: glpkmex.c, glpkfun.h and glpkset.h.  
  glpkmex.c represents the real interface to Matlab. When compiled within
  Matlab you get a glpkmex.dll (under Win*) or a glpkmex.mexglx (under Linux).
  glpkfun.h and glpkset.h contain C code for calling the APIs of the GLPK 
  library.
  
  There are two additional folders:
  
  doc/ directory contains:
  
  - glpkmex.m     a syntax help file to use in Matlab.
  - glpkparams.m  a help file to use in Matlab to show parameters that 
                  can be passed to the mex interface.                  
  
  examples/ directory contains:
  
  - glpktest1.m, glpktest2, glpksparse three example files to use in Matlab


1.3 How to compile it?
-----------------------

1.3.1 Prerequisites

  First of all you need Matlab installed. Any Matlab 5.3 or higher should
  be enough. If you plan to compile glpk with the cygwin or mingw gcc 
  under Win* you also need the 'gnumex' tool 
  (http://www.mrc-cbu.cam.ac.uk/Imaging/gnumex20.html), a GNU mex bat 
  options file creator for Cygwin/mingw gcc.
     

1.3.2 Instructions
	
  1/ After compiled the glpk library copy libglpk.a 
     in the glpkmex/src/ directory. If you are using cygwin, please use 
     the '-mno-cygwin' option in the CC Flags. With mingw do nothing.
 
  *** Do this additional step if you are using cygwin/mingw ***
  1b/ With gnumex make a mexopts.bat for the 'cygwin-mingw' if you are 
      using cygwin or 'mingw' if you are using mingw. Copy the 
      mexopts.bat generated by gnumex in the gnumex/src/ directory.
      
  2/ From Matlab move to the glpkmex/src/ directory and compile the mex 
     interface with the following command
     
       mex -I<path_glpk>/include glpkmex.c libglpk.a
       
     or if you are using cygwin/mingw
     	
     	 mex -f mexopts.bat -I<path_glpk>/include glpkmex.c libglpk.a
     	 
     where <path_glpk> means the path where glpk has been placed.
  
  3/ After previuos steps are completed you should have a 
     glpkmex.dll (under Windows) or a glpkmex.mexglx (under Linux) 
     interface in the src/ directory.
  
  4/ Copy glpkmex.dll/.mexglx, libglpk.a files and the help files in 
     some directory visible from Matlab or more simply add the 
     glpkmex/src/ and glpkmex/doc/ directories to the search path 
     of Matlab (Edit->Set Path...).

  5/ Check the mex interface on the examples included in the
     glpkmex/examples/ directory.
     

1.4 Syntax and parameters
--------------------------

  More details on syntax of the glpkmex can be found in the glpkmex.m 
  file. Almost all parameters available in the glpk library can be also 
  used with glpkmex interface. A list of parameters and an example on   
  how to set them are shown in the glpkparams.m file.
      