It seems that your issue is a result of having your heart set on using an array. Using a vector would allow you to add grid points dynamically as well as averaging (and performing other calculations) whenever you wanted.
That being said, if you really want to use an array then like you have noticed you cannot use doubles and/or negative values as indices. You could work out a system by adding an offset and multiplying your x,y values to get rounded integers and a center not at (0,0) but maybe at (2,2) or something instead but this would be really unwieldy and confusing.