I am new to C++ and want to do vector element elimination.
My vectors are like:
<vector<vector>> objPoints;
<vector<vector>> delPoints;
<vector<vector>> objPoints2;
each objPoints has size 1000x3 and has all points. From objPoints i want to remove delPoints i.e. the (X,Y,Z) values that reside in each row.
Can anyone please tell me syntax?
One obivious method would be:
You can do it much more efficiently if you are allowed to sort the vectors. I will provide you with method and pseudo code then you can implement it on you own.
For comaprison, first compare w.r.t
x cordinate
theny
and thenz
. For sorting, you can usestd::sort
with same comparison function described in previous line. For deleting, you can usestd::vector::erase
.Or you can implement your own fuctions.