>>>> *gsl_vector_ptr(v, i) += x >> *(gsl_vector_ptr(v, i)) += x;
Why the extra parens? They hurt nothing, but the former statement without them works just fine for me. Unless I'm mistaken, the function application happens before the dereference. And the dereference is much, much higher than anything like += or *= that the user might want. >> This could lead to trouble so its probably better to have a function >> which does range checking, etc. There is range checking in gsl_vector_ptr, so long as someone doesn't start doing pointer arithmetic on its result. Lastly, the pointer-based solution is nicely general: *(i > j ? gsl_vector_ptr(v, i) : gsl_vector_ptr(j)) += 1 - Rhys
