Skip to content

Commit 35fe098

Browse files
authored
Add files via upload
1 parent 392d53c commit 35fe098

1 file changed

Lines changed: 24 additions & 19 deletions

File tree

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
*********************Installation*********************
2-
- Download the zipfiile
3-
- copy all files into your current project directory
4-
- invoke `from newsets import Set`
5-
- Done!
6-
7-
*********************Simple Operations*********************
8-
+ Declare a set `A = Set(1,2,3..., universe=[universal set])`
9-
+ If B is another set to find the union just do `A + B`
10-
+ The intersection of A and B is `A & B`
11-
+ `A.powerSet()` calculates the powerset of A
12-
+ `A - B` outputs the set difference
13-
+ `A*B` calculates the cartesian product of the two sets (to calculate tripple products and higher use `A.cartesianProduct(*sets*)`
14-
+ `A.complement()` returns the complement of A with the input universe
15-
+ `A.setDisplayMode()` displays each element of A one by one by hitting enter
16-
+ Lists and sets can be freely converted between eachother by calling `A.__list__()` to convert A to a list or calling Set(*list*) to convert the list to a set object
17-
18-
___Warning___
19-
As of current, do not create sets of sets by passing in another Set object, instead just pass a list of the elements. This will be fixed soon.
1+
This package is intended to operate as a simple intuitive interface for handling laborious elementary set theory calculations.
2+
The goal is to make all operations on sets feel intuitive and number like (similar to MATLAB's handling of matrices)!
3+
4+
*********************Installation*********************
5+
Ensure that Python is installed on your machine then run `pip install SetCalcPy`
6+
Invoke `import SetCalcPy` in your file or console!
7+
Enjoy!
8+
9+
*********************Simple Operations*********************
10+
+ Declare sets like so `A = Set(1,2,3)` and `B = Set(1,2,Set(3,4))
11+
+ Take the union of two sets (find all elements in `A` or `B`): `A + B`
12+
+ Take the intersection of two sets (find all elements in `A` and `B`): `A & B`
13+
+ Take the disjoint of two sets (find all elements in `A` but not `B`): `A - B`
14+
+ Find the powerset of a set (all subsets of `A`): `A.powerSet()`
15+
+ Calculate the cartesian product of two or more sets: `A * B` or `A.cartesianProduct(*sets to multiply by*)`
16+
+ Find the complement of a set (all elements in the universe specified but not in `A`): `A.complement()`
17+
18+
*********************Other Features*********************
19+
- Iterate through sets just like lists
20+
- Access elements just like lists (the first element of `A` is `A[0]`)
21+
- Test set equality: `A == B`
22+
- Convert to a list: `A.__list__()`
23+
- Check for membership: `1 in A` evaluates to True because 1 is an element of `A`
24+
- Check length: `len(A)`

0 commit comments

Comments
 (0)