Posts

Showing posts from February, 2016

Using POSIX threads in Microsoft Visual Studio

Image
Threads can be used to implement parallelism. For UNIX-based systems, a standardized C language threads programming interface has been specified by the IEEE POSIX 1003.1c standard. Implementations that adhere to this standard are referred to as POSIX threads, or Pthreads. Windows does not support pthreads directly, instead the Pthreads-w32 project seeks to provide a portable and open-source wrapper implementation. The first step is to obtain the pthread project from the following ftp site: ftp://sourceware.org/pub/pthreads-win32/ And extract it to a location of your choice: This will be the location of where your project dependencies and additional library files will be located. To demonstrate an example pthreads usage in a Microsoft Visual Studio environment, first create a new Empty Project: Add the main.cpp source file to your empty project and use the following code sample: [code language="cpp"] #include <pthread.h> #include <stdio.h>...

Getting started with Gurobi in Microsoft Visual Studio

Image
A guide on how to get up and running with Gurobi , a powerful software tool that is well suited to finding solutions to tough optimization problems encountered in industry and academic research. In addition to finding good solutions within practical time scales, I was pleasantly surprised to discover how easy it was easy to use and configure within Microsoft Visual Studio. To apply the Gurobi tools to optimization problems, the developer simply makes calls to Gurobi Application Program Interfaces (APIs) at the appropriate places in the code, tweaking them to suit the application area. The following steps demonstrate how to achieve this for a mixed integer programming problem: 1. Install & Licence Gurobi Run the Gurobi installer file. At the time of writing this post, I installed 32-bit version of Gurobi 6.5.0, using the straightforward 'vanilla' installation: ... thereby installing Gurobi, and it's contents to a default location: 2. Create a new...