I simplified the problem with an example code .. the only difference is that
the vector b and the vector c are not as in the example (1: x) but they are
pointers to the position of the base matrix
ok, so if we look back at your original example:
you have a matrix, and you have two sets of points that refer to locations in that matrix. the distance between these locations can vary, and you want to perform some operations on the subset of the matrix between those locations.
Assuming you have other functions that the create matrix, c, and vectors of points, a and b, the real questions are 'what is that operation' (in your first example it was the min operation. is that not actually the case? in the last email you said 'calculate the distance'?) and 'are there any other factors/requirements/constraints?' (how large is the data set? how large are c, a, and b (separately) allowed to be? are they all int type? is b always larger than a? is there anything unique about c?)
Two useful things to read.
(1) What we're getting into falls into X-Y problems. Where you are asking how to solve X when you're actual problem is Y, because you hink solving X will solve Y, and that isn't always true. see:
http://xyproblem.info(2) please use 'bottom posting' on this help list. it makes it easier for others to follow the conversation. See
http://www.idallen.com/topposting.html (if you are using Gmail, you have to click on the 'three dots' to show previous replies when you type your message.)