From 0725b1bc5874de06a01174d973a60b8d73396f64 Mon Sep 17 00:00:00 2001 From: Gaspard Jankowiak Date: Mon, 10 Feb 2025 12:26:36 +0100 Subject: [PATCH] add docstring and update README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 9ca484a..2a6c3fc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # TaylorTest Simple package to check derivatives + +# Usage + +``` + check(f, Jf, x[, constant_components]; f_kwargs...) +``` + +Returns true if `Jf` approximates the derivative/gradient/Jacobian of `f` at point `x` (along a random direction). +`f_kwargs` are keywords arguments to be passed to `f` and `Jf`. +`constant_components` is an optional `Vector{Int}` corresponding to components of the direction which should be set to zero, +effectively ignoring the dependency of `f` on these components. + +## Examples +```julia-repl +julia> f = x -> cos(x); Jf = x -> -sin(x); check(f, Jf, rand()) +true +```