add vectorized ifelse functions
Merge pull request #4582 from lindahua/dh/ifelse

add vectorized ifelse functions