I got a problem when I try to implementisdisjoint
from Python in C++.
As I understand it, isdisjoint
is a way to determine the subset I think, if there is same element in both set, then return true, otherwise return false.
In C++, I try to use std::vector<int>
instead of a Python list. Is there any way it can do the same job?
The original Python is:
if not region_neighbor(region_list[m].isdisjoint(region_list[n])) or\
not region_neighbor(region_list[n].isdisjoint(region_list[m])):
and the C++ I wrote is :
if ( includes(region_list[m],region_list[n],region_list[n],region_list[m]) )
Is there any way it can do this job.. If you have some more efficient way or advice or little hints..Please let me know! Thanks you in advance.
Or maybe just determine if there exist the same element in two vector in C++.