Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
Phpml\Math\Set Class Reference
Inheritance diagram for Phpml\Math\Set:

Public Member Functions

 __construct (array $elements=[])
 
 add ($element)
 
 addAll (array $elements)
 
 cardinality ()
 
 contains ($element)
 
 containsAll (array $elements)
 
 getIterator ()
 
 isEmpty ()
 
 remove ($element)
 
 removeAll (array $elements)
 
 toArray ()
 

Static Public Member Functions

static cartesian (self $a, self $b)
 Creates the Cartesian product of A and B.
 
static difference (self $a, self $b)
 Creates the difference of A and B.
 
static intersection (self $a, self $b)
 Creates the intersection of A and B.
 
static power (self $a)
 Creates the power set of A.
 
static union (self $a, self $b)
 Creates the union of A and B.
 

Constructor & Destructor Documentation

◆ __construct()

Phpml\Math\Set::__construct ( array $elements = [])
Parameters
string[] | int[] | float[] | bool[]$elements

Member Function Documentation

◆ add()

Phpml\Math\Set::add ( $element)
Parameters
string | int | float | bool$element

◆ addAll()

Phpml\Math\Set::addAll ( array $elements)
Parameters
string[] | int[] | float[] | bool[]$elements

◆ cartesian()

static Phpml\Math\Set::cartesian ( self $a,
self $b )
static

Creates the Cartesian product of A and B.

Return values
Set[]

◆ contains()

Phpml\Math\Set::contains ( $element)
Parameters
string | int | float$element

◆ containsAll()

Phpml\Math\Set::containsAll ( array $elements)
Parameters
string[] | int[] | float[]$elements

◆ power()

static Phpml\Math\Set::power ( self $a)
static

Creates the power set of A.

Return values
Set[]

◆ remove()

Phpml\Math\Set::remove ( $element)
Parameters
string | int | float$element

◆ removeAll()

Phpml\Math\Set::removeAll ( array $elements)
Parameters
string[] | int[] | float[]$elements

◆ toArray()

Phpml\Math\Set::toArray ( )
Return values
string[]|int[]|float[]|bool[]

The documentation for this class was generated from the following file: