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.
Files changed (245) hide show
  1. package/cli/bridge-flow-runner.ts +61 -39
  2. package/cli/commands/agent-wrapper.ts +21 -10
  3. package/cli/commands/control.ts +27 -7
  4. package/cli/commands/coverage.ts +1 -1
  5. package/cli/commands/detect.ts +17 -4
  6. package/cli/commands/maestro-compare.ts +25 -99
  7. package/cli/help-core.ts +3 -4
  8. package/cli/maestro-compare.ts +172 -4
  9. package/cli/outbound-endpoints.ts +2 -10
  10. package/detox/index.ts +15 -0
  11. package/detox/launch-permissions.ts +169 -0
  12. package/dist-lib/agent-daemon-client.cjs +2 -2
  13. package/dist-lib/agent-events.cjs +2 -2
  14. package/dist-lib/attached-projects.cjs +2 -2
  15. package/dist-lib/auth/shared-session.cjs +2 -2
  16. package/dist-lib/backend-origin.cjs +2 -2
  17. package/dist-lib/beta.cjs +2 -2
  18. package/dist-lib/beta.mjs +1 -1
  19. package/dist-lib/bridge-constants.cjs +2 -2
  20. package/dist-lib/bridge-contract-input.cjs +2 -2
  21. package/dist-lib/bridge-contract-input.mjs +1 -1
  22. package/dist-lib/bridge-contract.cjs +2 -2
  23. package/dist-lib/bridge-contract.mjs +1 -1
  24. package/dist-lib/bundle-channel.cjs +18273 -15925
  25. package/dist-lib/capture-contract.cjs +2 -2
  26. package/dist-lib/capture-contract.mjs +1 -1
  27. package/dist-lib/cloud-contract.cjs +2 -2
  28. package/dist-lib/cloud-contract.mjs +1 -1
  29. package/dist-lib/cloud-test-args.cjs +2 -2
  30. package/dist-lib/cloud-test-args.mjs +1 -1
  31. package/dist-lib/cloud.cjs +2 -2
  32. package/dist-lib/cloud.mjs +1 -1
  33. package/dist-lib/config.cjs +2 -2
  34. package/dist-lib/config.mjs +1 -1
  35. package/dist-lib/detox/index.cjs +104 -3
  36. package/dist-lib/dev-bundle-resolution.cjs +208 -44
  37. package/dist-lib/expo-swift-bundle.cjs +2349 -1778
  38. package/dist-lib/expo-swift-metadata.cjs +2 -2
  39. package/dist-lib/expo-swift-metadata.mjs +1 -1
  40. package/dist-lib/home-paths.cjs +2 -2
  41. package/dist-lib/host/bridge-host.cjs +7885 -3334
  42. package/dist-lib/host/fetch-proxy-handler.cjs +331 -39
  43. package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
  44. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  45. package/dist-lib/host/replacement-module-handler.cjs +2 -2
  46. package/dist-lib/host/websocket-proxy.cjs +2 -2
  47. package/dist-lib/index.cjs +297 -77
  48. package/dist-lib/jump-to-source-babel.cjs +2 -2
  49. package/dist-lib/jump-to-source-native.cjs +2 -2
  50. package/dist-lib/kotlin-host.cjs +2 -2
  51. package/dist-lib/menu.cjs +2 -2
  52. package/dist-lib/menu.mjs +1 -1
  53. package/dist-lib/metro-fingerprint-registry.cjs +2 -2
  54. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  55. package/dist-lib/metro-production-bundle.cjs +2 -2
  56. package/dist-lib/metro-production-bundle.mjs +1 -1
  57. package/dist-lib/metro.cjs +294 -74
  58. package/dist-lib/native-app-identity-project.cjs +48 -37
  59. package/dist-lib/native-app-identity-project.mjs +47 -36
  60. package/dist-lib/native-app-identity.cjs +2 -2
  61. package/dist-lib/native-app-identity.mjs +1 -1
  62. package/dist-lib/native-firebase-metadata.cjs +2 -2
  63. package/dist-lib/native-firebase-metadata.mjs +1 -1
  64. package/dist-lib/plist.cjs +2 -2
  65. package/dist-lib/plist.mjs +1 -1
  66. package/dist-lib/profiles.cjs +2 -2
  67. package/dist-lib/public-brand.cjs +2 -2
  68. package/dist-lib/public-origins-lib-esm.json +24 -23
  69. package/dist-lib/public-origins-lib.json +199 -79
  70. package/dist-lib/react-native-host-modules.cjs +2 -2
  71. package/dist-lib/react-native-host-modules.mjs +1 -1
  72. package/dist-lib/reap-browser.cjs +2 -2
  73. package/dist-lib/scripts/dev-server-scanner.cjs +206 -31
  74. package/dist-lib/sdk.cjs +2 -2
  75. package/dist-lib/sdk.mjs +1 -1
  76. package/dist-lib/skills.cjs +19600 -15992
  77. package/dist-lib/swift-compile.cjs +640 -402
  78. package/dist-lib/swift-compile.mjs +595 -357
  79. package/dist-lib/swift-package.cjs +24 -20
  80. package/dist-lib/swift-package.mjs +23 -19
  81. package/dist-lib/swift-submit.cjs +2 -2
  82. package/dist-lib/swift-submit.mjs +1 -1
  83. package/dist-lib/swift-toolchain.cjs +31 -4
  84. package/dist-lib/swift.cjs +2 -2
  85. package/dist-lib/vite-swift.cjs +1559 -1208
  86. package/dist-lib/vite.cjs +251 -42
  87. package/dist-lib/worklet-executable.cjs +2 -2
  88. package/dist-lib/worklet-executable.mjs +1 -1
  89. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
  90. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
  91. package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
  92. package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
  93. package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
  94. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
  95. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  96. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
  97. package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
  98. package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
  99. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
  100. package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
  101. package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
  102. package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +3 -0
  103. package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
  104. package/package.json +1 -1
  105. package/runtime-companion.json +1 -1
  106. package/scripts/dev-server-scanner.ts +4 -0
  107. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
  108. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
  109. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
  110. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
  111. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
  112. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
  113. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
  114. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
  115. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
  116. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
  117. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
  118. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
  119. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
  120. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
  121. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
  122. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
  123. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
  124. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
  125. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
  126. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
  127. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
  128. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
  129. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
  130. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
  131. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
  132. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
  133. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
  134. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
  135. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
  136. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
  137. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
  138. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
  139. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
  140. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
  141. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
  142. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
  143. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
  144. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
  145. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
  146. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
  147. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
  148. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
  149. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
  150. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
  151. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
  152. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
  153. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
  154. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
  155. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
  156. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
  157. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
  158. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
  159. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
  160. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
  161. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
  162. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
  163. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
  164. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
  165. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
  166. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
  167. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
  168. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
  169. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
  170. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
  171. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
  172. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
  173. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
  174. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +11 -229
  175. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -6
  176. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2 -1
  177. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
  178. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
  179. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
  180. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
  181. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
  182. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
  183. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +4 -0
  184. package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
  185. package/sdk/ios/usr/include/copyfile.h +143 -0
  186. package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
  187. package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
  188. package/sdk/ios/usr/include/malloc/_platform.h +80 -0
  189. package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
  190. package/sdk/ios/usr/include/malloc/malloc.h +768 -0
  191. package/sdk/ios/usr/include/os/availability.h +168 -6
  192. package/sdk/ios/usr/include/os/base.h +351 -0
  193. package/sdk/ios/usr/include/os/clock.h +18 -0
  194. package/sdk/ios/usr/include/os/lock.h +232 -10
  195. package/sdk/ios/usr/include/os/log.h +521 -38
  196. package/sdk/ios/usr/include/os/object.h +320 -3
  197. package/sdk/ios/usr/include/os/trace.h +492 -0
  198. package/sdk/ios/usr/include/os/trace_base.h +167 -0
  199. package/sdk/ios/usr/include/os/workgroup.h +37 -0
  200. package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
  201. package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
  202. package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
  203. package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
  204. package/sdk/ios/usr/include/sys/cdefs.h +38 -0
  205. package/sdk/ios/wasm/include/unistd.h +3 -0
  206. package/skills/contrast/SKILL.md +3 -0
  207. package/src/codex-client.ts +11 -6
  208. package/src/dev-bundle-resolution.ts +124 -48
  209. package/src/expo-native-workspace.ts +176 -0
  210. package/src/expo-swift-host.ts +161 -26
  211. package/src/expo-swift-ready.ts +14 -28
  212. package/src/expoSwiftContract.ts +4 -1
  213. package/src/generated/swift-c-predefines.json +68 -12
  214. package/src/host/bridge-host.ts +5 -0
  215. package/src/installed-package-versions.ts +14 -1
  216. package/src/metro-project-root.ts +44 -33
  217. package/src/native-app-identity-project.ts +1 -0
  218. package/src/nitro-adapter.lock.json +916 -10
  219. package/src/nitro-adapter.ts +33 -24
  220. package/src/nitro-bundle.ts +108 -22
  221. package/src/nitro-compile.ts +32 -5
  222. package/src/nitro-source.ts +13 -3
  223. package/src/nitroAdapterContract.ts +100 -20
  224. package/src/node-http-fetch.ts +116 -0
  225. package/src/packageVersionsContract.ts +46 -0
  226. package/src/serverDiscoveryContract.ts +1 -0
  227. package/src/settingsContract.ts +0 -30
  228. package/src/swift-binary-modules.ts +20 -5
  229. package/src/swift-compile.ts +168 -48
  230. package/src/swift-coverage/xcode-assets.ts +4 -3
  231. package/src/swift-host.ts +14 -3
  232. package/src/swift-objc-compile.ts +32 -5
  233. package/src/swift-objc-metadata.ts +2 -2
  234. package/src/swift-objc-platform.ts +2 -2
  235. package/src/swift-objc-standin.ts +43 -13
  236. package/src/swift-package.ts +33 -26
  237. package/src/swift-source-pods.ts +126 -41
  238. package/src/swift-standin-digest.ts +77 -0
  239. package/src/swift-standin-emit.ts +40 -4
  240. package/src/swift-standins.ts +68 -19
  241. package/src/swift-toolchain.ts +38 -0
  242. package/src/swiftContract.ts +8 -0
  243. package/src/vite-plugin.ts +0 -10
  244. package/src/xcode-project.ts +62 -42
  245. package/src/settings-flags.ts +0 -107
