         for d in [0...@ndim]
             f += @stride[d]*p[d]
 
+        return f
+
 
     ###
     Fill the array with a given constant value

        for n in [0...@length]
            @data[n] = value

    

###


    TODO: testing with more than 1 dimension
    ###
    flat: (p) ->

        if p.length != @ndim
            throw new error.NumjisException('incorrect position dimension, got: ' + p.length + ' expecting: ' + @ndim)
