hdttp.com:// Development / Languages / C, Cpp / C++ sets class 1.0

Download C++ sets class 1.0

The sets class can be used to perform set operations in your programs.
Download (14 KB)
User Rating:
( Unrated )
License:
Free ( Freeware )
Platform:
Updated:
January 15, 2001
Downloads:
67

About C++ sets class

The sets class can be used to perform set operations in your programs. It represents set elements as bits in a private array of unsigned long integers. The array size is a defined constant which can be changed to suit your application.

The sets class supports the following set operations by means of C++ operator overloading:

Union The union of two sets A, B is the set of all elements which belong to either A or B. In the sets clas, the symbol + is the binary union operator:
A + B = {x: x is in A -or- x is in B }

Intersection The intersection of two sets A, B is the set of all elements which belong to both A and B. The symbol * is the binary intersection operator:
A * B = {x: x is in A -and- x is in B }exampleLet A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. ThenA + B = {1, 2, 3, 4, 5, 6}A * B = {3, 4}

Complement In set theory, sets are subsets of a fixed universal set U. In the sets clas, U is the set of elements numbered from 1 to MAX_WORDS * WORD_SIZE. In the class declaration file below, the following definitions are made:
#define MAX_WORDS 2#define WORD_SIZE ( 8 * sizeof( unsigned long ) )These parameters make the range of U, 1 to 64 in sets. To increase or decrease the size of U, change the defined value of MAX_WORDS.

The complement of set A is the set of elements belonging to U but not belonging to A. The symbol ~ is the unary complement operator:

  • A = {x: x is in U, x is not in A } ExampleLet A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Then
  • A = {5, 6, 7, . . .}
  • B = {1, 2, 7, 8, 9, . . .}
difference The difference of two sets A, B is the set of all elements which belong to A less those in B. The symbol - is the binary difference operator:
A - B = {x: x is in A, x is not in B}exampleLet A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. ThenA - B = {1, 2}It can be shown that A - B = A * ~B.

Symmetric differenceThe symmetric difference of two sets A, B is the set of all elements which belong to A or to B, but not both.

Changes in this version:

New release

System requirements:

C/C++ compiler

( By Abecedarical Systems - C++ sets class Publisher )

User Reviews of C++ sets class

( No review posted yet )

Post a review :

By:
Title:

Rate C++ sets class

Unrated
Nova FTP Client - Fast, modern and feature rich FTP Client for Window, Mac OS X and Linux

Today Downloads:

TodoPlus (Windows edition) (to-do list) 1.620

Free task manager. Organize large to-do lists the easy way.

download
Flip_Themes_Package_Lively_Indoor 1.0

Build real page-flipping effect added digital magazines with nice Lively Indoor

download
PCUnlocker 1.7

Unlock and reset lost Windows administrator and domain passwords

download
Flipping Book 3D for DJVU 2.0

Convert DJVU to True 3D flash flippingbook with the professional software!

download
Flipping Book 3D for DOC 2.0

Convert RTF and TEXT to 3D flash flippingbook with the professional software!

download
Use this code to link to C++ sets class 1.0 download page: