added functions in SGNDArray

@iglesias @hushell
Could you help me to check this patch? Thanks!
What would happen if index is null or if it doesn't have num_dims elements? I think this method should make these checks. As it is right now it would terribly fail in those cases I believe.