You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/basics/FAQ.md
+12-4
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ The in-place interface allows evaluating vector-valued integrands without
6
6
allocating an output array. This can be beneficial for reducing allocations when
7
7
integrating many functions simultaneously or to make use of existing in-place
8
8
code. However, note that not all algorithms use in-place operations under the
9
-
hood, i.e. `HCubatureJL()`, and may still allocate.
9
+
hood, i.e. [`HCubatureJL`](@ref), and may still allocate.
10
10
11
11
You can construct an `IntegralFunction(f, prototype)`, where `f` is of the form
12
12
`f(y, u, p)` where `prototype` is of the desired type and shape of `y`.
@@ -22,16 +22,17 @@ different points, which maximizes the parallelism for a given algorithm.
22
22
You can construct an out-of-place `BatchIntegralFunction(bf)` where `bf` is of
23
23
the form `bf(u, p) = stack(x -> f(x, p), eachslice(u; dims=ndims(u)))`, where
24
24
`f` is the (unbatched) integrand.
25
+
For interoperability with as many algorithms as possible, it is important that your out-of-place batch integrand accept an **empty** array of quadrature points and still return an output with a size and type consistent with the non-empty case.
25
26
26
27
You can construct an in-place `BatchIntegralFunction(bf, prototype)`, where `bf`
27
28
is of the form `bf(y, u, p) = foreach((y,x) -> f(y,x,p), eachslice(y, dims=ndims(y)), eachslice(x, dims=ndims(x)))`.
28
29
29
30
Note that not all algorithms use in-place batched operations under the hood,
30
-
i.e. `QuadGKJL()`.
31
+
i.e. [`QuadGKJL`](@ref).
31
32
32
33
## What should I do if my solution is not converged?
33
34
34
-
Certain algorithms, such as `QuadratureRule` used a fixed number of points to
35
+
Certain algorithms, such as [`QuadratureRule`](@ref) used a fixed number of points to
35
36
calculate an integral and cannot provide an error estimate. In this case, you
36
37
have to increase the number of points and check the convergence yourself, which
37
38
will depend on the accuracy of the rule you choose.
@@ -47,7 +48,7 @@ precision arithmetic may help.
47
48
48
49
## How can I integrate arbitrarily-spaced data?
49
50
50
-
See `SampledIntegralProblem`.
51
+
See [`SampledIntegralProblem`](@ref).
51
52
52
53
## How can I integrate on arbitrary geometries?
53
54
@@ -59,6 +60,13 @@ because that is what lower-level packages implement.
59
60
Fixed quadrature rules from other packages can be used with `QuadratureRule`.
60
61
Otherwise, feel free to open an issue or pull request.
61
62
63
+
## My integrand works with algorithm X but fails on algorithm Y
64
+
65
+
While bugs are not out of the question, certain algorithms, especially those implemented in C, are not compatible with arbitrary Julia types and have to return specific numeric types or arrays thereof.
66
+
In some cases, such as [`ArblibJL`](@ref), it is also expected that the integrand work with a custom quadrature point type.
67
+
Moreover, some algorithms, such as [`VEGAS`](@ref), only support scalar integrands.
68
+
For more details see the [solver page](@ref solvers).
69
+
62
70
## Can I take derivatives with respect to the limits of integration?
0 commit comments