use tips from SciRuby/nmatrix#88