Home » Software Development » C/C++ » C++ sets class 1.0
( Free full version | 14 KB )
C++ sets class 1.0
The sets class can be used to perform set operations in your programs.
- Developer:
- Abecedarical Systems
- License:
- Freeware
- OS:
- Windows 98 / ME
- Requirements:
- C/C++ compiler
- Price:
- Free
Price is subject to change at any time by the company - Date added:
- 6/12/2008
- Last Update:
- 9/17/2006
- User Rating:
- Not yet rated.
- Your Rating:
( Free full version | 14 KB ) C++ sets class 1.0 Publisher's description
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 class, 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 }
example
Let A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Then
A + 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 class, 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 }
example
Let 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}
example
Let A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Then
A - B = {1, 2}
It can be shown that A - B = A * ~B.
symmetric difference
The symmetric difference of two sets A, B is the set of all elements which belong to A or to B, but not both.
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 class, 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 }
example
Let A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Then
A + 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 class, 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 }
example
Let 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}
example
Let A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Then
A - B = {1, 2}
It can be shown that A - B = A * ~B.
symmetric difference
The symmetric difference of two sets A, B is the set of all elements which belong to A or to B, but not both.
Related downloads for C++ sets class
Visual Lint Professional Edition 1.5.5Visual Lint integrates Gimpel PC-Lint within the Visual Studio IDE.
COMM-DRV++ 1.0Easy to use professional C++ serial communication class library for Windows
Collection of C++ Builder Examples 6.0Collection of C++ Builder examples and tutorials
Visual Lint Standard Edition 1.5Visual Lint integrates Gimpel PC-Lint within the Visual Studio IDE.
Easy Way to Create eBooks using C++ 2.0Use your Visual C++ compiler to compile HTML files into a Windows executable
New release of C/C++
Barcode Label Maker and Print Creator 3.0.1.5Download barcode creator application to make several customized bar code labels
Lingobit Extractor 1.0Extracts hard-coded strings from C++ source files to resources
Time Series API 2.1.0Professional time series modelling and simulation library for C++
DCGenS 1.0allows code manipulation like data. code can be generated dynamically and run
Falco Script Processor 2.0- Script Processor. Any function evaluation. C++ and Delphi samples.
More products from Abecedarical Systems
Almanac 1.0Calculates the times of rise, set, and transit of the sun, moon, and planets.
TimeWarp 3.0A utility for setting your computer's clock using an internet time source.
Zeno Interpreter 1.2Interpreter for the Zeno programming language. Includes text editor, and help.
Simulated Annealing Demonstration 1.0This is a Java application that demonstrates the Simulated Annealing algorithm.
Spreadsheet Calculator (SCalc) for UNIX 1.0SCalc is a simple spread sheet program.
Categories
- » Software Development
- ActiveX
- Compilers & IDEs
- Component & Library
- Database & Network
- Debugging Tool
- Helpfile Tools
- Java & .Net
- C/C++
- Reference & Tutorial
- Tool & Editor
- Management & Distribution
- Source Code
- Miscellaneous
- Delphi & BCB
- Registration Tools
- Visual Basic
- » MP3 & Audio
- » Multimedia & Design
- » Desktop Enhancement
- » Games
- » Home & Education
- » Business & Finance
- » Internet
- » Utility
- » Web Developer
