exp2l: Work around a NetBSD 10.0/i386 bug.
[gnulib.git] / lib / bitsetv.h
blobf45030ca292809d1fc6c3e6926ddd2df3584a866
1 /* Bitset vectors.
3 Copyright (C) 2002, 2004, 2009-2015, 2018-2024 Free Software Foundation,
4 Inc.
6 Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
21 #ifndef _BITSETV_H
22 #define _BITSETV_H
24 /* This file uses _GL_ATTRIBUTE_DEALLOC. */
25 #if !_GL_CONFIG_H_INCLUDED
26 #error "Please include config.h first."
27 #endif
29 #include "bitset.h"
31 typedef bitset * bitsetv;
33 /* Free vector of bitsets. Do nothing if NULL. */
34 void bitsetv_free (bitsetv);
36 /* Create a vector of N_VECS bitsets, each of N_BITS, and of
37 type TYPE. */
38 bitsetv bitsetv_alloc (bitset_bindex, bitset_bindex, enum bitset_type)
39 _GL_ATTRIBUTE_DEALLOC (bitsetv_free, 1);
41 /* Create a vector of N_VECS bitsets, each of N_BITS, and with
42 attribute hints specified by ATTR. */
43 bitsetv bitsetv_create (bitset_bindex, bitset_bindex, unsigned)
44 _GL_ATTRIBUTE_DEALLOC (bitsetv_free, 1);
46 /* Zero vector of bitsets. */
47 void bitsetv_zero (bitsetv);
49 /* Set vector of bitsets. */
50 void bitsetv_ones (bitsetv);
52 /* Given a vector BSETV of N bitsets of size N, modify its contents to
53 be the transitive closure of what was given. */
54 void bitsetv_transitive_closure (bitsetv);
56 /* Given a vector BSETV of N bitsets of size N, modify its contents to
57 be the reflexive transitive closure of what was given. This is
58 the same as transitive closure but with all bits on the diagonal
59 of the bit matrix set. */
60 void bitsetv_reflexive_transitive_closure (bitsetv);
62 /* Dump vector of bitsets. */
63 void bitsetv_dump (FILE *, const char *, const char *, bitsetv);
65 /* Function to debug vector of bitsets from debugger. */
66 void debug_bitsetv (bitsetv);
68 /* Dump vector of bitsets as a matrix. */
69 void bitsetv_matrix_dump (FILE *, const char *, bitsetv);
71 #endif /* _BITSETV_H */