Binary Vector Representation of Signed Integers

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

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

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

L4LIB, a MATLAB library which contains many utility routines, using one byte logical (L4) variables.

SUBSET, a MATLAB 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.

UBVEC, a MATLAB 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.

- bvec_add.m, adds two binary vectors.
- bvec_and.m, computes the logical AND of two binary vectors.
- bvec_check.m, checks a binary vector.
- bvec_complement2.m, returns the complement of a binary vector.
- bvec_enum.m, returns the number of binary vectors of given length.
- bvec_mul.m, multiplies two binary vectors.
- bvec_next.m, returns the next binary vector.
- bvec_next_grlex.m, returns the next binary vector in GRLEX order.
- bvec_not.m, negates a binary vector.
- bvec_or.m, returns the logical OR of two binary vectors.
- bvec_print.m, prints a binary vector.
- bvec_reverse.m, reverses a binary vector.
- bvec_sub.m, subtracts two binary vectors.
- bvec_to_i4.m, converts a (signed) binary vector to an integer.
- bvec_uniform.m, returns a random BVEC (a binary vector).
- bvec_xor.m, returns the exclusive OR of two binary vectors.
- i4_bclr.m, sets a given bit of an I4 to 0.
- i4_bset.m, sets a given bit of an I4 to 1.
- i4_btest.m, returns TRUE if bit POS of I is a 1.
- i4_to_bvec.m, converts an I4 to a (signed) binary vector.
- i4_uniform_ab.m, returns a random integer in a given range.
- s_len_trim.m, returns the length of a string to the last nonblank.
- timestamp.m, returns the current YMDHMS date as a timestamp.

- bvec_test.m, runs all the tests;
- bvec_test_output.txt, the output file;
- bvec_add_test.m
- bvec_complement2_test.m
- bvec_mul_test.m
- bvec_next_test.m
- bvec_print_test.m
- bvec_sub_test.m
- bvec_to_i4_test.m
- bvec_uniform_test.m
- i4_bclr_test.m
- i4_bset_test.m
- i4_btest_test.m
- i4_to_bvec_text

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