Function plansys2::cart_product

Function Documentation

void plansys2::cart_product(std::vector<std::vector<std::string>> &rvvi, std::vector<std::string> &rvi, std::vector<std::vector<std::string>>::const_iterator me, std::vector<std::vector<std::string>>::const_iterator end)

Compute the Cartesian product of vectors of strings. This function recursively computes all possible combinations of elements from multiple vectors. For example, given vectors [a,b] and [1,2], it generates combinations [a,1], [a,2], [b,1], [b,2]. It’s used primarily for expanding quantified expressions in PDDL.

Parameters:
  • rvvi[out] Result vector containing all combinations.

  • rvi[out] Current combination being built.

  • me[in] Iterator to the current vector in the input.

  • end[in] Iterator to the end of the input vectors.