Logical operation on a vector