Update svm.R

I added vectorized versions of the polynomial and rbf functions, which can be used to replace the nested for loops.