Matrix multiplication: Difference between revisions
Content added Content deleted
m (alphabetize TI-*) |
m (→{{header|J}}: lang tags, use mp instead of x to prevent confusion with x used as argument later) |
||
Line 609: | Line 609: | ||
=={{header|J}}== |
=={{header|J}}== |
||
Matrix multiply in J is just < |
Matrix multiply in J is just <code>+/ .*</code>. For example: |
||
<lang j> |
|||
mp =: +/ .* NB. Matrix product |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</lang> |
|||
The notation is for a generalized inner product so that |
The notation is for a generalized inner product so that |
||
<lang j> |
|||
x ~:/ .*. y NB. boolean inner product (<tt>~: </tt>is "not equal" (exclusive or) and<tt> *. </tt>is "and") |
|||
x ~:/ .*. y NB. boolean inner product (<tt>~: </tt>is "not equal" (exclusive or) and<tt> *. </tt>is "and") |
|||
x *./ .= y NB. which rows of x are the same as vector y? |
|||
x + / .= y NB. number of places where each row of x equals vector y |
|||
</lang> |
|||
etc. |
etc. |
||