I agree that the implementation is quite easy. But, I believe that this function is quite useful in vector and relational algebra.
For example, the function below calculates the finite difference gradient of a given function in n-dimensional space -
function finitedifferencegradient{T<:FloatingPoint}(operator::Function, point::Array{T,1}, step::Array{T,1})
dim = length(point)
grad = zeros(Complex{T}, dim)
for i=1:dim
k = zeros(step)
k[i] = step[i]/2.0
grad[i] = (operator((point+k)...) - operator((point-k)...))/(step[i])
end
grad, norm(grad)
end
It would be nicer to write it this way:
grad = [(operator(point+proj(step,i))-operator(point-proj(step,i)))/step[i] for i=1:length(point)]
It is not really a big thing, but I think it will be useful in certain situations.
Thank you,
Rajath Shashidhara