added functions in SGNDArray

@iglesias @hushell
Could you help me to check this patch? Thanks!
Because the block inside is just one line. Just a suggestion for this and the other one-liners for loops in the cpp file.