Component-wise operations for ndarrays