A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://reference.wolfram.com/language/ref/datastructure/BitVector.html below:

BitVector—Wolfram Language Documentation

WOLFRAM Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technology expertise.

WolframConsulting.com

DATA STRUCTURE "BitVector" (Data Structure)

"BitVector"

represents a vector of Boolean values or members of a set built from an array of bits.

Details Examplesopen allclose all Basic Examples  (3)

A new "BitVector" can be created with CreateDataStructure:

Set the 20th bit to 1:

It is possible to test if a bit is set:

Extract a bit:

Invert a bit:

Get a list of the bits that are set:

Return an expression version of ds:

The normal list can be used to create a new "BitVector" :

Verify that they are equal:

A visualization of the data structure can be generated:

Testing for common bits:

The bits that are on in both:

The bits that are off in both:

Combining:

The "BitVector" only contains bits that were on in both:

Scope  (1) Information  (1)

A new "BitVector" can be created with CreateDataStructure:

Information about the data structure ds:

Properties & Relations  (3)

The numbering for bits in a "BitVector" is consistent with Power and bit operations such as BitSet.

Create two bit vectors:

Both bit vectors are initialized with zeros:

Equality can be tested with SameQ:

Change one of the bit vectors by setting a bit:

The bit vectors are no longer the same:

Inequality can be tested with UnsameQ:

Create a bit vector:

Get an array of zero/one values corresponding to the bits:

When the bit is set, the array value is one, otherwise zero:

This is equivalent to Boole applied to the Boolean list:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4