Private constructor for three-value logic vectors.
Only for internal use.
Number of bits in the vector.
Bit vector A.
Bit vector B.
Bit vector A.
Number of bits in the vector.
Bit vector B.
An empty vector.
A single one.
A single undefined value.
A single zero.
Mask for unused bits.
For internal use.
Number of bits in the vector.
Tests if there is any defined bit in the vector.
Tests if every bit in the vector is defined.
Tests if the vector is all ones.
Tests if the vector is all zeros.
Least significant bit in the vector. Returns -1, 0 or 1.
Most significant bit in the vector. Returns -1, 0 or 1.
Compares two vectors for equality.
Gets nth value in the vector. Returns -1, 0 or 1.
Normalize the vector.
Because of the representation used, if bits is not a multiple of 32, some internal bits do not contribute to the vector value, and for performance reasons can get arbitrary values in the course of computations. This procedure clears these bits. For internal use.
Bitwise NOT of a vector.
Reducing AND of a vector.
ANDs all bits of the vector together, producing a single bit.
Singleton vector.
Reducing NAND of a vector.
NANDs all bits of the vector together, producing a single bit.
Singleton vector.
Reducing NOR of a vector.
NORs all bits of the vector together, producing a single bit.
Singleton vector.
Reducing OR of a vector.
ORs all bits of the vector together, producing a single bit.
Singleton vector.
Reducing XNOR of a vector.
XNORs all bits of the vector together, producing a single bit.
Singleton vector.
Reducing XOR of a vector.
XORs all bits of the vector together, producing a single bit.
Singleton vector.
Return a subvector.
Uses same conventions as the slice function for JS arrays.
Number of the first bit to include in the result. If omitted, first bit of the vector is used.
Number of the last bit to include in the result, plus one. If omitted, last bit of the vector is used.
Returns an array representation of the vector.
The resulting array contains values -1, 0, 1.
Returns a binary representation of the vector.
Three characters are used:
Returns an hexadecimal representation of the vector.
Returned characters can be '0' to '9', 'a' to 'f' and 'x'. An 'x' value is returned if any of the four bits is undefined.
Returns an iterator describing the vector.
In each returned value, first skip bits come from the vector B, the next skip bits come from the vector A.
This function calls toIteratorAnySkip or toIteratorPow2.
Number of bits in a single iterator step. 1 to 16.
Returns an iterator describing the vector.
In each returned value, first skip bits come from the vector B, the next skip bits come from the vector A.
Number of bits in a single iterator step. 1 to 16.
Returns an iterator describing the vector.
In each returned value, first skip bits come from the vector B, the next skip bits come from the vector A.
Number of bits in a single iterator step. 1, 2, 4, 8 or 16.
Returns an octal representation of the vector.
Returned characters can be '0' to '7' and 'x'. An 'x' value is returned if any of the three bits is undefined.
Returns a string describing the vector.
Return a vector with 1 on locations with x, the rest with 0.
Construct a vector from an array of numbers.
The following interpretation is used:
Input array.
Construct a vector from a binary string.
Three characters are accepted:
If nbits is given, data is either truncated, or extended with undefined values.
The binary string to be parsed.
Number of bits in the vector. If omitted, the resulting vector has number of bits equal to the length of data.
Construct a singleton vector containing b.
Construct a vector from a hexadecimal number.
Characters '0' to '9', 'a' to 'f' and 'x' are accepted. The character 'x' means three undefined bits.
If nbits is given, data is either truncated, or extended with undefined values.
The hexadecimal string to be parsed.
Number of bits in the vector. If omitted, the resulting vector has number of bits equal to the length of data times four.
Construct a vector from an iterable.
This function calls fromIteratorAnySkip or fromIteratorPow2.
Iterable returning initialization values, least to most significant. First skip bits go to vector B, next skip bits go to vector A.
Number of bits in a single iterator step. 1 to 16.
Number of bits in the vector.
Construct a vector from an iterable.
This function is more generic, but slower, than fromIteratorPow2.
Iterable returning initialization values, least to most significant. First skip bits go to vector B, next skip bits go to vector A.
Number of bits in a single iterator step. 1 to 16.
Number of bits in the vector.
Construct a vector from an iterable.
This function is limited to power of 2 skip values. For generic version, see fromIteratorAnySkip.
Iterable returning initialization values, least to most significant. First skip bits go to vector B, next skip bits go to vector A.
Number of bits in a single iterator step. Limited to powers of 2: 1, 2, 4, 8, 16.
Number of bits in the vector.
Construct a vector from an octal number.
Characters '0' to '7' and 'x' are accepted. The character 'x' means three undefined bits.
If nbits is given, data is either truncated, or extended with undefined values.
The octal string to be parsed.
Number of bits in the vector. If omitted, the resulting vector has number of bits equal to the length of data times three.
Construct a vector containing only ones.
Number of bits in the vector.
Construct a vector containing only undefined values.
Number of bits in the vector.
Construct a vector containing only zeros.
Number of bits in the vector.
Generated using TypeDoc
Three-value logic vectors.
This is a data class -- its contents are not mutable. Operations on logic vectors return a freshly allocated vector.
The internal representation is two bit vectors: bit vector A and B. The value at position n is encoded by two bits, one at position n in bit vector A, the other at same position in bit vector B. The bit combinations have the following meanings: