peachsim 0.1.1692 → 0.1.1700
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/bridge-flow-runner.ts +61 -39
- package/cli/commands/agent-wrapper.ts +21 -10
- package/cli/commands/control.ts +27 -7
- package/cli/commands/coverage.ts +1 -1
- package/cli/commands/detect.ts +17 -4
- package/cli/commands/maestro-compare.ts +25 -99
- package/cli/help-core.ts +3 -4
- package/cli/maestro-compare.ts +172 -4
- package/cli/outbound-endpoints.ts +2 -10
- package/detox/index.ts +15 -0
- package/detox/launch-permissions.ts +169 -0
- package/dist-lib/agent-daemon-client.cjs +2 -2
- package/dist-lib/agent-events.cjs +2 -2
- package/dist-lib/attached-projects.cjs +2 -2
- package/dist-lib/auth/shared-session.cjs +2 -2
- package/dist-lib/backend-origin.cjs +2 -2
- package/dist-lib/beta.cjs +2 -2
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +2 -2
- package/dist-lib/bridge-contract-input.cjs +2 -2
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +2 -2
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +18273 -15925
- package/dist-lib/capture-contract.cjs +2 -2
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +2 -2
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +2 -2
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +2 -2
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +2 -2
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +104 -3
- package/dist-lib/dev-bundle-resolution.cjs +208 -44
- package/dist-lib/expo-swift-bundle.cjs +2349 -1778
- package/dist-lib/expo-swift-metadata.cjs +2 -2
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +2 -2
- package/dist-lib/host/bridge-host.cjs +7885 -3334
- package/dist-lib/host/fetch-proxy-handler.cjs +331 -39
- package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +2 -2
- package/dist-lib/host/websocket-proxy.cjs +2 -2
- package/dist-lib/index.cjs +297 -77
- package/dist-lib/jump-to-source-babel.cjs +2 -2
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +2 -2
- package/dist-lib/menu.cjs +2 -2
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +2 -2
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +2 -2
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +294 -74
- package/dist-lib/native-app-identity-project.cjs +48 -37
- package/dist-lib/native-app-identity-project.mjs +47 -36
- package/dist-lib/native-app-identity.cjs +2 -2
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +2 -2
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +2 -2
- package/dist-lib/public-brand.cjs +2 -2
- package/dist-lib/public-origins-lib-esm.json +24 -23
- package/dist-lib/public-origins-lib.json +199 -79
- package/dist-lib/react-native-host-modules.cjs +2 -2
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +206 -31
- package/dist-lib/sdk.cjs +2 -2
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +19600 -15992
- package/dist-lib/swift-compile.cjs +640 -402
- package/dist-lib/swift-compile.mjs +595 -357
- package/dist-lib/swift-package.cjs +24 -20
- package/dist-lib/swift-package.mjs +23 -19
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +31 -4
- package/dist-lib/swift.cjs +2 -2
- package/dist-lib/vite-swift.cjs +1559 -1208
- package/dist-lib/vite.cjs +251 -42
- package/dist-lib/worklet-executable.cjs +2 -2
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
- package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
- package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +3 -0
- package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +4 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +11 -229
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2 -1
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +4 -0
- package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
- package/sdk/ios/usr/include/copyfile.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
- package/sdk/ios/usr/include/malloc/_platform.h +80 -0
- package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
- package/sdk/ios/usr/include/malloc/malloc.h +768 -0
- package/sdk/ios/usr/include/os/availability.h +168 -6
- package/sdk/ios/usr/include/os/base.h +351 -0
- package/sdk/ios/usr/include/os/clock.h +18 -0
- package/sdk/ios/usr/include/os/lock.h +232 -10
- package/sdk/ios/usr/include/os/log.h +521 -38
- package/sdk/ios/usr/include/os/object.h +320 -3
- package/sdk/ios/usr/include/os/trace.h +492 -0
- package/sdk/ios/usr/include/os/trace_base.h +167 -0
- package/sdk/ios/usr/include/os/workgroup.h +37 -0
- package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
- package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
- package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
- package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
- package/sdk/ios/usr/include/sys/cdefs.h +38 -0
- package/sdk/ios/wasm/include/unistd.h +3 -0
- package/skills/contrast/SKILL.md +3 -0
- package/src/codex-client.ts +11 -6
- package/src/dev-bundle-resolution.ts +124 -48
- package/src/expo-native-workspace.ts +176 -0
- package/src/expo-swift-host.ts +161 -26
- package/src/expo-swift-ready.ts +14 -28
- package/src/expoSwiftContract.ts +4 -1
- package/src/generated/swift-c-predefines.json +68 -12
- package/src/host/bridge-host.ts +5 -0
- package/src/installed-package-versions.ts +14 -1
- package/src/metro-project-root.ts +44 -33
- package/src/native-app-identity-project.ts +1 -0
- package/src/nitro-adapter.lock.json +916 -10
- package/src/nitro-adapter.ts +33 -24
- package/src/nitro-bundle.ts +108 -22
- package/src/nitro-compile.ts +32 -5
- package/src/nitro-source.ts +13 -3
- package/src/nitroAdapterContract.ts +100 -20
- package/src/node-http-fetch.ts +116 -0
- package/src/packageVersionsContract.ts +46 -0
- package/src/serverDiscoveryContract.ts +1 -0
- package/src/settingsContract.ts +0 -30
- package/src/swift-binary-modules.ts +20 -5
- package/src/swift-compile.ts +168 -48
- package/src/swift-coverage/xcode-assets.ts +4 -3
- package/src/swift-host.ts +14 -3
- package/src/swift-objc-compile.ts +32 -5
- package/src/swift-objc-metadata.ts +2 -2
- package/src/swift-objc-platform.ts +2 -2
- package/src/swift-objc-standin.ts +43 -13
- package/src/swift-package.ts +33 -26
- package/src/swift-source-pods.ts +126 -41
- package/src/swift-standin-digest.ts +77 -0
- package/src/swift-standin-emit.ts +40 -4
- package/src/swift-standins.ts +68 -19
- package/src/swift-toolchain.ts +38 -0
- package/src/swiftContract.ts +8 -0
- package/src/vite-plugin.ts +0 -10
- package/src/xcode-project.ts +62 -42
- package/src/settings-flags.ts +0 -107
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// Numerical integration
|
|
2
|
+
|
|
3
|
+
#ifndef QUADRATURE_INTEGRATION_H
|
|
4
|
+
#define QUADRATURE_INTEGRATION_H
|
|
5
|
+
|
|
6
|
+
#include <stddef.h>
|
|
7
|
+
|
|
8
|
+
// Availability
|
|
9
|
+
#if __has_include( <Availability.h> )
|
|
10
|
+
#include <Availability.h>
|
|
11
|
+
#else
|
|
12
|
+
#define __API_AVAILABLE(...)
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
// Nullability
|
|
16
|
+
#if __has_feature(assume_nonnull)
|
|
17
|
+
_Pragma("clang assume_nonnull begin")
|
|
18
|
+
#else
|
|
19
|
+
#define _Null_unspecified
|
|
20
|
+
#define _Nullable
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
/*!
|
|
24
|
+
@abstract Y=F(X) one-dimensional real function, array form, double precision
|
|
25
|
+
|
|
26
|
+
@discussion Should set values <tt>y[i] = F(x[i])</tt> for i=0..n-1.
|
|
27
|
+
|
|
28
|
+
@param arg User argument passed back to the function when evaluated
|
|
29
|
+
@param n Dimension of arrays X and Y
|
|
30
|
+
@param x Array of points to evaluate the function
|
|
31
|
+
@param y Array receiving the values
|
|
32
|
+
*/
|
|
33
|
+
typedef void (*quadrature_function_array)(void * _Null_unspecified __arg, size_t __n, const double *__x, double *__y);
|
|
34
|
+
|
|
35
|
+
/*! @enum quadrature_integrator
|
|
36
|
+
|
|
37
|
+
@abstract Integrators
|
|
38
|
+
|
|
39
|
+
@constant QUADRATURE_INTEGRATE_QNG
|
|
40
|
+
Simple non-adaptive automatic integrator using Gauss-Kronrod-Patterson quadrature coefficients.
|
|
41
|
+
Evaluates 21, or 43, or 87 points in the interval until the requested accuracy is reached.
|
|
42
|
+
No workspace is necessary for this integrator.
|
|
43
|
+
|
|
44
|
+
@constant QUADRATURE_INTEGRATE_QAG
|
|
45
|
+
Simple globally adaptive integrator.
|
|
46
|
+
Allows selection of the number of Gauss-Kronrod points used in each subinterval, and the max number of subintervals.
|
|
47
|
+
|
|
48
|
+
@constant QUADRATURE_INTEGRATE_QAGS
|
|
49
|
+
Global adaptive quadrature based on 21-point or 15-point (if at least one bound is infinite) Gauss–Kronrod quadrature within each subinterval, with acceleration by Peter Wynn's epsilon algorithm.
|
|
50
|
+
If at least one of the interval bounds is infinite, this is equivalent to the QUADPACK QAGI routine. Otherwise, this is equivalent to the QUADPACK QAGS routine.
|
|
51
|
+
|
|
52
|
+
*/
|
|
53
|
+
typedef enum {
|
|
54
|
+
|
|
55
|
+
QUADRATURE_INTEGRATE_QNG,
|
|
56
|
+
QUADRATURE_INTEGRATE_QAG,
|
|
57
|
+
QUADRATURE_INTEGRATE_QAGS
|
|
58
|
+
|
|
59
|
+
} quadrature_integrator;
|
|
60
|
+
|
|
61
|
+
/*!
|
|
62
|
+
@abstract Bytes per interval to allocate in workspace for the QAG integrator. */
|
|
63
|
+
#define QUADRATURE_INTEGRATE_QAG_WORKSPACE_PER_INTERVAL 32
|
|
64
|
+
|
|
65
|
+
/*!
|
|
66
|
+
@abstract Bytes per interval to allocate in workspace for the QAGS integrator. */
|
|
67
|
+
#define QUADRATURE_INTEGRATE_QAGS_WORKSPACE_PER_INTERVAL 152
|
|
68
|
+
|
|
69
|
+
/*!
|
|
70
|
+
@abstract Function to integrate
|
|
71
|
+
|
|
72
|
+
@discussion Describes a real function Y=F(X). Since most of the integration time is spent
|
|
73
|
+
evaluating F, we allow the caller to provide a array callback, computing several values of F
|
|
74
|
+
in a single call.
|
|
75
|
+
|
|
76
|
+
@field fun Y=F(X) callback.
|
|
77
|
+
@field fun_arg User pointer passed as first argument to all invocations of <tt>fun</tt>.
|
|
78
|
+
*/
|
|
79
|
+
typedef struct {
|
|
80
|
+
|
|
81
|
+
quadrature_function_array fun;
|
|
82
|
+
void * _Null_unspecified fun_arg;
|
|
83
|
+
|
|
84
|
+
} quadrature_integrate_function;
|
|
85
|
+
|
|
86
|
+
/*!
|
|
87
|
+
@abstract Integration options
|
|
88
|
+
|
|
89
|
+
@field integrator Integration algorithm to apply.
|
|
90
|
+
@field abs_tolerance Requested absolute tolerance on the result.
|
|
91
|
+
@field rel_tolerance Requested relative tolerance on the result.
|
|
92
|
+
|
|
93
|
+
@field qag_points_per_interval Number of Gauss-Kronrod points per interval used by the QAG integrator.
|
|
94
|
+
Can be 0, 15, 21, 31, 41, 51, 61. 0 maps to the default 21.
|
|
95
|
+
Used by the QAG integrator only. Other integrators ignore this value.
|
|
96
|
+
|
|
97
|
+
@field max_intervals Limit the number of intervals in the subdivision used by adaptive integrators.
|
|
98
|
+
If a workspace is provided, this value is ignored, and the number of intervals is limited by <tt>workspace_size</tt>.
|
|
99
|
+
<br>The QNG integrator doesn't require a workspace.
|
|
100
|
+
<br>The QAG integrator requires at least <tt>max_intervals * QUADRATURE_INTEGRATE_QAG_WORKSPACE_PER_INTERVAL</tt> bytes in <tt>workspace</tt>.
|
|
101
|
+
<br>The QAGS integrator requires at least <tt>max_intervals * QUADRATURE_INTEGRATE_QAGS_WORKSPACE_PER_INTERVAL</tt> bytes in <tt>workspace</tt>.
|
|
102
|
+
|
|
103
|
+
*/
|
|
104
|
+
typedef struct {
|
|
105
|
+
|
|
106
|
+
quadrature_integrator integrator;
|
|
107
|
+
double abs_tolerance;
|
|
108
|
+
double rel_tolerance;
|
|
109
|
+
size_t qag_points_per_interval;
|
|
110
|
+
size_t max_intervals;
|
|
111
|
+
|
|
112
|
+
} quadrature_integrate_options;
|
|
113
|
+
|
|
114
|
+
/*!
|
|
115
|
+
@abstract Integrate a function F over ]A,B[.
|
|
116
|
+
|
|
117
|
+
@discussion
|
|
118
|
+
This function provides a set of algorithms (integrators) to compute an approximation S' of the integral S = ∫ F(x) dx over the interval ]A,B[.
|
|
119
|
+
|
|
120
|
+
The QNG (simple non-adaptive Gauss-Kronrod integration) and QAG (simple adaptive Gauss-Kronrod integration)
|
|
121
|
+
integrators are C ports of the QUADPACK library corresponding routines.
|
|
122
|
+
The QAGS integrator provides the functionality offered by the QAGS and QAGI QUADPACK routines.
|
|
123
|
+
|
|
124
|
+
On success, S' is assumed to verify abs(S-S') ≤ max(abs_tolerance, rel_tolerance * abs(S)).
|
|
125
|
+
The integration algorithms will identify <b>most</b> cases of divergence, slow convergence, and bad behaviour, and report an error.
|
|
126
|
+
The bounds a,b do not need to verify a ≤ b. If the integrator is QAGS, one or both of the interval bounds can be infinite (-INFINITY or +INFINITY).
|
|
127
|
+
|
|
128
|
+
Unless F is known to be smooth enough to guarantee success, it is strongly advised to always check the returned status and absolute error.
|
|
129
|
+
|
|
130
|
+
The QUADPACK library documentation provides a decision tree to select the integrator.
|
|
131
|
+
Adapted to match the contents of this library, this decision tree becomes:
|
|
132
|
+
|
|
133
|
+
<b>Integration over a finite region</b>
|
|
134
|
+
|
|
135
|
+
<ul>
|
|
136
|
+
<li>If performance is not a concern and you don’t know much about the specifics of the problem, use QAGS.
|
|
137
|
+
<li>Otherwise, if the integrand is smooth, use QNG or QAG if the requested tolerance couldn't be reached with QNG.
|
|
138
|
+
<li>Otherwise, if there are discontinuities or singularities of the integrand or of its derivative, and you know where they are,
|
|
139
|
+
split the integration range at these points and analyze each subinterval.
|
|
140
|
+
<li>Otherwise, if the integrand has end point singularities, use QAGS.
|
|
141
|
+
<li>Otherwise, if the integrand has an oscillatory behavior of nonspecific type, and no singularities, use QAG with 61 points per interval.
|
|
142
|
+
<li>Otherwise, use QAGS.
|
|
143
|
+
</ul>
|
|
144
|
+
|
|
145
|
+
<b>Integration over an infinite region</b>
|
|
146
|
+
|
|
147
|
+
<ul>
|
|
148
|
+
<li>If the integrand decays rapidly to zero, truncate the interval and use the finite interval decision tree.
|
|
149
|
+
<li>Otherwise, if you are not constrained by computer time, and do not wish to analyze the problem further, use QAGS.
|
|
150
|
+
<li>Otherwise, if the integrand has a non-smooth behavior in the range, and you know where it occurs, split off these regions and use
|
|
151
|
+
the appropriate finite range routines to integrate over them. Then begin this tree again to handle the remainder of the region.
|
|
152
|
+
<li>Otherwise, truncation of the interval, or application of a suitable transformation for reducing the problem to a finite range may be possible.
|
|
153
|
+
</ul>
|
|
154
|
+
|
|
155
|
+
QUADPACK Reference:
|
|
156
|
+
Robert Piessens, Elise deDoncker-Kapenga, Christian Ueberhuber, David Kahaner,
|
|
157
|
+
QUADPACK: A Subroutine Package for Automatic Integration,
|
|
158
|
+
Springer, 1983, ISBN: 3540125531, LC: QA299.3.Q36.
|
|
159
|
+
|
|
160
|
+
@param f Function to integrate. Can't be NULL.
|
|
161
|
+
@param a First bound of the integration interval. May be +/- INFINITY for QAGS.
|
|
162
|
+
@param b Second bound of the integration interval. May be +/- INFINITY for QAGS.
|
|
163
|
+
@param options Integration options. Can't be NULL.
|
|
164
|
+
@param status If not NULL, <tt>*status</tt> receives QUADRATURE_SUCCESS if the integration was successful, and a negative QUADRATURE_..._ERROR code on failure.
|
|
165
|
+
@param abs_error If not NULL, <tt>*abs_error</tt> receives an estimate of the absolute error on the result.
|
|
166
|
+
@param workspace_size Number of bytes allocated in <tt>workspace</tt>, or 0.
|
|
167
|
+
@param workspace If not NULL, points to a work buffer of <tt>workspace_size</tt> bytes. In that case, no additional memory will be allocated.
|
|
168
|
+
If NULL, the function will internally allocate a workspace buffer if one is needed.
|
|
169
|
+
|
|
170
|
+
@return Returns an approximation to the integral.
|
|
171
|
+
*/
|
|
172
|
+
extern double quadrature_integrate(const quadrature_integrate_function * __f,
|
|
173
|
+
double __a,
|
|
174
|
+
double __b,
|
|
175
|
+
const quadrature_integrate_options * options,
|
|
176
|
+
quadrature_status * _Nullable status,
|
|
177
|
+
double * _Nullable abs_error,
|
|
178
|
+
size_t workspace_size,
|
|
179
|
+
void * __restrict _Nullable workspace)
|
|
180
|
+
__API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
|
|
181
|
+
|
|
182
|
+
// Availability
|
|
183
|
+
#if !__has_include(<Availability.h>)
|
|
184
|
+
#undef __API_AVAILABLE
|
|
185
|
+
#endif
|
|
186
|
+
|
|
187
|
+
// Nullability
|
|
188
|
+
#if __has_feature(assume_nonnull)
|
|
189
|
+
_Pragma("clang assume_nonnull end")
|
|
190
|
+
#else
|
|
191
|
+
#undef _Nullable
|
|
192
|
+
#undef _Null_unspecified
|
|
193
|
+
#endif
|
|
194
|
+
|
|
195
|
+
#endif // QUADRATURE_INTEGRATION_H
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Numerical Analysis Library
|
|
2
|
+
|
|
3
|
+
#ifndef __QUADRATURE_PUBLIC_HEADER__
|
|
4
|
+
#define __QUADRATURE_PUBLIC_HEADER__
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
/*! @enum quadrature_status
|
|
11
|
+
|
|
12
|
+
@abstract Quadrature return status
|
|
13
|
+
|
|
14
|
+
@discussion Success is 0, and errors have a negative value.
|
|
15
|
+
|
|
16
|
+
@constant QUADRATURE_SUCCESS Success.
|
|
17
|
+
@constant QUADRATURE_ERROR Generic error.
|
|
18
|
+
@constant QUADRATURE_INVALID_ARG_ERROR Invalid argument.
|
|
19
|
+
@constant QUADRATURE_ALLOC_ERROR Memory allocation failed.
|
|
20
|
+
@constant QUADRATURE_INTERNAL_ERROR This is a bug in the Quadrature code, please file a bug report.
|
|
21
|
+
@constant QUADRATURE_INTEGRATE_MAX_EVAL_ERROR The requested accuracy limit could not be reached with the allowed number of evals/subdivisions.
|
|
22
|
+
@constant QUADRATURE_INTEGRATE_BAD_BEHAVIOUR_ERROR Extremely bad integrand behaviour, or excessive roundoff error occurs at some points of the integration interval.
|
|
23
|
+
*/
|
|
24
|
+
typedef enum {
|
|
25
|
+
|
|
26
|
+
QUADRATURE_SUCCESS = 0,
|
|
27
|
+
|
|
28
|
+
QUADRATURE_ERROR = -1,
|
|
29
|
+
QUADRATURE_INVALID_ARG_ERROR = -2,
|
|
30
|
+
QUADRATURE_ALLOC_ERROR = -3,
|
|
31
|
+
QUADRATURE_INTERNAL_ERROR = -99,
|
|
32
|
+
|
|
33
|
+
QUADRATURE_INTEGRATE_MAX_EVAL_ERROR = -101,
|
|
34
|
+
QUADRATURE_INTEGRATE_BAD_BEHAVIOUR_ERROR = -102
|
|
35
|
+
|
|
36
|
+
} quadrature_status;
|
|
37
|
+
|
|
38
|
+
#include "Integration.h"
|
|
39
|
+
|
|
40
|
+
#ifdef __cplusplus
|
|
41
|
+
}
|
|
42
|
+
#endif
|
|
43
|
+
|
|
44
|
+
#endif // __QUADRATURE_PUBLIC_HEADER__
|