fix coding style issues
the optimizers now accept shared pointers to BasePotential