Scippy

SoPlex

Sequential object-oriented simPlex

cring.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the class library */
4 /* SoPlex --- the Sequential object-oriented simPlex. */
5 /* */
6 /* Copyright (C) 1996-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 #ifndef _CRING_H_
17 #define _CRING_H_
18 
19 /***************************************************************
20  Double linked ring
21  ***************************************************************/
22 
23 #define initDR(ring) ((ring).prev = (ring).next = &(ring))
24 
25 #define init2DR(elem, ring) \
26 { \
27 (elem).next = (ring).next; \
28 (elem).next->prev = &(elem); \
29 (elem).prev = &(ring); \
30 (ring).next = &(elem); \
31 }
32 
33 #define removeDR(ring) \
34 { \
35 (ring).next->prev = (ring).prev; \
36 (ring).prev->next = (ring).next; \
37 }
38 
39 #endif // _CRING_H_