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,554 @@
|
|
|
1
|
+
/* Copyright (c) 2014 Apple Inc. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
#ifndef __LA_MATRIX_HEADER__
|
|
4
|
+
#define __LA_MATRIX_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
|
+
@brief When creating a matrix object from existing data, these hints allow the
|
|
19
|
+
user to pass useful information about the structure of the matrix.
|
|
20
|
+
|
|
21
|
+
@discussion When creating a matrix container from an existing buffer, these
|
|
22
|
+
hints allow the user to pass useful information about the traits of the
|
|
23
|
+
matrix. Increasing the amount of information known about a matrix can in some
|
|
24
|
+
cases improve performance. Consider the extreme where a matrix is a diagonal
|
|
25
|
+
matrix. When multiplying this matrix with another, if it was not known to be
|
|
26
|
+
diagonal the cost would be O(N^3) but the extra information allows the cost
|
|
27
|
+
to drop to O(N^2).
|
|
28
|
+
|
|
29
|
+
In many cases, the framework can inspect the data to determine this information
|
|
30
|
+
when it is not made available by hint, but for certain traits, such as
|
|
31
|
+
symmetric positive definiteness, this can be a costly operation, especially if
|
|
32
|
+
the user already knows the trait to be true.
|
|
33
|
+
|
|
34
|
+
These are however hints, an incorrect hint will not break the intended
|
|
35
|
+
operation, in the worst case it adds overhead. When in doubt, it is
|
|
36
|
+
recommended that rather than guessing, if no information is known, use
|
|
37
|
+
LA_NO_HINT.
|
|
38
|
+
*/
|
|
39
|
+
#define LA_NO_HINT (0U)
|
|
40
|
+
#define LA_SHAPE_DIAGONAL (1U << 0)
|
|
41
|
+
#define LA_SHAPE_LOWER_TRIANGULAR (1U << 1)
|
|
42
|
+
#define LA_SHAPE_UPPER_TRIANGULAR (1U << 2)
|
|
43
|
+
#define LA_FEATURE_SYMMETRIC (1U << 16)
|
|
44
|
+
#define LA_FEATURE_POSITIVE_DEFINITE (1U << 17)
|
|
45
|
+
#define LA_FEATURE_DIAGONALLY_DOMINANT (1U << 18)
|
|
46
|
+
typedef unsigned long la_hint_t;
|
|
47
|
+
|
|
48
|
+
/*!
|
|
49
|
+
@abstract
|
|
50
|
+
Create a matrix using data from a buffer of floats. Ownership of the buffer
|
|
51
|
+
remains in control of the caller.
|
|
52
|
+
|
|
53
|
+
@param buffer
|
|
54
|
+
Pointer to float data providing the elements of the matrix.
|
|
55
|
+
|
|
56
|
+
@param matrix_rows
|
|
57
|
+
The number of rows in the matrix.
|
|
58
|
+
|
|
59
|
+
@param matrix_cols
|
|
60
|
+
The number of columns in the matrix.
|
|
61
|
+
|
|
62
|
+
@param matrix_row_stride
|
|
63
|
+
The offset in the buffer (measured in floats) between corresponding elements
|
|
64
|
+
in consecutive rows of the matrix. Must be positive.
|
|
65
|
+
|
|
66
|
+
@param matrix_hint
|
|
67
|
+
Flags describing special matrix structures.
|
|
68
|
+
|
|
69
|
+
@param attributes
|
|
70
|
+
Attributes to attach to the new la_object_t object. Pass LA_DEFAULT_ATTRIBUTES
|
|
71
|
+
to create a normal object.
|
|
72
|
+
|
|
73
|
+
@return a new la_object_t object representing the matrix.
|
|
74
|
+
|
|
75
|
+
@discussion
|
|
76
|
+
This function creates an object representing a matrix whose entries are
|
|
77
|
+
copied out of the supplied buffer of floats. Negative or zero strides
|
|
78
|
+
are not supported by this function (but note that you can reverse the
|
|
79
|
+
rows or columns using the la_matrix_slice function defined below).
|
|
80
|
+
|
|
81
|
+
This routine assumes that the elements of the matrix are stored in the buffer
|
|
82
|
+
in row-major order. If you need to work with data that is in column-major
|
|
83
|
+
order, you can do that as follows:
|
|
84
|
+
|
|
85
|
+
1. Use this routine to create a matrix object, but pass the number of
|
|
86
|
+
columns in your matrix for the matrix_rows parameter and vice-versa. For
|
|
87
|
+
the matrix_row_stride parameter, pass the column stride of your matrix.
|
|
88
|
+
|
|
89
|
+
2. Make a new matrix transpose object from the object created in step 1. The
|
|
90
|
+
resulting object represents the matrix that you want to work with.
|
|
91
|
+
*/
|
|
92
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
93
|
+
la_object_t la_matrix_from_float_buffer(const float *buffer,
|
|
94
|
+
la_count_t matrix_rows,
|
|
95
|
+
la_count_t matrix_cols,
|
|
96
|
+
la_count_t matrix_row_stride,
|
|
97
|
+
la_hint_t matrix_hint,
|
|
98
|
+
la_attribute_t attributes);
|
|
99
|
+
|
|
100
|
+
/*!
|
|
101
|
+
@abstract
|
|
102
|
+
Create a matrix using data from a buffer of doubles. Ownership of the buffer
|
|
103
|
+
remains in control of the caller.
|
|
104
|
+
|
|
105
|
+
@param buffer
|
|
106
|
+
Pointer to double data providing the elements of the matrix.
|
|
107
|
+
|
|
108
|
+
@param matrix_rows
|
|
109
|
+
The number of rows in the matrix.
|
|
110
|
+
|
|
111
|
+
@param matrix_cols
|
|
112
|
+
The number of columns in the matrix.
|
|
113
|
+
|
|
114
|
+
@param matrix_row_stride
|
|
115
|
+
The offset in the buffer (measured in doubles) between corresponding elements
|
|
116
|
+
in consecutive rows of the matrix. Must be positive.
|
|
117
|
+
|
|
118
|
+
@param matrix_hint
|
|
119
|
+
Flags describing special matrix structures.
|
|
120
|
+
|
|
121
|
+
@param attributes
|
|
122
|
+
Attributes to attach to the new la_object_t object. Pass LA_DEFAULT_ATTRIBUTES
|
|
123
|
+
to create a normal object.
|
|
124
|
+
|
|
125
|
+
@return a new la_object_t object representing the matrix.
|
|
126
|
+
|
|
127
|
+
@discussion
|
|
128
|
+
This function creates an object representing a matrix whose entries are
|
|
129
|
+
copied out of the supplied buffer of doubles. Negative or zero strides
|
|
130
|
+
are not supported by this function (but note that you can reverse the
|
|
131
|
+
rows or columns using the la_matrix_slice function defined below).
|
|
132
|
+
|
|
133
|
+
This routine assumes that the elements of the matrix are stored in the buffer
|
|
134
|
+
in row-major order. If you need to work with data that is in column-major
|
|
135
|
+
order, you can do that as follows:
|
|
136
|
+
|
|
137
|
+
1. Use this routine to create a matrix object, but pass the number of
|
|
138
|
+
columns in your matrix for the matrix_rows parameter and vice-versa. For
|
|
139
|
+
the matrix_row_stride parameter, pass the column stride of your matrix.
|
|
140
|
+
|
|
141
|
+
2. Make a new matrix transpose object from the object created in step 1. The
|
|
142
|
+
resulting object represents the matrix that you want to work with.
|
|
143
|
+
*/
|
|
144
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
145
|
+
la_object_t la_matrix_from_double_buffer(const double *buffer,
|
|
146
|
+
la_count_t matrix_rows,
|
|
147
|
+
la_count_t matrix_cols,
|
|
148
|
+
la_count_t matrix_row_stride,
|
|
149
|
+
la_hint_t matrix_hint,
|
|
150
|
+
la_attribute_t attributes);
|
|
151
|
+
|
|
152
|
+
/*!
|
|
153
|
+
@abstract
|
|
154
|
+
Create a matrix using data from a buffer of floats. Ownership of the buffer
|
|
155
|
+
is transferred from the caller to the returned object.
|
|
156
|
+
|
|
157
|
+
@param buffer
|
|
158
|
+
Pointer to float data providing the elements of the matrix.
|
|
159
|
+
|
|
160
|
+
@param matrix_rows
|
|
161
|
+
The number of rows in the matrix.
|
|
162
|
+
|
|
163
|
+
@param matrix_cols
|
|
164
|
+
The number of columns in the matrix.
|
|
165
|
+
|
|
166
|
+
@param matrix_row_stride
|
|
167
|
+
The offset in the buffer (measured in floats) between corresponding elements
|
|
168
|
+
in consecutive rows of the matrix. Must be positive.
|
|
169
|
+
|
|
170
|
+
@param matrix_hint
|
|
171
|
+
Flags describing special matrix structures.
|
|
172
|
+
|
|
173
|
+
@param deallocator
|
|
174
|
+
Callback to be used to deallocate the buffer when the returned matrix object
|
|
175
|
+
is destroyed.
|
|
176
|
+
|
|
177
|
+
@param attributes
|
|
178
|
+
Attributes to attach to the new la_object_t object. Pass LA_DEFAULT_ATTRIBUTES
|
|
179
|
+
to create a normal object.
|
|
180
|
+
|
|
181
|
+
@return a new la_object_t object representing the matrix.
|
|
182
|
+
|
|
183
|
+
@discussion
|
|
184
|
+
This function creates an object representing a matrix whose entries are
|
|
185
|
+
copied out of the supplied buffer of floats. Negative or zero strides
|
|
186
|
+
are not supported by this function (but note that you can reverse the
|
|
187
|
+
rows or columns using the la_matrix_slice function defined below).
|
|
188
|
+
|
|
189
|
+
This routine assumes that the elements of the matrix are stored in the buffer
|
|
190
|
+
in row-major order. If you need to work with data that is in column-major
|
|
191
|
+
order, you can do that as follows:
|
|
192
|
+
|
|
193
|
+
1. Use this routine to create a matrix object, but pass the number of
|
|
194
|
+
columns in your matrix for the matrix_rows parameter and vice-versa. For
|
|
195
|
+
the matrix_row_stride parameter, pass the column stride of your matrix.
|
|
196
|
+
|
|
197
|
+
2. Make a new matrix transpose object from the object created in step 1. The
|
|
198
|
+
resulting object represents the matrix that you want to work with.
|
|
199
|
+
*/
|
|
200
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
201
|
+
la_object_t la_matrix_from_float_buffer_nocopy(float *buffer,
|
|
202
|
+
la_count_t matrix_rows,
|
|
203
|
+
la_count_t matrix_cols,
|
|
204
|
+
la_count_t matrix_row_stride,
|
|
205
|
+
la_hint_t matrix_hint,
|
|
206
|
+
__nullable la_deallocator_t deallocator,
|
|
207
|
+
la_attribute_t attributes);
|
|
208
|
+
|
|
209
|
+
/*!
|
|
210
|
+
@abstract
|
|
211
|
+
Create a matrix using data from a buffer of doubles. Ownership of the buffer
|
|
212
|
+
is transferred from the caller to the returned object.
|
|
213
|
+
|
|
214
|
+
@param buffer
|
|
215
|
+
Pointer to double data providing the elements of the matrix.
|
|
216
|
+
|
|
217
|
+
@param matrix_rows
|
|
218
|
+
The number of rows in the matrix.
|
|
219
|
+
|
|
220
|
+
@param matrix_cols
|
|
221
|
+
The number of columns in the matrix.
|
|
222
|
+
|
|
223
|
+
@param matrix_row_stride
|
|
224
|
+
The offset in the buffer (measured in doubles) between corresponding elements
|
|
225
|
+
in consecutive rows of the matrix. Must be positive.
|
|
226
|
+
|
|
227
|
+
@param matrix_hint
|
|
228
|
+
Flags describing special matrix structures.
|
|
229
|
+
|
|
230
|
+
@param deallocator
|
|
231
|
+
Callback to be used to deallocate the buffer when the returned matrix object
|
|
232
|
+
is destroyed.
|
|
233
|
+
|
|
234
|
+
@param attributes
|
|
235
|
+
Attributes to attach to the new la_object_t object. Pass LA_DEFAULT_ATTRIBUTES
|
|
236
|
+
to create a normal object.
|
|
237
|
+
|
|
238
|
+
@return a new la_object_t object representing the matrix.
|
|
239
|
+
|
|
240
|
+
@discussion
|
|
241
|
+
This function creates an object representing a matrix whose entries are
|
|
242
|
+
copied out of the supplied buffer of doubles. Negative or zero strides
|
|
243
|
+
are not supported by this function (but note that you can reverse
|
|
244
|
+
the rows or columns using the la_matrix_slice function defined below).
|
|
245
|
+
|
|
246
|
+
This routine assumes that the elements of the matrix are stored in the buffer
|
|
247
|
+
in row-major order. If you need to work with data that is in column-major
|
|
248
|
+
order, you can do that as follows:
|
|
249
|
+
|
|
250
|
+
1. Use this routine to create a matrix object, but pass the number of
|
|
251
|
+
columns in your matrix for the matrix_rows parameter and vice-versa. For
|
|
252
|
+
the matrix_row_stride parameter, pass the column stride of your matrix.
|
|
253
|
+
|
|
254
|
+
2. Make a new matrix transpose object from the object created in step 1. The
|
|
255
|
+
resulting object represents the matrix that you want to work with.
|
|
256
|
+
*/
|
|
257
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
258
|
+
la_object_t la_matrix_from_double_buffer_nocopy(double *buffer,
|
|
259
|
+
la_count_t matrix_rows,
|
|
260
|
+
la_count_t matrix_cols,
|
|
261
|
+
la_count_t matrix_row_stride,
|
|
262
|
+
la_hint_t matrix_hint,
|
|
263
|
+
__nullable la_deallocator_t deallocator,
|
|
264
|
+
la_attribute_t attributes);
|
|
265
|
+
|
|
266
|
+
/*!
|
|
267
|
+
@abstract
|
|
268
|
+
Stores the elements of a matrix to a buffer.
|
|
269
|
+
|
|
270
|
+
@param buffer
|
|
271
|
+
Pointer to the destination buffer.
|
|
272
|
+
|
|
273
|
+
@param buffer_row_stride
|
|
274
|
+
Offset (measured in floats) between the destinations of corresponding elements
|
|
275
|
+
of consecutive rows of the matrix. Must be positive.
|
|
276
|
+
|
|
277
|
+
@param matrix
|
|
278
|
+
The matrix to store.
|
|
279
|
+
|
|
280
|
+
@discussion
|
|
281
|
+
The buffer must be large enough to accomodate the matrix being stored.
|
|
282
|
+
Specifically, it must have sufficient space to hold
|
|
283
|
+
|
|
284
|
+
buffer_row_stride*(la_matrix_rows(matrix)-1) + la_matrix_cols(matrix)
|
|
285
|
+
|
|
286
|
+
float elements.
|
|
287
|
+
|
|
288
|
+
This function supports storing the contents of a vector as well as a matrix.
|
|
289
|
+
A vector of length n will be interpreted as a rows(matrix) x cols(matrix) by
|
|
290
|
+
this function. If the object is a vector or matrix and does not have an error
|
|
291
|
+
status, its contents are stored to the buffer. If it has an error status, NaNs
|
|
292
|
+
are stored to the buffer.
|
|
293
|
+
|
|
294
|
+
If the object is not a matrix or vector, nothing is written to the buffer and
|
|
295
|
+
LA_INVALID_PARAMETER_ERROR is returned.
|
|
296
|
+
*/
|
|
297
|
+
LA_FUNCTION LA_AVAILABILITY
|
|
298
|
+
la_status_t la_matrix_to_float_buffer(float *buffer,
|
|
299
|
+
la_count_t buffer_row_stride,
|
|
300
|
+
la_object_t matrix);
|
|
301
|
+
|
|
302
|
+
/*!
|
|
303
|
+
@abstract
|
|
304
|
+
Stores the elements of a matrix to a buffer.
|
|
305
|
+
|
|
306
|
+
@param buffer
|
|
307
|
+
Pointer to the destination buffer.
|
|
308
|
+
|
|
309
|
+
@param buffer_row_stride
|
|
310
|
+
Offset (measured in doubles) between the destinations of corresponding elements
|
|
311
|
+
of consecutive rows of the matrix. Must be positive.
|
|
312
|
+
|
|
313
|
+
@param matrix
|
|
314
|
+
The matrix to store.
|
|
315
|
+
|
|
316
|
+
@discussion
|
|
317
|
+
The buffer must be large enough to accomodate the matrix being stored.
|
|
318
|
+
Specifically, it must have sufficient space to hold
|
|
319
|
+
|
|
320
|
+
buffer_row_stride*(la_matrix_rows(matrix)-1) + la_matrix_cols(matrix)
|
|
321
|
+
|
|
322
|
+
double elements.
|
|
323
|
+
|
|
324
|
+
This function supports storing the contents of a vector as well as a matrix.
|
|
325
|
+
A vector of length n will be interpreted as a rows(matrix) x cols(matrix) by
|
|
326
|
+
this function. If the object is a vector or matrix and does not have an error
|
|
327
|
+
status, its contents are stored to the buffer. If it has an error status, NaNs
|
|
328
|
+
are stored to the buffer.
|
|
329
|
+
|
|
330
|
+
If the object is not a matrix or vector, nothing is written to the buffer and
|
|
331
|
+
LA_INVALID_PARAMETER_ERROR is returned.
|
|
332
|
+
*/
|
|
333
|
+
LA_FUNCTION LA_AVAILABILITY
|
|
334
|
+
la_status_t la_matrix_to_double_buffer(double *buffer,
|
|
335
|
+
la_count_t buffer_row_stride,
|
|
336
|
+
la_object_t matrix);
|
|
337
|
+
|
|
338
|
+
/*!
|
|
339
|
+
@abstract
|
|
340
|
+
Get the number of rows in a matrix.
|
|
341
|
+
|
|
342
|
+
@discussion
|
|
343
|
+
If the argument has an error status, zero is returned.
|
|
344
|
+
If the argument is a vector, the number of rows may be 1 or length(vector)
|
|
345
|
+
depending on the orientation of the vector.
|
|
346
|
+
If the argument is a matrix, the number of rows is returned.
|
|
347
|
+
Otherwise, zero is returned.
|
|
348
|
+
*/
|
|
349
|
+
LA_FUNCTION LA_CONST LA_AVAILABILITY
|
|
350
|
+
la_count_t la_matrix_rows(la_object_t matrix);
|
|
351
|
+
|
|
352
|
+
/*!
|
|
353
|
+
@abstract
|
|
354
|
+
Get the number of columns in a matrix.
|
|
355
|
+
|
|
356
|
+
@discussion
|
|
357
|
+
If the argument has an error status, zero is returned.
|
|
358
|
+
If the argument is a vector, the number of columns may be 1 or length(vector)
|
|
359
|
+
depending on the orientation of the vector.
|
|
360
|
+
If the argument is a matrix, the number of columns is returned.
|
|
361
|
+
Otherwise, zero is returned.
|
|
362
|
+
*/
|
|
363
|
+
LA_FUNCTION LA_CONST LA_AVAILABILITY
|
|
364
|
+
la_count_t la_matrix_cols(la_object_t matrix);
|
|
365
|
+
|
|
366
|
+
/*!
|
|
367
|
+
@abstract
|
|
368
|
+
Create a slice of a matrix.
|
|
369
|
+
|
|
370
|
+
@param matrix
|
|
371
|
+
The matrix to be sliced.
|
|
372
|
+
|
|
373
|
+
@param matrix_first_row
|
|
374
|
+
The index of the row of the source matrix containing the first element of
|
|
375
|
+
new slice matrix.
|
|
376
|
+
|
|
377
|
+
@param matrix_first_col
|
|
378
|
+
The index of the column of the source matrix containing the first element
|
|
379
|
+
of the slice matrix.
|
|
380
|
+
|
|
381
|
+
@param matrix_row_stride
|
|
382
|
+
The offset in the source matrix between rows that will be consecutive in
|
|
383
|
+
the slice matrix.
|
|
384
|
+
|
|
385
|
+
@param matrix_col_stride
|
|
386
|
+
The offset in the source matrix between columns that will be consecutve in
|
|
387
|
+
the slice matrix.
|
|
388
|
+
|
|
389
|
+
@param slice_rows
|
|
390
|
+
The number of rows in the slice matrix.
|
|
391
|
+
|
|
392
|
+
@param slice_cols
|
|
393
|
+
The number of columns in the slice matrix.
|
|
394
|
+
|
|
395
|
+
@return
|
|
396
|
+
A new matrix with size slice_rows x slice_cols whose elements are taken
|
|
397
|
+
from the source matrix.
|
|
398
|
+
|
|
399
|
+
@discussion
|
|
400
|
+
The result object is the slice_rows x slice_cols matrix whose i,jth entry is:
|
|
401
|
+
|
|
402
|
+
matrix[matrix_first_row + i*matrix_row_stride,
|
|
403
|
+
matrix_first_col + j*matrix_col_stride]
|
|
404
|
+
|
|
405
|
+
Slices provide an efficient means to operate on tiles and strides. These are
|
|
406
|
+
lightweight objects that reference the storage of the matrix from which they
|
|
407
|
+
originate. In most cases, creating a slice does not require any allocation
|
|
408
|
+
beyond the object representing the slice, nor require copying. In some
|
|
409
|
+
less common cases, a copy may be required.
|
|
410
|
+
|
|
411
|
+
This function supports slicing a vector (interpreted as
|
|
412
|
+
rows(matrix) x cols(matrix)) or a matrix. If the object is not a matrix or
|
|
413
|
+
vector, the returned object will have status LA_INVALID_PARAMETER_ERROR.
|
|
414
|
+
|
|
415
|
+
If the slice references indices that are less than zero or greater than or
|
|
416
|
+
equal to the dimensions of the matrix, LA_SLICE_OUT_OF_BOUNDS_ERROR is
|
|
417
|
+
returned.
|
|
418
|
+
*/
|
|
419
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
420
|
+
la_object_t la_matrix_slice(la_object_t matrix,
|
|
421
|
+
la_index_t matrix_first_row,
|
|
422
|
+
la_index_t matrix_first_col,
|
|
423
|
+
la_index_t matrix_row_stride,
|
|
424
|
+
la_index_t matrix_col_stride,
|
|
425
|
+
la_count_t slice_rows,
|
|
426
|
+
la_count_t slice_cols);
|
|
427
|
+
|
|
428
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
429
|
+
la_object_t la_identity_matrix(la_count_t matrix_size,
|
|
430
|
+
la_scalar_type_t scalar_type,
|
|
431
|
+
la_attribute_t attributes);
|
|
432
|
+
|
|
433
|
+
/*!
|
|
434
|
+
@abstract
|
|
435
|
+
Create a matrix with a specified diagonal provided by a vector, and zeros in
|
|
436
|
+
all the other entries.
|
|
437
|
+
|
|
438
|
+
@param vector
|
|
439
|
+
Vector providing the data for the non-zero diagonal.
|
|
440
|
+
|
|
441
|
+
@param matrix_diagonal
|
|
442
|
+
The index of the non-zero diagonal.
|
|
443
|
+
|
|
444
|
+
@discussion
|
|
445
|
+
Creates a new matrix with entries on the specified diagonal taken from the
|
|
446
|
+
vector argument, and zeros in the other entries. The matrix is square, and
|
|
447
|
+
has size length(vector) + abs(matrix_diagonal).
|
|
448
|
+
|
|
449
|
+
If matrix_diagonal is zero, the main diagonal is set. If matrix_diagonal is
|
|
450
|
+
+1, the first superdiagonal is set. If matrix_diagonal is -2, the second
|
|
451
|
+
subdiagonal is set.
|
|
452
|
+
|
|
453
|
+
The diagonal may be specified by a vector or by a matrix that has only one
|
|
454
|
+
row or only one column. If the provided object is not a vector or matrix,
|
|
455
|
+
or is a matrix with both dimensions larger than one, the returned object
|
|
456
|
+
will have status LA_INVALID_PARAMETER_ERROR.
|
|
457
|
+
*/
|
|
458
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
459
|
+
la_object_t la_diagonal_matrix_from_vector(la_object_t vector,
|
|
460
|
+
la_index_t matrix_diagonal);
|
|
461
|
+
|
|
462
|
+
/*!
|
|
463
|
+
@abstract
|
|
464
|
+
Creates a vector from the specified row of the matrix.
|
|
465
|
+
|
|
466
|
+
@param matrix
|
|
467
|
+
Matrix from which to create the row vector.
|
|
468
|
+
|
|
469
|
+
@param matrix_row.
|
|
470
|
+
The zero-based index of the row to create the vector from.
|
|
471
|
+
|
|
472
|
+
@return
|
|
473
|
+
The resulting vector is a 1 x cols(matrix) vector.
|
|
474
|
+
|
|
475
|
+
@discussion
|
|
476
|
+
Creates a vector from the specified row of the matrix. If the value for
|
|
477
|
+
matrix_row is less than zero or greater than rows(matrix)-1,
|
|
478
|
+
LA_INVALID_PARAMETER_ERROR is returned.
|
|
479
|
+
|
|
480
|
+
If matrix is a splat, LA_INVALID_PARAMETER_ERROR is returned.
|
|
481
|
+
|
|
482
|
+
Always returns a 1 x vector_length vector.
|
|
483
|
+
*/
|
|
484
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
485
|
+
la_object_t la_vector_from_matrix_row(la_object_t matrix,
|
|
486
|
+
la_count_t matrix_row);
|
|
487
|
+
|
|
488
|
+
/*!
|
|
489
|
+
@abstract
|
|
490
|
+
Creates a vector from the specified column of the matrix.
|
|
491
|
+
|
|
492
|
+
@param matrix
|
|
493
|
+
Matrix from which to create the column vector.
|
|
494
|
+
|
|
495
|
+
@param matrix_col.
|
|
496
|
+
The zero-based index of the column to create the vector from.
|
|
497
|
+
|
|
498
|
+
@return
|
|
499
|
+
The resulting vector is a rows(matrix) x 1 vector.
|
|
500
|
+
|
|
501
|
+
@discussion
|
|
502
|
+
Creates a vector from the specified column of the matrix. If the value for
|
|
503
|
+
matrix_col is less than zero or greater than cols(matrix)-1,
|
|
504
|
+
LA_INVALID_PARAMETER_ERROR is returned.
|
|
505
|
+
|
|
506
|
+
If matrix is a splat, LA_INVALID_PARAMETER_ERROR is returned.
|
|
507
|
+
|
|
508
|
+
Always returns a vector_length x 1 vector.
|
|
509
|
+
*/
|
|
510
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
511
|
+
la_object_t la_vector_from_matrix_col(la_object_t matrix,
|
|
512
|
+
la_count_t matrix_col);
|
|
513
|
+
|
|
514
|
+
/*!
|
|
515
|
+
@abstract
|
|
516
|
+
Creates a vector from the specified diagonal of the matrix.
|
|
517
|
+
|
|
518
|
+
@param matrix
|
|
519
|
+
Matrix from which to create the vector.
|
|
520
|
+
|
|
521
|
+
@param matrix_diagonal.
|
|
522
|
+
The index of the diagonal to create the vector from.
|
|
523
|
+
|
|
524
|
+
@return
|
|
525
|
+
The resulting vector is a length x 1 vector where length is
|
|
526
|
+
min(rows(matrix),cols(matrix)-abs(matrix_diagonal)
|
|
527
|
+
|
|
528
|
+
@discussion
|
|
529
|
+
Creates a new vector with entries on the specified diagonal taken from the
|
|
530
|
+
vector argument, and zeros in the other entries. The matrix is square, and
|
|
531
|
+
has size length(vector) + abs(matrix_diagonal).
|
|
532
|
+
|
|
533
|
+
If matrix_diagonal is zero, the main diagonal is set. If matrix_diagonal is
|
|
534
|
+
+1, the first superdiagonal is set. If matrix_diagonal is -2, the second
|
|
535
|
+
subdiagonal is set.
|
|
536
|
+
|
|
537
|
+
Creates a vector from the specified diagonal of the matrix. If the value for
|
|
538
|
+
matrix_diagonal is less than zero and abs(matrix_diagonal) > rows(matrix)-1,
|
|
539
|
+
or if matrix_diagonal is greater than zero and matrix_diagonal >
|
|
540
|
+
cols(matrix)-1, LA_INVALID_PARAMETER_ERROR is returned.
|
|
541
|
+
|
|
542
|
+
If matrix is a splat, LA_INVALID_PARAMETER_ERROR is returned.
|
|
543
|
+
|
|
544
|
+
Always returns a vector_length x 1 vector.
|
|
545
|
+
*/
|
|
546
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
547
|
+
la_object_t la_vector_from_matrix_diagonal(la_object_t matrix,
|
|
548
|
+
la_index_t matrix_diagonal);
|
|
549
|
+
|
|
550
|
+
#if __has_feature(assume_nonnull)
|
|
551
|
+
_Pragma("clang assume_nonnull end")
|
|
552
|
+
#endif
|
|
553
|
+
|
|
554
|
+
#endif // __LA_MATRIX_HEADER__
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* Copyright (c) 2014 Apple Inc. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
#ifndef __LA_NORMS_HEADER__
|
|
4
|
+
#define __LA_NORMS_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
|
+
#define LA_L1_NORM 1
|
|
18
|
+
#define LA_L2_NORM 2
|
|
19
|
+
#define LA_LINF_NORM 3
|
|
20
|
+
typedef unsigned long la_norm_t;
|
|
21
|
+
|
|
22
|
+
/*!
|
|
23
|
+
@abstract
|
|
24
|
+
Compute a norm of a vector or matrix.
|
|
25
|
+
|
|
26
|
+
@discussion
|
|
27
|
+
"vector" refers to the fact that this function computes the norm of its
|
|
28
|
+
argument considered as a vector, and not an operator norm. The actual
|
|
29
|
+
argument may be either a vector or a matrix. If it is not a vector or
|
|
30
|
+
matrix, or if the vector_norm parameter is not a supported value, NAN is
|
|
31
|
+
returned.
|
|
32
|
+
*/
|
|
33
|
+
LA_FUNCTION LA_AVAILABILITY
|
|
34
|
+
float la_norm_as_float(la_object_t vector, la_norm_t vector_norm);
|
|
35
|
+
|
|
36
|
+
LA_FUNCTION LA_AVAILABILITY
|
|
37
|
+
double la_norm_as_double(la_object_t vector, la_norm_t vector_norm);
|
|
38
|
+
|
|
39
|
+
/*!
|
|
40
|
+
@abstract
|
|
41
|
+
"Normalizes" a vector or matrix.
|
|
42
|
+
|
|
43
|
+
@discussion
|
|
44
|
+
The returned object has the same direction as the first operand, and has
|
|
45
|
+
norm 1 in the specified vector norm. If the input vector is zero, it cannot
|
|
46
|
+
be meaningfully normalized and the returned object is also zero. If the
|
|
47
|
+
parameter vector is not a vector or matrix, or if the vector_norm parameter
|
|
48
|
+
is not a supported value, the returned object has status
|
|
49
|
+
LA_INVALID_PARAMETER_ERROR.
|
|
50
|
+
*/
|
|
51
|
+
LA_FUNCTION LA_AVAILABILITY LA_RETURNS_RETAINED
|
|
52
|
+
la_object_t la_normalized_vector(la_object_t vector, la_norm_t vector_norm);
|
|
53
|
+
|
|
54
|
+
#if __has_feature(assume_nonnull)
|
|
55
|
+
_Pragma("clang assume_nonnull end")
|
|
56
|
+
#endif
|
|
57
|
+
|
|
58
|
+
#endif
|