Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Outer product
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==In programming languages== In some programming languages, given a two-argument function <code>f</code> (or a binary operator), the outer product, <code>f</code>, of two one-dimensional arrays, <code>A</code> and <code>B</code>, is a two-dimensional array <code>C</code> such that <code>C[i, j] = f(A[i], B[j])</code>. This is syntactically represented in various ways: in [[APL (programming language)|APL]], as the infix binary operator <syntaxhighlight lang=apl inline>β.f</syntaxhighlight>; in [[J (programming language)|J]], as the postfix adverb <syntaxhighlight lang=j inline>f/</syntaxhighlight>; in [[R (programming language)|R]], as the function <syntaxhighlight lang=r inline>outer(A, B, f)</syntaxhighlight> or the special <syntaxhighlight lang=r inline>%o%</syntaxhighlight>;<ref>{{cite web |title=outer function {{!}} R Documentation |url=https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/outer|access-date=2020-09-07 |website=rdocumentation.org}}</ref> in [[Wolfram Mathematica|Mathematica]], as <syntaxhighlight lang=mathematica inline>Outer[f, A, B]</syntaxhighlight>. In [[MATLAB]], the function <syntaxhighlight lang=matlab inline>kron(A, B)</syntaxhighlight> is used for this product. These often generalize to multi-dimensional arguments, and more than two arguments. In the [[Python (programming language)|Python]] library [[NumPy]], the outer product can be computed with function <code>np.outer()</code>.<ref>{{cite web |title=numpy.outer β NumPy v1.19 Manual |url=https://numpy.org/doc/stable/reference/generated/numpy.outer.html |access-date=2020-09-07 |website=numpy.org}}</ref> In contrast, <code>np.kron</code> results in a flat array. The outer product of multidimensional arrays can be computed using <code>np.multiply.outer</code>.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Outer product
(section)
Add topic