MAHOUT-1580 Optimize getNumNonZeroElements() closes apache/mahout#17