/** * * @param Edges $edges * @depends testTwo */ public function testTwoMatch(Edges $edges) { $edgesMatch = $edges->getEdgesMatch(array($this, 'returnTrue')); $this->assertEquals($edges->getVector(), $edgesMatch->getVector()); $edgeMatch = $edges->getEdgeMatch(array($this, 'returnTrue')); $this->assertEquals($edges->getEdgeFirst(), $edgeMatch); }
/** * get alternating sequence of vertex, edge, vertex, edge, ..., vertex * * @return array */ public function getAlternatingSequence() { $edges = $this->edges->getVector(); $vertices = $this->vertices->getVector(); $ret = array(); for ($i = 0, $l = count($this->edges); $i < $l; ++$i) { $ret[] = $vertices[$i]; $ret[] = $edges[$i]; } $ret[] = $vertices[$i]; return $ret; }