(self, value)
Sets the matching vector.

        @param value: the matching vector which must contain the ID of the
          vertex matching vertex I{i} at the I{i}th position, or C{-1} if
          the vertex is unmatched.
        @raise ValueError: if the matching vector supplied does not describe
          a valid matching of the graph.
Sets the matching vector.
Sets the matching vector .
def matching(self, value):
        """Sets the matching vector.

        @param value: the matching vector which must contain the ID of the
          vertex matching vertex I{i} at the I{i}th position, or C{-1} if
          the vertex is unmatched.
        @raise ValueError: if the matching vector supplied does not describe
          a valid matching of the graph.
        """
        if not self.graph._is_matching(value, types=self._types):
            raise ValueError("not a valid matching")
        self._matching = list(value)
        self._num_matched = sum(1 for i in self._matching if i >= 0) // 2
def matching ( self , value ) : if not self . graph . _is_matching ( value , types = self . _types ) : raise ValueError ( "not a valid matching" ) self . _matching = list ( value ) self . _num_matched = sum ( 1 for i in self . _matching if i >= 0 ) // 2