q1ss.binalg.vectorized
Implementation of binary linear algebra primitives.
BinMat
BinTensor
BinVec
BinVecOrMat
IntVec
UInt8Vec
bits_from_bytes
- bits_from_bytes = <function bits_from_bytes>[source]
Converts bytes to a binary vector containing the corresponding bits. The binary vector has length
8*len(b)by default, containing all bits, but length can be truncated by specifying a desirednum_bitsbetweenlen(b)-7andlen(b)(both inclusive). If a length is specified, the bits ignored at the end must all be zero.
bytes_from_bits
get_rcef_args
get_rref_args
make_rcef
- make_rcef = <function make_rcef>[source]
Constructs an
n-by-mmatrix in RCEF form with the given pivot rows and using the given bitvector to set the free binary parameters. The pivot rows must be in strict ascending order and inrange(n), and theparamsvector must have the number of entries given bynum_rcef_params.
make_rref
- make_rref = <function make_rref>[source]
Constructs an
n-by-mmatrix in RREF form with the given pivot cols and using the given bitvector to set the free binary parameters. The pivot cols must be in strict ascending order and inrange(m), and theparamsvector must have the number of entries given bynum_rref_params.
matmul2
- matmul2(lhs, rhs)[source]
Multiplies two matrices/vectors.
- Parameters:
lhs (
BinVecOrMat)rhs (
BinVecOrMat)
- Return type:
matmul_l2r
matmul_l2r_partial
- matmul_l2r_partial(start, matrices)[source]
Multiples the given array of matrices, left-to-right, starting from the given
startmatrix (or row vector). Thematricesmust all be square, with dimension less than or equal to the number of columns in thestartmatrix.Warning
This function performs no validation of its input.
- Parameters:
start (
BinVecOrMat)
- Return type:
matmul_r2l
- matmul_r2l(matrices)[source]
Multiplies the given array of matrices, right-to-left. The sequence must be non-empty and the matrices must have compatible intermediate dimensions.
Same result as
matmul_l2r, but the sequence of matrix compositions is reversed.Warning
This function performs no validation of its input.
matmul_r2l_partial
- matmul_r2l_partial(matrices, start)[source]
Multiples the given array of matrices, right-to-left, starting from the given
startmatrix (or col vector). Thematricesmust all be square, with dimension less than or equal to the number of rows in thestartmatrix.Warning
This function performs no validation of its input.
- Parameters:
start (
BinVecOrMat)
- Return type: