Handbook
Glossary
broadcast-binary-op ( a b quot -- c )
Vocabulary
arrays
.
shaped
.
private
Inputs
a
an
object
b
an
object
quot
an
object
Outputs
c
an
object
Definition
USING:
accessors
arrays.shaped
kernel
math
sequences
;
IN:
arrays.shaped.private
::
broadcast-binary-op
( a b quot -- c )
a
>shaped-array
:>
left b
>shaped-array
:>
right left right
output-shape
:>
dimensions dimensions
row-major-strides
:>
strides left
shape>>
dimensions
length
broadcast-strides
:>
left-strides right
shape>>
dimensions
length
broadcast-strides
:>
right-strides dimensions
product
<iota>
[|
index |
strides dimensions
[|
stride dimension | index stride
/i
dimension
mod
]
2map
:>
coordinate coordinate left-strides
[
*
]
2map
sum
left
underlying>>
nth
coordinate right-strides
[
*
]
2map
sum
right
underlying>>
nth
quot
call
]
map
dimensions
<shaped-array>
;
inline