Exemplo n.º 1
0
 /**
  * Constructs a SetAsArray for the specified size
  * of universal set.
  *
  * @param integer n The number of elements in the universal set.
  */
 public function __construct($n = 0)
 {
     parent::__construct($n);
     $this->array = new BasicArray($n);
     for ($item = 0; $item < $this->universeSize; ++$item) {
         $this->array[$item] = false;
     }
 }
Exemplo n.º 2
0
 /**
  * Constructs a SetAsBitVector for the specified size
  * of universal set.
  *
  * @param integer $n The number of elements in the universal set.
  */
 public function __construct($n = 0)
 {
     parent::__construct($n);
     $this->vector = new BasicArray(intval(($n + Limits::INTBITS - 1) / Limits::INTBITS));
     for ($i = 0; $i < $this->vector->getLength(); ++$i) {
         $this->vector[$i] = 0;
     }
 }
Exemplo n.º 3
0
 /**
  * Constructs a PartitionTree
  * for the specified element of the universal set
  * a the specified Partition.
  *
  * @param object PartitionAsForest $partition The partition.
  * @param integer $item An element of the universal set.
  */
 public function __construct(PartitionAsForest $partition, $item)
 {
     parent::__construct($partition->getUniverseSize());
     $this->partition = $partition;
     $this->item = $item;
     $this->parent = NULL;
     $this->rank = 0;
     $this->count = 1;
 }
Exemplo n.º 4
0
 /**
  * Constructs an AbstractPartition with the given universe size.
  *
  * @param integer $universeSize The size of the universal set.
  */
 public function __construct($universeSize)
 {
     parent::__construct($universeSize);
 }
Exemplo n.º 5
0
 public function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 6
0
 /**
  * Constructs a Set object of the specified type,
  * optionally with the specified data
  *
  * @param string $setType
  * @param array $data
  */
 public function __construct($setType, array $data = [])
 {
     $this->setType = $setType;
     parent::__construct($data);
 }
Exemplo n.º 7
0
 public function __construct(IComparator &$comparator = null)
 {
     parent::__construct();
     $this->_comparator = $comparator;
 }