Beispiel #1
0
 static function compareInfWithOrder(Interval $intvA, Interval $intvB, $nestLevel)
 {
     $comp = 0;
     $inf = self::$comparatorsIIF->get($nestLevel);
     $order = $inf->getSortingOrder();
     if ($order == '<' || $order != '>') {
         if ($intvB->getStat($inf) < $intvA->getStat($inf)) {
             $comp = -1;
         } else {
             if ($intvB->getStat($inf) > $intvA->getStat($inf)) {
                 $comp = 1;
             } else {
                 $comp = 0;
             }
         }
     } else {
         if ($intvB->getStat($inf) > $intvA->getStat($inf)) {
             $comp = -1;
         } else {
             if ($intvB->getStat($inf) < $intvA->getStat($inf)) {
                 $comp = 1;
             } else {
                 $comp = 0;
             }
         }
     }
     return $comp;
 }
 public function getResults(Interval $intv, ListScheme $schemes)
 {
     $freq = 0;
     $max = $this->tNbr + $this->distance;
     $bIntv = false;
     for ($i = $this->distance; $i < $max; $i++) {
         $j = 0;
         while ($j < $intv->size()) {
             $intvNumber = $intv->get($j);
             if (!$schemes->get($i)->hasNumber(new Number($intvNumber, false))) {
                 $bIntv = false;
                 break;
             }
             $bIntv = true;
             $j++;
         }
         if ($bIntv) {
             $freq++;
         }
     }
     return $freq;
 }
Beispiel #3
0
 public function testToString()
 {
     $interval = new Interval([4, 18, 25, 42]);
     $this->assertTrue($interval->toString() == "4 - 18 - 25 - 42");
 }