MathPHP\SetTheory\Set::isDisjoint PHP Method

isDisjoint() public method

Example of disjoint sets: A = {1, 2, 3} B = {4, 5, 6}
public isDisjoint ( Set $other ) : boolean
$other Set
return boolean
    public function isDisjoint(Set $other) : bool
    {
        return empty(array_intersect_key($this->A, $other->asArray()));
    }

Usage Example

 /**
  * @dataProvider dataProviderForNotDisjoint
  */
 public function testNotDisjoint(array $A, array $B)
 {
     $setA = new Set($A);
     $setB = new Set($B);
     $this->assertFalse($setA->isDisjoint($setB));
 }