@subutai  these removed if (NDims == 1 ) come from  	c1a9533 , and are hand-coded optimizations, imho compile would optimize it away anyway (gcc loop-unrolling at >= -O2), so to clean the code. They're just small (LOC wise), so no strong feeling. I can also be wrong about the compiler optim., but as far as i understand it, NDims is const and the forloop for 1 iteration will be removed.