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-2022 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 visit scipopt.org. */
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 */
39  const int* inp, /**< unpacked input vector */
40  SCIP_SINGLEPACKET* out, /**< buffer to store the packed vector */
41  int count /**< number of elements */
42  );
43 
44 /** decode a packed single bit vector into unpacked format */
46  const SCIP_SINGLEPACKET* inp, /**< packed input vector */
47  int* out, /**< buffer to store unpacked vector */
48  int count /**< number of elements */
49  );
50 
51 /** encode a dual bit vector into packed format */
53  const int* inp, /**< unpacked input vector */
54  SCIP_DUALPACKET* out, /**< buffer to store the packed vector */
55  int count /**< number of elements */
56  );
57 
58 /** decode a packed dual bit vector into unpacked format */
60  const SCIP_DUALPACKET* inp, /**< packed input vector */
61  int* out, /**< buffer to store unpacked vector */
62  int count /**< number of elements */
63  );
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
Definition: bitencode.c:299
void SCIPdecodeSingleBit(const SCIP_SINGLEPACKET *inp, int *out, int count)
Definition: bitencode.c:122
unsigned int SCIP_DUALPACKET
Definition: bitencode.h:33
void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count)
Definition: bitencode.c:229
unsigned int SCIP_SINGLEPACKET
Definition: bitencode.h:31
void SCIPencodeSingleBit(const int *inp, SCIP_SINGLEPACKET *out, int count)
Definition: bitencode.c:32