VrpMacros.h
Go to the documentation of this file.
1 /*===========================================================================*
2  * This file is part of a solver for the Vehicle Routing Problem *
3  * developed using the BiCePS Linear Integer Solver (BLIS). *
4  * *
5  * This solver is distributed under the Eclipse Public License as part of *
6  * the COIN-OR repository (http://www.coin-or.org). *
7  * *
8  * Authors: Yan Xu, Lehigh University *
9  * Ted Ralphs, Lehigh University *
10  * *
11  * Copyright (C) 2007 Yan Xu and Ted Ralphs. *
12  * All Rights Reserved. *
13  *===========================================================================*/
14 
15 #ifndef VrpMacros_h_
16 #define VrpMacros_h_
17 
18 #if defined(_MSC_VER) || defined(__MNO_CYGWIN) || defined(__MINGW32__)
19 /* Different function call in Windows */
20 #define SRANDOM(seed) srand(seed)
21 #define RANDOM() rand()
22 #else
23 #define SRANDOM(seed) srandom(seed)
24 #define RANDOM() random()
25 #endif
26 
27 /*approximates the number of trucks necessary to service a set of customers*/
28 #define BINS(weight, capacity) \
29 ((int) ceil(((double)weight)/((double)capacity)))
30 
31 /*calculates the right hand side of a subtour elimination constraint*/
32 #define RHS(cust_num, weight, capacity) \
33 (cust_num-BINS(weight, capacity))
34 
35 /*===========================================================================*/
36 
37 #endif