How PSO optimizes C and gamma for SVM?

Hello
I want to implement PSO algorithm to optimize parameters C and gamma for SVM in order to improve its accuracy. Can anyone help me with the code of PSO or help me to where to start with?