Next: Providing the multidimensional system of equations to solve, Previous: Overview of Multidimensional Root Finding, Up: Multidimensional Root-Finding [Index]
The following functions initialize a multidimensional solver, either with or without derivatives. The solver itself depends only on the dimension of the problem and the algorithm and can be reused for different problems.
This function returns a pointer to a newly allocated instance of a solver of type T for a system of n dimensions. For example, the following code creates an instance of a hybrid solver, to solve a 3-dimensional system of equations.
const gsl_multiroot_fsolver_type * T = gsl_multiroot_fsolver_hybrid; gsl_multiroot_fsolver * s = gsl_multiroot_fsolver_alloc (T, 3);
If there is insufficient memory to create the solver then the function
returns a null pointer and the error handler is invoked with an error
code of GSL_ENOMEM
.
This function returns a pointer to a newly allocated instance of a derivative solver of type T for a system of n dimensions. For example, the following code creates an instance of a Newton-Raphson solver, for a 2-dimensional system of equations.
const gsl_multiroot_fdfsolver_type * T = gsl_multiroot_fdfsolver_newton; gsl_multiroot_fdfsolver * s = gsl_multiroot_fdfsolver_alloc (T, 2);
If there is insufficient memory to create the solver then the function
returns a null pointer and the error handler is invoked with an error
code of GSL_ENOMEM
.
These functions set, or reset, an existing solver s to use the function f or function and derivative fdf, and the initial guess x. Note that the initial position is copied from x, this argument is not modified by subsequent iterations.
These functions free all the memory associated with the solver s.
These functions return a pointer to the name of the solver. For example,
printf ("s is a '%s' solver\n", gsl_multiroot_fdfsolver_name (s));
would print something like s is a 'newton' solver
.