Most of the operations documented in this section are simple macros that apply array-map to a function and their array arguments.
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes String))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array #[#["Hello!" "I!"] #["Am!" "Shouting!"]])
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes String))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array #[#["Hello!" "I!"] #["Am!" "Shouting!"]])
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes Positive-Fixnum))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array
#[#[#[2 3 4]
#[5 6 7]
#[8 9 10]]
#[#[11 12 13]
#[14 15 16]
#[17 18 19]]
#[#[20 21 22]
#[23 24 25]
#[26 27 28]]])
array-shape-broadcast: incompatible array shapes
(array-broadcasting #t): '#(2 2), '#(3 3)
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes Nonnegative-Flonum))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array #[12.083 3.372 0.562])
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes String))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array "Whoa, Nelly!")
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes Fixnum))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array #[-9 -8 -7])
When explicitly instantiating array-map ’s types using inst , instantiate R (the return type’s element type) first, then the arguments’ element types in order.
syntax
( inline-array-map farrs...)
syntax
( array+ arrs...)
syntax
( array* arrs...)
syntax
( array- arr0arrs...)
syntax
( array/ arr0arrs...)
syntax
( array-min arr0arrs...)
syntax
( array-max arr0arrs...)
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes Positive-Flonum))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array #[#[200.0 201.0] #[202.0 203.0]])
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes Zero))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array 0)
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes One))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array 1)
- : #(struct:Array
(Indexes
Index
(Boxof Boolean)
(-> Void)
(-> Indexes Positive-Exact-Rational))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array #[1/2 2])
syntax
( array-scale arrx)
syntax
( array-abs arr)
syntax
( array-sqr arr)
syntax
( array-sqrt arr)
syntax
( array-conjugate arr)
syntax
( array-real-part arr)
syntax
( array-imag-part arr)
syntax
( array-make-rectangular arr0arr1)
syntax
( array-magnitude arr)
syntax
( array-angle arr)
syntax
( array-make-polar arr0arr1)
syntax
( array< arr0arr1arrs...)
syntax
( array<= arr0arr1arrs...)
syntax
( array> arr0arr1arrs...)
syntax
( array>= arr0arr1arrs...)
syntax
( array= arr0arr1arrs...)
syntax
( array-not arr)
syntax
( array-and arr...)
syntax
( array-or arr...)
syntax
( array-if cond-arrtrue-arrfalse-err)
parameter
( array-broadcasting )→(U Boolean 'permissive)
procedure
( array-shape-broadcast dss[broadcasting])→Indexes
- : Indexes
'#()
- : Indexes
'#(10)
array-shape-broadcast: incompatible array shapes
(array-broadcasting #t): '#(2), '#(10)
- : Indexes
'#(10)
procedure
( array-broadcast arrds)→(Array A)
ds:Indexes
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes Positive-Byte))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array #[10 10 10 10 10 10 10 10 10 10])
array-broadcast: cannot broadcast to a lower-dimensional
shape; given (array #[0 1]) and '#()
- : #(struct:Array
(Indexes Index (Boxof Boolean) (-> Void) (-> Indexes (U One Zero)))
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:56:13 prop:equal+hash>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:55:13 prop:custom-write>
#<syntax:build/user/8.18/pkgs/math-lib/math/private/array/typed-array-struct.rkt:54:13 prop:custom-print-quotable>)
(array #[0 1 0 1 0])
When array-strictness is #f, array-broadcast always returns a nonstrict array.
When array-strictness is #t, array-broadcast returns a strict array when arr is nonstrict and the result has more elements than arr.