Add errorcode output argument for the solver functions
This would be nice for the user to known, if the solver converged or it the solver did not converge. Maybe even add a solver class which also contains the number of iterations, the final error, etc. such that the user has maximum knowledge of the solution that has been found.