func (p *Particle) Update(newp *optim.Point) { // DO NOT update p's position with newp's position - it may have been // projected onto a mesh and be different. p.Val = newp.Val if p.Val < p.Best.Val { p.Best = newp.Clone() } }