Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper handling of some callbacks and create some wrapper objects with automatic memory management #132

Merged
merged 14 commits into from
Feb 2, 2024
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ version = "1.0.1"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
GSL_jll = "1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[compat]
SpecialFunctions = "0.8, 0.9, 0.10, 1"
GSL_jll = "2.6"
REPL = "1.3.0"
julia = "1.3.0"

[extras]
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ GSL.C.sf_legendre_array(GSL_SF_LEGENDRE_SPHARM, lmax, x, result)
```julia
f = x -> x^5+1
df = x -> 5*x^4
fdf = @gsl_function_fdf(f, df)
solver = root_fdfsolver_alloc(gsl_root_fdfsolver_newton)
root_fdfsolver_set(solver, fdf, -2)
solver = GSLRootFDFSolver(gsl_root_fdfsolver_newton)
root_fdfsolver_set(solver, (f, df), -2)
while abs(f(root_fdfsolver_root(solver))) > 1e-10
root_fdfsolver_iterate(solver)
end
Expand All @@ -87,7 +86,6 @@ println("x = ", root_fdfsolver_root(solver))
Extra functionality defined in this package:

* Convenience functions `hypergeom` and `hypergeom_e` for the hypergeometric functions.
* Function wrapping macros `@gsl_function`, `@gsl_function_fdf`, `@gsl_multiroot_function` and `@gsl_multiroot_function_fdf` that are used for packaging Julia functions so that they can be passed to GSL.
* Functions `wrap_gsl_vector` and `wrap_gsl_matrix` that return a Julia array or matrix pointing to the data in a `gsl_vector` or `gsl_matrix`.

In addition, some effort has been put into giving most types and functions proper docstrings, e.g.
Expand Down
1 change: 1 addition & 0 deletions src/GSL.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module GSL

using Markdown
using REPL # For Docs.doc

# BEGIN MODULE C
# low-level interface
Expand Down
2 changes: 1 addition & 1 deletion src/gen/direct_wrappers/gsl_chebyshev_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ GSL documentation:
> and requires $n$ function evaluations.

"""
function cheb_init(cs, func, a, b)
function cheb_init(cs, func::gsl_function, a, b)
ccall((:gsl_cheb_init, libgsl), Cint, (Ref{gsl_cheb_series}, Ref{gsl_function}, Cdouble, Cdouble), cs, func, a, b)
end

Expand Down
6 changes: 3 additions & 3 deletions src/gen/direct_wrappers/gsl_deriv_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ GSL documentation:
> actually used.

"""
function deriv_central(f, x, h, result, abserr)
function deriv_central(f::F, x, h, result, abserr) where F
ccall((:gsl_deriv_central, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}), f, x, h, result, abserr)
end

Expand All @@ -58,7 +58,7 @@ GSL documentation:
> negative step-size.

"""
function deriv_backward(f, x, h, result, abserr)
function deriv_backward(f::F, x, h, result, abserr) where F
ccall((:gsl_deriv_backward, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}), f, x, h, result, abserr)
end

Expand Down Expand Up @@ -89,7 +89,7 @@ GSL documentation:
> $x+h/2$, $x+h$.

"""
function deriv_forward(f, x, h, result, abserr)
function deriv_forward(f::F, x, h, result, abserr) where F
ccall((:gsl_deriv_forward, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}), f, x, h, result, abserr)
end

6 changes: 3 additions & 3 deletions src/gen/direct_wrappers/gsl_diff_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
C signature:
`int gsl_diff_central (const gsl_function *f, double x, double *result, double *abserr)`
"""
function diff_central(f, x, result, abserr)
function diff_central(f::F, x, result, abserr) where F
ccall((:gsl_diff_central, libgsl), Cint, (Ref{gsl_function}, Cdouble, Ref{Cdouble}, Ref{Cdouble}), f, x, result, abserr)
end

Expand All @@ -22,7 +22,7 @@ end
C signature:
`int gsl_diff_backward (const gsl_function *f, double x, double *result, double *abserr)`
"""
function diff_backward(f, x, result, abserr)
function diff_backward(f::F, x, result, abserr) where F
ccall((:gsl_diff_backward, libgsl), Cint, (Ref{gsl_function}, Cdouble, Ref{Cdouble}, Ref{Cdouble}), f, x, result, abserr)
end

Expand All @@ -32,7 +32,7 @@ end
C signature:
`int gsl_diff_forward (const gsl_function *f, double x, double *result, double *abserr)`
"""
function diff_forward(f, x, result, abserr)
function diff_forward(f::F, x, result, abserr) where F
ccall((:gsl_diff_forward, libgsl), Cint, (Ref{gsl_function}, Cdouble, Ref{Cdouble}, Ref{Cdouble}), f, x, result, abserr)
end

46 changes: 23 additions & 23 deletions src/gen/direct_wrappers/gsl_integration_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ end
C signature:
`void gsl_integration_qk15 (const gsl_function * f, double a, double b, double *result, double *abserr, double *resabs, double *resasc)`
"""
function integration_qk15(f, a, b, result, abserr, resabs, resasc)
function integration_qk15(f::F, a, b, result, abserr, resabs, resasc) where F
ccall((:gsl_integration_qk15, libgsl), Cvoid, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, result, abserr, resabs, resasc)
end

Expand All @@ -263,7 +263,7 @@ end
C signature:
`void gsl_integration_qk21 (const gsl_function * f, double a, double b, double *result, double *abserr, double *resabs, double *resasc)`
"""
function integration_qk21(f, a, b, result, abserr, resabs, resasc)
function integration_qk21(f::F, a, b, result, abserr, resabs, resasc) where F
ccall((:gsl_integration_qk21, libgsl), Cvoid, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, result, abserr, resabs, resasc)
end

Expand All @@ -273,7 +273,7 @@ end
C signature:
`void gsl_integration_qk31 (const gsl_function * f, double a, double b, double *result, double *abserr, double *resabs, double *resasc)`
"""
function integration_qk31(f, a, b, result, abserr, resabs, resasc)
function integration_qk31(f::F, a, b, result, abserr, resabs, resasc) where F
ccall((:gsl_integration_qk31, libgsl), Cvoid, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, result, abserr, resabs, resasc)
end

Expand All @@ -283,7 +283,7 @@ end
C signature:
`void gsl_integration_qk41 (const gsl_function * f, double a, double b, double *result, double *abserr, double *resabs, double *resasc)`
"""
function integration_qk41(f, a, b, result, abserr, resabs, resasc)
function integration_qk41(f::F, a, b, result, abserr, resabs, resasc) where F
ccall((:gsl_integration_qk41, libgsl), Cvoid, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, result, abserr, resabs, resasc)
end

Expand All @@ -293,7 +293,7 @@ end
C signature:
`void gsl_integration_qk51 (const gsl_function * f, double a, double b, double *result, double *abserr, double *resabs, double *resasc)`
"""
function integration_qk51(f, a, b, result, abserr, resabs, resasc)
function integration_qk51(f::F, a, b, result, abserr, resabs, resasc) where F
ccall((:gsl_integration_qk51, libgsl), Cvoid, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, result, abserr, resabs, resasc)
end

Expand All @@ -303,7 +303,7 @@ end
C signature:
`void gsl_integration_qk61 (const gsl_function * f, double a, double b, double *result, double *abserr, double *resabs, double *resasc)`
"""
function integration_qk61(f, a, b, result, abserr, resabs, resasc)
function integration_qk61(f::F, a, b, result, abserr, resabs, resasc) where F
ccall((:gsl_integration_qk61, libgsl), Cvoid, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, result, abserr, resabs, resasc)
end

Expand All @@ -313,7 +313,7 @@ end
C signature:
`void gsl_integration_qcheb (gsl_function * f, double a, double b, double *cheb12, double *cheb24)`
"""
function integration_qcheb(f, a, b, cheb12, cheb24)
function integration_qcheb(f::F, a, b, cheb12, cheb24) where F
ccall((:gsl_integration_qcheb, libgsl), Cvoid, (Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}), f, a, b, cheb12, cheb24)
end

Expand All @@ -323,7 +323,7 @@ end
C signature:
`void gsl_integration_qk (const int n, const double xgk[], const double wg[], const double wgk[], double fv1[], double fv2[], const gsl_function *f, double a, double b, double * result, double * abserr, double * resabs, double * resasc)`
"""
function integration_qk(n, xgk, wg, wgk, fv1, fv2, f, a, b, result, abserr, resabs, resasc)
function integration_qk(n, xgk, wg, wgk, fv1, fv2, f::F, a, b, result, abserr, resabs, resasc) where F
ccall((:gsl_integration_qk, libgsl), Cvoid, (Cint, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{gsl_function}, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}), n, xgk, wg, wgk, fv1, fv2, f, a, b, result, abserr, resabs, resasc)
end

Expand All @@ -348,7 +348,7 @@ GSL documentation:
> of function evaluations.

"""
function integration_qng(f, a, b, epsabs, epsrel, result, abserr, neval)
function integration_qng(f::F, a, b, epsabs, epsrel, result, abserr, neval) where F
ccall((:gsl_integration_qng, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Cdouble, Ref{Cdouble}, Ref{Cdouble}, Ref{Csize_t}), f, a, b, epsabs, epsrel, result, abserr, neval)
end

Expand Down Expand Up @@ -394,7 +394,7 @@ GSL documentation:
> allocated size of the workspace.

"""
function integration_qag(f, a, b, epsabs, epsrel, limit, key, workspace, result, abserr)
function integration_qag(f::F, a, b, epsabs, epsrel, limit, key, workspace, result, abserr) where F
ccall((:gsl_integration_qag, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Cdouble, Csize_t, Cint, Ref{gsl_integration_workspace}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, epsabs, epsrel, limit, key, workspace, result, abserr)
end

Expand All @@ -420,7 +420,7 @@ GSL documentation:
> In this case a lower-order rule is more efficient.

"""
function integration_qagi(f, epsabs, epsrel, limit, workspace, result, abserr)
function integration_qagi(f::F, epsabs, epsrel, limit, workspace, result, abserr) where F
ccall((:gsl_integration_qagi, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{Cdouble}, Ref{Cdouble}), f, epsabs, epsrel, limit, workspace, result, abserr)
end

Expand All @@ -443,7 +443,7 @@ GSL documentation:
> and then integrated using the QAGS algorithm.

"""
function integration_qagiu(f, a, epsabs, epsrel, limit, workspace, result, abserr)
function integration_qagiu(f::F, a, epsabs, epsrel, limit, workspace, result, abserr) where F
ccall((:gsl_integration_qagiu, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{Cdouble}, Ref{Cdouble}), f, a, epsabs, epsrel, limit, workspace, result, abserr)
end

Expand All @@ -466,7 +466,7 @@ GSL documentation:
> and then integrated using the QAGS algorithm.

"""
function integration_qagil(f, b, epsabs, epsrel, limit, workspace, result, abserr)
function integration_qagil(f::F, b, epsabs, epsrel, limit, workspace, result, abserr) where F
ccall((:gsl_integration_qagil, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{Cdouble}, Ref{Cdouble}), f, b, epsabs, epsrel, limit, workspace, result, abserr)
end

Expand All @@ -493,7 +493,7 @@ GSL documentation:
> which may not exceed the allocated size of the workspace.

"""
function integration_qags(f, a, b, epsabs, epsrel, limit, workspace, result, abserr)
function integration_qags(f::F, a, b, epsabs, epsrel, limit, workspace, result, abserr) where F
ccall((:gsl_integration_qags, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, epsabs, epsrel, limit, workspace, result, abserr)
end

Expand Down Expand Up @@ -527,7 +527,7 @@ GSL documentation:
> region then this routine will be faster than `gsl_integration_qags`.

"""
function integration_qagp(f, pts, npts, epsabs, epsrel, limit, workspace, result, abserr)
function integration_qagp(f::F, pts, npts, epsabs, epsrel, limit, workspace, result, abserr) where F
ccall((:gsl_integration_qagp, libgsl), Cint, (Ref{gsl_function}, Ref{Cdouble}, Csize_t, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{Cdouble}, Ref{Cdouble}), f, pts, npts, epsabs, epsrel, limit, workspace, result, abserr)
end

Expand Down Expand Up @@ -566,7 +566,7 @@ GSL documentation:
> ordinary 15-point Gauss-Kronrod integration rule.

"""
function integration_qawc(f, a, b, c, epsabs, epsrel, limit, workspace, result, abserr)
function integration_qawc(f::F, a, b, c, epsabs, epsrel, limit, workspace, result, abserr) where F
ccall((:gsl_integration_qawc, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, c, epsabs, epsrel, limit, workspace, result, abserr)
end

Expand Down Expand Up @@ -595,7 +595,7 @@ GSL documentation:
> Gauss-Kronrod integration rule is used.

"""
function integration_qaws(f, a, b, t, epsabs, epsrel, limit, workspace, result, abserr)
function integration_qaws(f::F, a, b, t, epsabs, epsrel, limit, workspace, result, abserr) where F
ccall((:gsl_integration_qaws, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Ref{gsl_integration_qaws_table}, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{Cdouble}, Ref{Cdouble}), f, a, b, t, epsabs, epsrel, limit, workspace, result, abserr)
end

Expand Down Expand Up @@ -645,7 +645,7 @@ GSL documentation:
> integration.

"""
function integration_qawo(f, a, epsabs, epsrel, limit, workspace, wf, result, abserr)
function integration_qawo(f::F, a, epsabs, epsrel, limit, workspace, wf, result, abserr) where F
ccall((:gsl_integration_qawo, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{gsl_integration_qawo_table}, Ref{Cdouble}, Ref{Cdouble}), f, a, epsabs, epsrel, limit, workspace, wf, result, abserr)
end

Expand Down Expand Up @@ -737,7 +737,7 @@ GSL documentation:
> `cycle_workspace` as workspace for the QAWO algorithm.

"""
function integration_qawf(f, a, epsabs, limit, workspace, cycle_workspace, wf, result, abserr)
function integration_qawf(f::F, a, epsabs, limit, workspace, cycle_workspace, wf, result, abserr) where F
ccall((:gsl_integration_qawf, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Csize_t, Ref{gsl_integration_workspace}, Ref{gsl_integration_workspace}, Ref{gsl_integration_qawo_table}, Ref{Cdouble}, Ref{Cdouble}), f, a, epsabs, limit, workspace, cycle_workspace, wf, result, abserr)
end

Expand Down Expand Up @@ -793,7 +793,7 @@ GSL documentation:
> table `t` and returns the result.

"""
function integration_glfixed(f, a, b, t)
function integration_glfixed(f::F, a, b, t) where F
ccall((:gsl_integration_glfixed, libgsl), Cdouble, (Ref{gsl_function}, Cdouble, Cdouble, Ref{gsl_integration_glfixed_table}), f, a, b, t)
end

Expand Down Expand Up @@ -890,7 +890,7 @@ GSL documentation:
> set to `NULL`.

"""
function integration_cquad(f, a, b, epsabs, epsrel, ws, result, abserr, nevals)
function integration_cquad(f::F, a, b, epsabs, epsrel, ws, result, abserr, nevals) where F
ccall((:gsl_integration_cquad, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Cdouble, Ref{gsl_integration_cquad_workspace}, Ref{Cdouble}, Ref{Cdouble}, Ref{Csize_t}), f, a, b, epsabs, epsrel, ws, result, abserr, nevals)
end

Expand Down Expand Up @@ -957,7 +957,7 @@ GSL documentation:
> `neval`.

"""
function integration_romberg(f, a, b, epsabs, epsrel, result, neval, w)
function integration_romberg(f::F, a, b, epsabs, epsrel, result, neval, w) where F
ccall((:gsl_integration_romberg, libgsl), Cint, (Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Cdouble, Ref{Cdouble}, Ref{Csize_t}, Ref{gsl_integration_romberg_workspace}), f, a, b, epsabs, epsrel, result, neval, w)
end

Expand Down Expand Up @@ -1116,7 +1116,7 @@ GSL documentation:
> approximated as

"""
function integration_fixed(func, result, w)
function integration_fixed(func::F, result, w) where F
ccall((:gsl_integration_fixed, libgsl), Cint, (Ref{gsl_function}, Ref{Cdouble}, Ref{gsl_integration_fixed_workspace}), func, result, w)
end

6 changes: 3 additions & 3 deletions src/gen/direct_wrappers/gsl_min_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GSL documentation:
> returns an error code of `GSL_EINVAL`.

"""
function min_fminimizer_set(s, f, x_minimum, x_lower, x_upper)
function min_fminimizer_set(s, f::gsl_function, x_minimum, x_lower, x_upper)
ccall((:gsl_min_fminimizer_set, libgsl), Cint, (Ref{gsl_min_fminimizer}, Ref{gsl_function}, Cdouble, Cdouble, Cdouble), s, f, x_minimum, x_lower, x_upper)
end

Expand All @@ -86,7 +86,7 @@ GSL documentation:
> `f(x_minimum)`, `f(x_lower)` and `f(x_upper)`.

"""
function min_fminimizer_set_with_values(s, f, x_minimum, f_minimum, x_lower, f_lower, x_upper, f_upper)
function min_fminimizer_set_with_values(s, f::gsl_function, x_minimum, f_minimum, x_lower, f_lower, x_upper, f_upper)
ccall((:gsl_min_fminimizer_set_with_values, libgsl), Cint, (Ref{gsl_min_fminimizer}, Ref{gsl_function}, Cdouble, Cdouble, Cdouble, Cdouble, Cdouble, Cdouble), s, f, x_minimum, f_minimum, x_lower, f_lower, x_upper, f_upper)
end

Expand Down Expand Up @@ -301,7 +301,7 @@ end
C signature:
`int gsl_min_find_bracket(gsl_function *f,double *x_minimum,double * f_minimum, double *x_lower, double * f_lower, double *x_upper, double * f_upper, size_t eval_max)`
"""
function min_find_bracket(f, x_minimum, f_minimum, x_lower, f_lower, x_upper, f_upper, eval_max)
function min_find_bracket(f::F, x_minimum, f_minimum, x_lower, f_lower, x_upper, f_upper, eval_max) where F
ccall((:gsl_min_find_bracket, libgsl), Cint, (Ref{gsl_function}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Ref{Cdouble}, Csize_t), f, x_minimum, f_minimum, x_lower, f_lower, x_upper, f_upper, eval_max)
end

6 changes: 3 additions & 3 deletions src/gen/direct_wrappers/gsl_multiroots_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
C signature:
`int gsl_multiroot_fdjacobian (gsl_multiroot_function * F, const gsl_vector * x, const gsl_vector * f, double epsrel, gsl_matrix * jacobian)`
"""
function multiroot_fdjacobian(F, x, f, epsrel, jacobian)
function multiroot_fdjacobian(F::Fn, x, f, epsrel, jacobian) where Fn
ccall((:gsl_multiroot_fdjacobian, libgsl), Cint, (Ref{gsl_multiroot_function}, Ref{gsl_vector}, Ref{gsl_vector}, Cdouble, Ref{gsl_matrix}), F, x, f, epsrel, jacobian)
end

Expand Down Expand Up @@ -81,7 +81,7 @@ GSL documentation:
> is not modified by subsequent iterations.

"""
function multiroot_fsolver_set(s, f, x)
function multiroot_fsolver_set(s, f::gsl_multiroot_function, x)
ccall((:gsl_multiroot_fsolver_set, libgsl), Cint, (Ref{gsl_multiroot_fsolver}, Ref{gsl_multiroot_function}, Ref{gsl_vector}), s, f, x)
end

Expand Down Expand Up @@ -242,7 +242,7 @@ end
C signature:
`int gsl_multiroot_fdfsolver_set (gsl_multiroot_fdfsolver * s, gsl_multiroot_function_fdf * fdf, const gsl_vector * x)`
"""
function multiroot_fdfsolver_set(s, fdf, x)
function multiroot_fdfsolver_set(s, fdf::gsl_multiroot_function_fdf, x)
ccall((:gsl_multiroot_fdfsolver_set, libgsl), Cint, (Ref{gsl_multiroot_fdfsolver}, Ref{gsl_multiroot_function_fdf}, Ref{gsl_vector}), s, fdf, x)
end

Expand Down
4 changes: 2 additions & 2 deletions src/gen/direct_wrappers/gsl_roots_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ GSL documentation:
> `x_upper`\].

"""
function root_fsolver_set(s, f, x_lower, x_upper)
function root_fsolver_set(s, f::gsl_function, x_lower, x_upper)
ccall((:gsl_root_fsolver_set, libgsl), Cint, (Ref{gsl_root_fsolver}, Ref{gsl_function}, Cdouble, Cdouble), s, f, x_lower, x_upper)
end

Expand Down Expand Up @@ -221,7 +221,7 @@ GSL documentation:
> use the function and derivative `fdf` and the initial guess `root`.

"""
function root_fdfsolver_set(s, fdf, root)
function root_fdfsolver_set(s, fdf::gsl_function_fdf, root)
ccall((:gsl_root_fdfsolver_set, libgsl), Cint, (Ref{gsl_root_fdfsolver}, Ref{gsl_function_fdf}, Cdouble), s, fdf, root)
end

Expand Down
Loading
Loading