VinaLC: Parallel Molecular Docking Program

Biochemical and Biophysical Systems Group
VinaLC version: 1.1.2

macros.h
Go to the documentation of this file.
1 /*
2 
3  Copyright (c) 2004-2010, Dr. Oleg Trott <ot14@columbia.edu>
4 
5  Licensed under the Apache License, Version 2.0 (the "License");
6  you may not use this file except in compliance with the License.
7  You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 
17 */
18 
19 #ifndef VINA_MACROS_H
20 #define VINA_MACROS_H
21 
22 #define VINA_FOR_IN(i, v) for(std::size_t VINA_MACROS_TMP = (v).size(), (i) = 0; (i) < VINA_MACROS_TMP; ++(i))
23 #define VINA_FOR(i, n) for(std::size_t VINA_MACROS_TMP = (n), (i) = 0; (i) < VINA_MACROS_TMP; ++(i))
24 #define VINA_U_FOR(i, n) for(unsigned VINA_MACROS_TMP = (n), (i) = 0; (i) < VINA_MACROS_TMP; ++(i))
25 
26 #define VINA_RANGE(i, a, b) for(std::size_t VINA_MACROS_TMP = (b), (i) = (a); (i) < VINA_MACROS_TMP; ++(i))
27 #define VINA_U_RANGE(i, a, b) for(unsigned VINA_MACROS_TMP = (b), (i) = (a); (i) < VINA_MACROS_TMP; ++(i))
28 #define VINA_I_RANGE(i, a, b) for(int VINA_MACROS_TMP = (b), (i) = (a); (i) < VINA_MACROS_TMP; ++(i))
29 
30 #define VINA_LOOP_CONST(t, i, v) for(t::const_iterator (i) = (v).begin(); (i) != (v).end(); ++(i))
31 #define VINA_LOOP(t, i, v) for(t::iterator (i) = (v).begin(); (i) != (v).end(); ++(i))
32 
33 #define VINA_SHOW(x) do { std::cout << #x << " = " << (x) << std::endl; } while(false)
34 #define VINA_SHOW_FAST(x) do { std::cout << #x << " = " << (x) << '\n'; } while(false)
35 #define VINA_ESHOW(x) do { std::cerr << #x << " = " << (x) << '\n'; } while(false)
36 
37 #endif