performance increase for matrix iteration by column and preventing unnecessary copies during various grep / transform operations