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
gmust return a result.fmust return a result with the possible exception of the case when1=⍴x g¨y.- The expression
f/x g¨yapplies even whenRorx g¨yorXorYis empty. WhenXorYis empty, the vectorxisXreshaped to the appropriate length (yisYreshaped to appropriate length). xis justXitself ifXis a scalar. LikewiseyandY.
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