A filter algorithm for nonlinear semidefinite programming