Scippy

SCIP

Solving Constraint Integer Programs

bitencode.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file bitencode.h
17  * @brief packing single and dual bit values
18  * @author Thorsten Koch
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_BITENCODE_H__
25 #define __SCIP_BITENCODE_H__
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 typedef unsigned int SCIP_SINGLEPACKET; /**< storing single bits in packed format */
32 #define SCIP_SINGLEPACKETSIZE (sizeof(SCIP_SINGLEPACKET)*8) /**< each entry needs one bit of information */
33 typedef unsigned int SCIP_DUALPACKET; /**< storing bit pairs in packed format */
34 #define SCIP_DUALPACKETSIZE (sizeof(SCIP_DUALPACKET)*4) /**< each entry needs two bits of information */
35 
36 
37 /** encode a single bit vector into packed format */
38 extern
40  const int* inp, /**< unpacked input vector */
41  SCIP_SINGLEPACKET* out, /**< buffer to store the packed vector */
42  int count /**< number of elements */
43  );
44 
45 /** decode a packed single bit vector into unpacked format */
46 extern
48  const SCIP_SINGLEPACKET* inp, /**< packed input vector */
49  int* out, /**< buffer to store unpacked vector */
50  int count /**< number of elements */
51  );
52 
53 /** encode a dual bit vector into packed format */
54 extern
56  const int* inp, /**< unpacked input vector */
57  SCIP_DUALPACKET* out, /**< buffer to store the packed vector */
58  int count /**< number of elements */
59  );
60 
61 /** decode a packed dual bit vector into unpacked format */
62 extern
64  const SCIP_DUALPACKET* inp, /**< packed input vector */
65  int* out, /**< buffer to store unpacked vector */
66  int count /**< number of elements */
67  );
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
Definition: bitencode.c:298
void SCIPdecodeSingleBit(const SCIP_SINGLEPACKET *inp, int *out, int count)
Definition: bitencode.c:121
unsigned int SCIP_DUALPACKET
Definition: bitencode.h:33
void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count)
Definition: bitencode.c:228
unsigned int SCIP_SINGLEPACKET
Definition: bitencode.h:31
void SCIPencodeSingleBit(const int *inp, SCIP_SINGLEPACKET *out, int count)
Definition: bitencode.c:31