## AngouriMath.Entity.Set

← Back to list of namespaces

Classes within the AngouriMath.Entity.Set namespace

• ### ConditionalSet

Summary

This is the most abstract set. Technically, you can describe
any set within this one. Formally, you can define set A of
a condition F(x) in the following way: for each element x in
the Universal x belongs to A if and only if F(x).

Example

using AngouriMath;
using System;
using static AngouriMath.Entity.Set;
using static AngouriMath.MathS;
using static AngouriMath.MathS.Sets;

var set1 = Finite(1, 2, 3);
var set2 = Finite(2, 3, 4);
var set3 = MathS.Interval(-6, 2);
var set4 = new ConditionalSet("x", "100 > x2 > 81");
Console.WriteLine(Union(set1, set2));
Console.WriteLine(Union(set1, set2).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Union(set1, set3));
Console.WriteLine(Union(set1, set3).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Union(set1, set4));
Console.WriteLine(ElementInSet(3, Union(set1, set4)));
Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify());
Console.WriteLine(ElementInSet(4, Union(set1, set4)));
Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify());
Console.WriteLine(ElementInSet(9.5, Union(set1, set4)));
Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(set1, set2));
Console.WriteLine(Intersection(set1, set2).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(set2, set3));
Console.WriteLine(Intersection(set2, set3).Simplify());
Console.WriteLine("----------------------");
var set5 = MathS.Interval(-3, 11);
Console.WriteLine(Intersection(set3, set5));
Console.WriteLine(Intersection(set3, set5).Simplify());
Console.WriteLine(Union(set3, set5));
Console.WriteLine(Union(set3, set5).Simplify());
Console.WriteLine(SetSubtraction(set3, set5));
Console.WriteLine(SetSubtraction(set3, set5).Simplify());
Console.WriteLine("----------------------");
Entity syntax1 = @"{ 1, 2, 3 } /\ { 2, 3, 4 }";
Console.WriteLine(syntax1);
Console.WriteLine(syntax1.Simplify());
Console.WriteLine("----------------------");
Entity syntax2 = @"5 in ([1; +oo) \/ { x : x < -4 })";
Console.WriteLine(syntax2);
Console.WriteLine(syntax2.Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify());
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify());
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify());

Prints
{ 1, 2, 3 } \/ { 2, 3, 4 }
{ 1, 2, 3, 4 }
----------------------
{ 1, 2, 3 } \/ [-6; 2]
{ 3 } \/ [-6; 2]
----------------------
{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
True
4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
False
19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
True
----------------------
{ 1, 2, 3 } /\ { 2, 3, 4 }
{ 2, 3 }
----------------------
{ 2, 3, 4 } /\ [-6; 2]
{ 2 }
----------------------
[-6; 2] /\ [-3; 11]
[-3; 2]
[-6; 2] \/ [-3; 11]
[-6; 11]
[-6; 2] \ [-3; 11]
[-6; -3)
----------------------
{ 1, 2, 3 } /\ { 2, 3, 4 }
{ 2, 3 }
----------------------
5 in [1; +oo) \/ { x : x < -4 }
True
----------------------
{ pi, e, 6, 11/2, 1 + 3i } /\ QQ
{ 6, 11/2 }
{ pi, e, 6, 11/2, 1 + 3i } /\ RR
{ pi, e, 6, 11/2 }
{ pi, e, 6, 11/2, 1 + 3i } /\ CC
{ pi, e, 6, 11/2, 1 + 3i }
• ### FiniteSet

Summary

A finite set is a set whose elements can be counted and enumerated
• ### Inf

Summary

This node represents whether the given element is in the set
• ### Intersectionf

Summary

Finds the intersection of two sets
It is true that an entity is in an intersection if it is in both of intersection's operands
• ### Interval

Summary

An interval represents all numbres in between two Entities
LeftClosed stands for whether Left is included
RightClosed stands for whether Right is included
• ### SetMinusf

Summary

Finds A & !B
It is true that an entity is in SetMinus if it is in Left but not in Right
• ### SpecialSet

Summary

Special set is something that cannot be easily expressed in other
types of sets.
• ### Unionf

Summary

Unites two sets
It is true that an entity is in a union if it is at least in one of union's operands

Angouri © 2019-2022 · Project's repo · Site's repo · Octicons · Transparency · 1533 pages online