Inner Product R←Xf.gY
f
and g
are dyadic functions. The last axis of X
must have the same length as the first axis of Y
, or one of X
and Y
is single (^/1=⍴X
or ^/1=⍴Y
).
The result of the derived function has shape (¯1↓⍴X),1↓⍴Y
; each item is f/x g¨y
where x
and y
are vectors taken from all the combinations of vectors along the last axis of X
and the first axis of Y
.
Note
g
must return a result.f
must return a result with the possible exception of the case when1=⍴x g¨y
.- The expression
f/x g¨y
applies even whenR
orx g¨y
orX
orY
is empty. WhenX
orY
is empty, the vectorx
isX
reshaped to the appropriate length (y
isY
reshaped to appropriate length). x
is justX
itself ifX
is a scalar. Likewisey
andY
.
Examples
1 2 3+.×10 12 14
76
+/1 2 3×10 12 14
76
NAMES
HENRY
WILLIAM
JAMES
SEBASTIAN
NAMES^.='WILLIAM '
0 1 0 0