fixed exponential complexity malloc in opDiag and opMask when sweeping over columns