Particle Swarm Optimisation objective like implementation in plain old C