added functions in SGNDArray

@iglesias @hushell
Could you help me to check this patch? Thanks!
maybe this way better? the flatten length of the ND array?