@@ -0,0 +1,186 @@
1
+ /* Copyright (c) 2014 Apple Inc. All rights reserved. */
2
+
3
+ #ifndef __LA_OBJECT_HEADER__
4
+ #define __LA_OBJECT_HEADER__
5
+
6
+ #include <vecLib/LinearAlgebra/base.h>
7
+
8
+ #if __has_feature(assume_nonnull)
9
+ //// If assume_nonnull is available, use it and use nullability qualifiers.
10
+ _Pragma("clang assume_nonnull begin")
11
+ #else
12
+ //// Otherwise, neuter the nullability qualifiers.
13
+ #define __nullable
14
+ #define __nonnull
15
+ #endif
16
+
17
+ /*!
18
+ @class la_object_t
19
+
20
+ @abstract
21
+ Type used by all functions in the LinearAlgebra library.
22
+
23
+ @discussion LinearAlgebra objects behave rather differently depending on
24
+ whether you are writing Objective-C or C. For details of semantics and memory
25
+ management consult the appropriate section below. For further information,
26
+ consult the comments in <os/object.h>.
27
+
28
+ Objective-C with ARC:
29
+ LinearAlgebra objects are objective-c objects. This means that
30
+ they participate in ARC, may be used with collections, etc. Thus, if you are
31
+ using ARC, you must not retain or release LinearAlgebra objects; the compiler
32
+ will take care of it for you.
33
+
34
+ Objective-C without ARC:
35
+ If you are not using ARC, you send -[retain] and -[release] messages to
36
+ LinearAlgebra objects, just like you would with objects of any other
37
+ Objective-C type.
38
+
39
+ C:
40
+ LinearAlgebra objects are reference counted and must be retained and released
41
+ via the la_retain( ) and la_release( ) functions. Do not attempt to
42
+ call free( ) on LinearAlgebra objects; this will typically result in leaks.
43
+ */
44
+ #if OS_OBJECT_USE_OBJC
45
+ OS_OBJECT_DECL(la_object);
46
+ # define LA_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED
47
+ #else
48
+ typedef struct la_s *la_object_t;
49
+ # define LA_RETURNS_RETAINED
50
+ #endif
51
+
52
+ /*!
53
+ @abstract
54
+ Increment the reference count of a la_object_t object.
55
+
56
+ @param object
57
+ The object to retain.
58
+
59
+ @result
60
+ The retained object.
61
+
62
+ @discussion
63
+ On a platform with the modern Objective-C runtime this is exactly equivalent
64
+ to sending the object the -[retain] message.
65
+ */
66
+ LA_FUNCTION LA_AVAILABILITY
67
+ la_object_t la_retain(la_object_t object);
68
+ #if OS_OBJECT_USE_OBJC
69
+ # undef la_retain
70
+ # define la_retain(object) [object retain]
71
+ #endif
72
+
73
+ /*!
74
+ @abstract
75
+ Decrement the reference count of an la_object_t object.
76
+
77
+ @param object
78
+ The object to release.
79
+
80
+ @discussion
81
+ On a platform with the modern Objective-C runtime this is exactly equivalent
82
+ to sending the object the -[release] message.
83
+ */
84
+ LA_FUNCTION LA_AVAILABILITY
85
+ void la_release(la_object_t object);
86
+ #if OS_OBJECT_USE_OBJC
87
+ # undef la_release
88
+ # define la_release(object) [object release]
89
+ #endif
90
+
91
+ /*!
92
+ @abstract
93
+ Add attributes to an la_object_t object.
94
+
95
+ @param object
96
+ The object that will have its attributes modified.
97
+
98
+ @param attributes
99
+ Attributes which are to be added to the object's existing attributes
100
+ to create its new set of attributes. This value should be constructed by
101
+ or'ing together LA_ATTRIBUTE_* constants.
102
+
103
+ @discussion
104
+ This operation does not remove any existing attributes from the LinearAlgebra
105
+ object, though it is possible that some attributes will override others (if so,
106
+ this will be documented in the discussion of those attributes above).
107
+ Following this function call, the specified object has all of the attributes it
108
+ had before the call, plus any new attributes specified by the second parameter.
109
+
110
+ Adding an attribute that the object already has does not change the object.
111
+
112
+ This function is not reentrant or thread-safe. Attempting to add or remove
113
+ attributes from multiple threads will have unpredictable results.
114
+ */
115
+ LA_FUNCTION LA_AVAILABILITY
116
+ void la_add_attributes(la_object_t object, la_attribute_t attributes);
117
+
118
+ /*!
119
+ @abstract
120
+ Remove attributes from an la_object_t object.
121
+
122
+ @param object
123
+ The object that will have its attributes modified.
124
+
125
+ @param attributes
126
+ Attributes which are to be removed from the object's existing attributes
127
+ to create its new set of attributes. This value should be constructed by
128
+ or'ing together LA_ATTRIBUTE_* constants.
129
+
130
+ @discussion
131
+ This function removes the specified attributes from the LinearAlgebra object.
132
+ Removing an attribute that the object does not have is harmless and does not
133
+ change the object.
134
+
135
+ This function is not reentrant or thread-safe. Attempting to add or remove
136
+ attributes from multiple threads will have unpredictable results.
137
+ */
138
+ LA_FUNCTION LA_AVAILABILITY
139
+ void la_remove_attributes(la_object_t object, la_attribute_t attributes);
140
+
141
+ /*!
142
+ @abstract Query the status of an la_object.
143
+
144
+ @param object
145
+ The object whose status is being requested.
146
+
147
+ @return
148
+ The status of the supplied object.
149
+
150
+ @discussion Returns the status of a LinearAlgebra object. The status will be
151
+ one of the codes defined in LinearAlgebra/base.h. New status codes may be
152
+ added in the future, but the following basic principle will continue to hold:
153
+ zero indicates success, status codes greater than zero are warnings, and
154
+ status codes less than zero are errors. Thus, careful error handling
155
+ might look like the following:
156
+
157
+ <pre>
158
+ @textblock
159
+ la_status_t status = la_status(result_object);
160
+ if (status == LA_SUCCESS) {
161
+ // Everything is copacetic. Get your data from result_object.
162
+ } else if (status > 0) {
163
+ // No errors occured, but the result does not have full accuracy due to
164
+ // numerical considerations. Here, you might re-compute the result using
165
+ // a more careful or stable algorithm.
166
+ } else {
167
+ // An error occured. Something is seriously amiss and you will need
168
+ // to handle it however makes sense for your application.
169
+ }
170
+ @/textblock
171
+ </pre>
172
+
173
+ Note that errors and warnings are propagated. In general, there is no need
174
+ to check the status of each subcomputation. Rather, the preferred idiom is
175
+ to do a complete computation, then check to see if anything went wrong.
176
+ Querying status may force evaluation of parts of your computation that might
177
+ otherwise be deferred until their results were actually needed.
178
+ */
179
+ LA_FUNCTION LA_AVAILABILITY
180
+ la_status_t la_status(la_object_t object);
181
+
182
+ #if __has_feature(assume_nonnull)
183
+ _Pragma("clang assume_nonnull end")
184
+ #endif
185
+
186
+ #endif // __LA_OBJECTS_HEADER__
@@ -0,0 +1,86 @@
1
+ /* Copyright (c) 2014 Apple Inc. All rights reserved. */
2
+
3
+ #ifndef __LA_SPLAT_HEADER__
4
+ #define __LA_SPLAT_HEADER__
5
+
6
+ #include <vecLib/LinearAlgebra/object.h>
7
+
8
+ #if __has_feature(assume_nonnull)
9
+ //// If assume_nonnull is available, use it and use nullability qualifiers.
10
+ _Pragma("clang assume_nonnull begin")
11
+ #else
12
+ //// Otherwise, neuter the nullability qualifiers.
13
+ #define __nullable
14
+ #define __nonnull
15
+ #endif
16
+
17
+ /*
18
+ Splat objects are a feature that is relatively unique to the LinearAlgebra
19
+ library.
20
+
21
+ A splat object represents a matrix or vector whose entries are all equal.
22
+ It may be used in the place of a matrix or vector in many computational
23
+ operations in the library.
24
+
25
+ Splat objects are effectively dimensionless matrices. Computational
26
+ operations that accept them interpret them as having dimensions necessary
27
+ to be compatibile with the other operand. Because the dimensions of a
28
+ splat are inferred from the other operands, a single operation cannot
29
+ have multiple splat operands.
30
+
31
+ A partial list of operations accepting splat operands, and the rules for the
32
+ inferred size:
33
+
34
+ Operation Inferred Dimensions
35
+ sum(A,splat) (rows(A), cols(A))
36
+ sum(splat,A) (rows(A), cols(A))
37
+ difference(A,splat) (rows(A), cols(A))
38
+ difference(splat,A) (rows(A), cols(A))
39
+ elementwise_product(A,splat) (rows(A), cols(A))
40
+ elementwise_product(splat,A) (rows(A), cols(A))
41
+ inner_product(A,splat) (length(A), 1)
42
+ inner_product(splat,A) (1, length(A))
43
+ matrix_product(A,splat) (cols(A), 1)
44
+ matrix_product(splat,A) (1, rows(A))
45
+ */
46
+
47
+ LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
48
+ la_object_t la_splat_from_float(float scalar_value,
49
+ la_attribute_t attributes);
50
+
51
+ LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
52
+ la_object_t la_splat_from_double(double scalar_value,
53
+ la_attribute_t attributes);
54
+
55
+ LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
56
+ la_object_t la_splat_from_vector_element(la_object_t vector,
57
+ la_index_t vector_index);
58
+
59
+ LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
60
+ la_object_t la_splat_from_matrix_element(la_object_t matrix,
61
+ la_index_t matrix_row,
62
+ la_index_t matrix_col);
63
+
64
+ /*
65
+ It is sometimes useful to be able to just generate a matrix or vector with
66
+ fixed dimensions from a splat object, either because the operation you want
67
+ to perform doesn't infer the same dimensions as you would like to use, or
68
+ if the operation you want to perform doesn't support inferring dimensions
69
+ at all. For this purpose, the following functions are provided.
70
+
71
+ The vector returned from la_vector_from_splat is always vector_length x 1.
72
+ */
73
+ LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
74
+ la_object_t la_vector_from_splat(la_object_t splat,
75
+ la_count_t vector_length);
76
+
77
+ LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
78
+ la_object_t la_matrix_from_splat(la_object_t splat,
79
+ la_count_t matrix_rows,
80
+ la_count_t matrix_cols);
81
+
82
+ #if __has_feature(assume_nonnull)
83
+ _Pragma("clang assume_nonnull end")
84
+ #endif
85
+
86
+ #endif // __LA_SPLAT_HEADER__
@@ -0,0 +1,364 @@
1
+ /* Copyright (c) 2014 Apple Inc. All rights reserved. */
2
+
3
+ #ifndef __LA_VECTOR_HEADER__
4
+ #define __LA_VECTOR_HEADER__
5
+
6
+ #include <vecLib/LinearAlgebra/object.h>
7
+
8
+ #if __has_feature(assume_nonnull)
9
+ //// If assume_nonnull is available, use it and use nullability qualifiers.
10
+ _Pragma("clang assume_nonnull begin")
11
+ #else
12
+ //// Otherwise, neuter the nullability qualifiers.
13
+ #define __nullable
14
+ #define __nonnull
15
+ #endif
16
+
17
+ /*!
18
+ @abstract
19
+ Create a vector using data from a buffer of floats. Ownership of the buffer
20
+ remains in control of the caller.
21
+
22
+ @param buffer
23
+ Pointer to float data providing the elements of the vector.
24
+
25
+ @param vector_length
26
+ The length of the vector.
27
+
28
+ @param buffer_stride
29
+ The offset in the buffer (measured in floats) between consecutive elements
30
+ of the vector.
31
+
32
+ @param attributes
33
+ Attributes to attach to the new la_object_t object. Pass LA_DEFAULT_ATTRIBUTES
34
+ to create a normal object.
35
+
36
+ @return a new la_object_t object representing the vector.
37
+
38
+ @discussion
39
+ This function creates an object representing a vector whose entries are copied
40
+ out of the supplied buffer of floats. Negative or zero strides are not
41
+ supported by this function (but note that you can reverse the elements in a
42
+ vector using the la_vector_reverse macro defined below).
43
+
44
+ The stride determines the offset (measured in floats) between the values
45
+ providing consecutive vector elements in the buffer. For example, if
46
+ buffer_stride is 1, then the vector is:
47
+
48
+ { buffer[0], buffer[1], buffer[2], ... , buffer[vector_length-1] }
49
+
50
+ If buffer_stride is 3, the vector is:
51
+
52
+ { buffer[0], buffer[3], buffer[6], ... , buffer[3*(vector_length-1)] }
53
+
54
+ Thus, the size of the buffer (in floats) should be at least
55
+
56
+ buffer_stride*(vector_length-1) + 1.
57
+
58
+ Always returns a vector_length x 1 vector.
59
+ */
60
+ #define la_vector_from_float_buffer(buffer, vector_length, buffer_stride, attributes) \
61
+ la_matrix_from_float_buffer(buffer, vector_length, 1, buffer_stride, LA_NO_HINT, attributes)
62
+
63
+ /*!
64
+ @abstract
65
+ Create a vector using data from a buffer of doubles. Ownership of the buffer
66
+ remains in control of the caller.
67
+
68
+ @param buffer
69
+ Pointer to double data providing the elements of the vector.
70
+
71
+ @param vector_length
72
+ The length of the vector.
73
+
74
+ @param buffer_stride
75
+ The offset in the buffer (measured in doubles) between consecutive elements
76
+ of the vector.
77
+
78
+ @param attributes
79
+ Attributes to attach to the new la_object_t object. Pass LA_DEFAULT_ATTRIBUTES
80
+ to create a normal object.
81
+
82
+ @return a new la_object_t object representing the vector.
83
+
84
+ @discussion
85
+ This function creates an object representing a vector whose entries are copied
86
+ out of the supplied buffer of doubles. Negative or zero strides are not
87
+ supported by this function (but note that you can reverse the elements in a
88
+ vector using the la_vector_reverse macro defined below).
89
+
90
+ The stride determines the offset (measured in doubles) between the values
91
+ providing consecutive vector elements in the buffer. For example, if
92
+ buffer_stride is 1, then the vector is:
93
+
94
+ { buffer[0], buffer[1], buffer[2], ... , buffer[vector_length-1] }
95
+
96
+ If buffer_stride is 3, the vector is:
97
+
98
+ { buffer[0], buffer[3], buffer[6], ... , buffer[3*(vector_length-1)] }
99
+
100
+ Thus, the size of the buffer (in doubles) should be at least
101
+
102
+ buffer_stride*(vector_length-1) + 1.
103
+
104
+ Always returns a vector_length x 1 vector.
105
+ */
106
+ #define la_vector_from_double_buffer(buffer, vector_length, buffer_stride, attributes) \
107
+ la_matrix_from_double_buffer(buffer, vector_length, 1, buffer_stride, LA_NO_HINT, attributes)
108
+
109
+ /*!
110
+ @abstract
111
+ Create a vector using data from a buffer of floats. Ownership of the buffer
112
+ is transferred from the caller to the returned object.
113
+
114
+ @param buffer
115
+ Pointer to float data providing the elements of the vector.
116
+
117
+ @param vector_length
118
+ The length of the vector.
119
+
120
+ @param deallocator
121
+ Callback to be used to deallocate the buffer when the returned vector object
122
+ is destroyed.
123
+
124
+ @param attributes
125
+ Attributes to attach to the new la_object_t object. Pass LA_DEFAULT_ATTRIBUTES
126
+ to create a normal object.
127
+
128
+ @return a new la_object_t object representing the vector.
129
+
130
+ @discussion
131
+ This function creates an object representing a vector whose entries are the
132
+ supplied buffer of floats. Ownership of the buffer is transferred to the new
133
+ vector object, meaning that you must not read, modify, or destroy it after
134
+ calling this function.
135
+
136
+ Strides are not supported with this function, as there is no way to take
137
+ ownership of (say) every third element in a region of memory. Instead,
138
+ you would create a vector with this function, then create a slice using
139
+ la_vector_slice to achieve the same effect without copying.
140
+
141
+ Always returns a vector_length x 1 vector.
142
+ */
143
+ #define la_vector_from_float_buffer_nocopy(buffer, vector_length, deallocator, attributes) \
144
+ la_matrix_from_float_buffer_nocopy(buffer, vector_length, 1, 1, LA_NO_HINT, deallocator, attributes)
145
+
146
+ /*!
147
+ @abstract
148
+ Create a vector using data from a buffer of doubles. Ownership of the buffer
149
+ is transferred from the caller to the returned object.
150
+
151
+ @param buffer
152
+ Pointer to double data providing the elements of the vector.
153
+
154
+ @param vector_length
155
+ The length of the vector.
156
+
157
+ @param deallocator
158
+ Callback to be used to deallocate the buffer when the returned vector object
159
+ is destroyed.
160
+
161
+ @param attributes
162
+ Attributes to attach to the new la_object_t object. Pass LA_DEFAULT_ATTRIBUTES
163
+ to create a normal object.
164
+
165
+ @return a new la_object_t object representing the vector.
166
+
167
+ @discussion
168
+ This function creates an object representing a vector whose entries are the
169
+ supplied buffer of doubles. Ownership of the buffer is transferred to the new
170
+ vector object, meaning that you must not read, modify, or destroy it after
171
+ calling this function.
172
+
173
+ Strides are not supported with this function, as there is no way to take
174
+ ownership of (say) every third element in a region of memory. Instead,
175
+ you would create a vector with this function, then create a slice using
176
+ la_vector_slice to achieve the same effect without copying.
177
+
178
+ Always returns a vector_length x 1 vector.
179
+ */
180
+ #define la_vector_from_double_buffer_nocopy(buffer, vector_length, deallocator, attributes) \
181
+ la_matrix_from_double_buffer_nocopy(buffer, vector_length, 1, 1, LA_NO_HINT, deallocator, attributes)
182
+
183
+ /*!
184
+ @abstract
185
+ Stores the elements of a vector to a buffer.
186
+
187
+ @param buffer
188
+ Pointer to the destination buffer.
189
+
190
+ @param buffer_stride
191
+ Offset (in floats) between the destinations of consecutive vector elements
192
+ in the buffer. Negative strides are not supported (you can get the same
193
+ effect by reversing the vector before calling this function).
194
+
195
+ @param vector
196
+ The vector to store.
197
+
198
+ @discussion
199
+ The buffer must be large enough to accomodate the vector being stored.
200
+ Specifically, it must have have sufficient space to hold
201
+
202
+ buffer_stride*(la_vector_length(vector)-1) + 1
203
+
204
+ float elements. Real usage in the most common case (stride = 1) will
205
+ look roughly like this:
206
+
207
+ <pre>
208
+ @textblock
209
+ la_count_t length = la_vector_length(vector);
210
+ if (!length) {
211
+ // an error occured.
212
+ }
213
+ float *buffer = malloc(length * sizeof buffer[0]);
214
+ la_vector_to_float_buffer(buffer, 1, vector);
215
+ @/textblock
216
+ </pre>
217
+
218
+ This function supports storing the contents of a vector, or a matrix that
219
+ has only one row or only one column. If the object satisfies those
220
+ requirements, and it does not have an error status, its contents are stored
221
+ to the buffer. If it has an error status, NaNs are stored to the buffer.
222
+
223
+ If the object is not a matrix or vector, or if it is a matrix with both
224
+ dimensions larger than one, nothing is written to the buffer and
225
+ LA_INVALID_PARAMETER_ERROR is returned.
226
+ */
227
+ LA_FUNCTION LA_AVAILABILITY
228
+ la_status_t la_vector_to_float_buffer(float *buffer,
229
+ la_index_t buffer_stride,
230
+ la_object_t vector);
231
+
232
+ /*!
233
+ @abstract
234
+ Stores the elements of a vector to a buffer.
235
+
236
+ @param buffer
237
+ Pointer to the destination buffer.
238
+
239
+ @param buffer_stride
240
+ Offset (in doubles) between the destinations of consecutive vector elements
241
+ in the buffer. Negative strides are not supported (you can get the same
242
+ effect by reversing the vector before calling this function).
243
+
244
+ @param vector
245
+ The vector to store.
246
+
247
+ @return
248
+ If vector is a valid vector object, its status is returned. Otherwise
249
+ the return value is LA_INVALID_PARAMETER_ERROR.
250
+
251
+ @discussion
252
+ The buffer must be large enough to accomodate the vector being stored.
253
+ Specifically, it must have have sufficient space to hold
254
+
255
+ buffer_stride*(la_vector_length(vector)-1) + 1
256
+
257
+ double elements. Real usage in the most common case (stride = 1) will
258
+ look roughly like this:
259
+
260
+ <pre>
261
+ @textblock
262
+ la_count_t length = la_vector_length(vector);
263
+ if (!length) {
264
+ // an error occured.
265
+ }
266
+ double *buffer = malloc(length * sizeof buffer[0]);
267
+ la_vector_to_double_buffer(buffer, 1, vector);
268
+ @/textblock
269
+ </pre>
270
+
271
+ This function supports storing the contents of a vector, or a matrix that
272
+ has only one row or only one column. If the object satisfies those
273
+ requirements, and it does not have an error status, its contents are stored
274
+ to the buffer. If it has an error status, NaNs are stored to the buffer.
275
+
276
+ If the object is not a matrix or vector, or if it is a matrix with both
277
+ dimensions larger than one, nothing is written to the buffer and
278
+ LA_INVALID_PARAMETER_ERROR is returned.
279
+ */
280
+ LA_FUNCTION LA_AVAILABILITY
281
+ la_status_t la_vector_to_double_buffer(double *buffer,
282
+ la_index_t buffer_stride,
283
+ la_object_t vector);
284
+
285
+ /*!
286
+ @abstract
287
+ Get the length of a vector.
288
+
289
+ @discussion
290
+ If the argument has an error status, zero is returned.
291
+ If the argument is a vector, its length is returned.
292
+ If the argument is a matrix with only one row or only one column, the other
293
+ dimension is returned.
294
+ Otherwise, zero is returned.
295
+ */
296
+ LA_FUNCTION LA_CONST LA_AVAILABILITY
297
+ la_count_t la_vector_length(la_object_t vector);
298
+
299
+ /*!
300
+ @abstract
301
+ Create a slice of a vector.
302
+
303
+ @param vector
304
+ The vector to be sliced.
305
+
306
+ @param vector_first
307
+ The index of the source vector element that will become the first element
308
+ of the new slice vector.
309
+
310
+ @param vector_stride
311
+ The offset in the source vector between elements that will be consecutive in
312
+ the new slice vector.
313
+
314
+ @param slice_length
315
+ The length of the resulting slice vector.
316
+
317
+ @return
318
+ A new vector with length slice_length whose elements are taken from vector.
319
+
320
+ @discussion
321
+ The result object is the vector:
322
+
323
+ [ vector[vector_first], vector[vector_first+vector_stride], ...
324
+ ... , vector[vector_first + (slice_length-1)*vector_stride] ]
325
+
326
+ Slices provide an efficient means to operate on subvectors and strides.
327
+ These are lightweight objects that reference the storage of the vector from
328
+ which they originate. Creating a vector slice does not require any allocation
329
+ beyond the object representing the slice, nor does it require copying.
330
+
331
+ This function supports slicing a vector, or a matrix that has only one row
332
+ or only one column. If the object is not a matrix or vector, or if it is
333
+ a matrix with both dimensions larger than one, the returned object will have
334
+ status LA_INVALID_PARAMETER_ERROR.
335
+
336
+ If the slice references indices that are less than zero or greater than or
337
+ equal to the length of the vector, LA_SLICE_OUT_OF_BOUNDS_ERROR is returned.
338
+
339
+ Always return a vector with the same orientation as the input. If input is
340
+ vector_length x 1, output is vector_length x 1 and if input is
341
+ 1 x vector_length, output is 1 x vector_length.
342
+ */
343
+ LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
344
+ la_object_t la_vector_slice(la_object_t vector,
345
+ la_index_t vector_first,
346
+ la_index_t vector_stride,
347
+ la_count_t slice_length);
348
+
349
+ /*!
350
+ @abstract
351
+ Generate a new vector that is the reverse of the supplied vector.
352
+
353
+ Always return a vector with the same orientation as the input. If input is
354
+ vector_length x 1, output is vector_length x 1 and if input is
355
+ 1 x vector_length, output is 1 x vector_length.
356
+ */
357
+ #define la_vector_reverse(vector) \
358
+ la_vector_slice(vector, la_vector_length(vector)-1, -1, la_vector_length(vector))
359
+
360
+ #if __has_feature(assume_nonnull)
361
+ _Pragma("clang assume_nonnull end")
362
+ #endif
363
+
364
+ #endif // __LA_VECTOR_HEADER__