Unsigned Binary Vectors

**UBVEC**
is a Python library which
demonstrates how unsigned binary vectors, strings of 0's and 1's,
can represent nonnegative integers or subsets or other mathematical
objects, for which various arithmetic and logical operations can
be defined.

The computer code and data files made available on this web page are distributed under the GNU LGPL license.

**UBVEC** is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.

BVEC, a Python library which demonstrates how signed integers can be stored as binary vectors, and arithmetic can be performed on them.

SUBSET, a Python library which enumerates, generates, randomizes, ranks and unranks combinatorial objects including combinations, compositions, Gray codes, index sets, partitions, permutations, polynomials, subsets, and Young tables. Backtracking routines are included to solve some combinatorial problems.

- i4_choose.py, computes the binomial coefficient C(N,K) as an I4.
- i4_uniform_ab.py, returns a scaled pseudorandom I4 between A and B.
- i4vec_print.py, prints an I4VEC;
- i4vec_sum.py, sums an I4VEC;
- i4vec_uniform_ab.py, returns a pseudorandom I4VEC;
- ksubset_colex_unrank.py, computes the K subset of given colex rank.
- ksubset_enum.py, enumerates the K subsets of an N set.
- morse_thue.py, generates a Morse_Thue number.
- nim_sum.py, computes the Nim sum of two integers.
- timestamp.py, prints the current YMDHMS date as a time stamp.
- ubvec_add.py, adds two unsigned binary vectors.
- ubvec_and.py, computes the AND of two unsigned binary vectors.
- ubvec_check.py, checks an unsigned binary vector.
- ubvec_complement1.py, computes the one's complement of an unsigned binary vector.
- ubvec_enum.py, enumerates the unsigned binary vectors of length N.
- ubvec_next.py, generates the next UBVEC.
- ubvec_next_gray.py, generates the next UBVEC in Gray code order.
- ubvec_next_grlex.py, generates the next UBVEC in GRLEX order.
- ubvec_or.py, computes the OR of two unsigned binary vectors.
- ubvec_print.py, prints a UBVEC, with an optional title.
- ubvec_random.py, returns a pseudorandom UBVEC.
- ubvec_rank_gray.py, ranks a UBVEC according to the Gray ordering.
- ubvec_reverse.py, reverses a UBVEC.
- ubvec_to_ui4.py, makes an unsigned integer from an unsigned binary vector.
- ubvec_unrank_gray.py, unranks a UBVEC using the Gray ordering.
- ubvec_unrank_grlex.py, unranks a UBVEC using the GRLEX ordering.
- ubvec_xor.py, computes the exclusive OR of two unsigned binary vectors.
- ui4_rank_gray.py, ranks a Gray code.
- ui4_to_ubvec.py, makes an unsigned binary vector from an unsigned integer.
- ui4_unrank_gray.py, unranks a Gray code.

- ubvec_prb.py, calls all the tests.
- ubvec_prb.sh, runs all the tests.
- ubvec_test_output.txt, the output file.

You can go up one level to the Python source codes.