Matrix Inverse: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
Line 1: | Line 1: | ||
{{Built-in|Matrix Inverse|⌹}} is a [[monadic]] [[primitive function]] that returns the [[wikipedia:matrix inverse|inverse]] of a [[simple]] [[numeric]] array of [[rank]] 2 or lower. Some dialects automatically apply it to rank-2 [[subarray]]s of higher-rank [[argument]]s. It shares the [[glyph]] ''Quad Divide'' <source lang=apl inline>⌹</ | {{Built-in|Matrix Inverse|⌹}} is a [[monadic]] [[primitive function]] that returns the [[wikipedia:matrix inverse|inverse]] of a [[simple]] [[numeric]] array of [[rank]] 2 or lower. Some dialects automatically apply it to rank-2 [[subarray]]s of higher-rank [[argument]]s. It shares the [[glyph]] ''Quad Divide'' <source lang=apl inline>⌹</syntaxhighlight> (often called ''Domino'') with the dyadic function [[Matrix Divide]]. | ||
== Examples == | == Examples == | ||
Line 19: | Line 19: | ||
⌹2 2⍴0 | ⌹2 2⍴0 | ||
∧ | ∧ | ||
</ | </syntaxhighlight> | ||
When the argument is a [[scalar]] or [[vector]], or the given matrix has more rows than columns (<source lang=apl inline>r>c</ | When the argument is a [[scalar]] or [[vector]], or the given matrix has more rows than columns (<source lang=apl inline>r>c</syntaxhighlight> where <source lang=apl inline>r c≡⍴X</syntaxhighlight>), Matrix Inverse computes specific forms of generalized inverse called [[wikipedia:Moore-Penrose inverse|Moore-Penrose inverse]]. For a scalar, the result is the [[reciprocal]] of the argument; for a vector, the result equals <source lang=apl inline>(+X)÷X+.×+X</syntaxhighlight>. For a non-square matrix, the result equals <source lang=apl inline>(+⍉X)⌹(+⍉X)+.×X</syntaxhighlight> (where <source lang=apl inline>+⍉X</syntaxhighlight> is the [[wikipedia:conjugate transpose|conjugate transpose]] of X). | ||
<source lang=apl> | <source lang=apl> | ||
Line 52: | Line 52: | ||
1.0000E000J¯5.5511E¯17 0 | 1.0000E000J¯5.5511E¯17 0 | ||
¯2.7756E¯17J05.5511E¯17 1 | ¯2.7756E¯17J05.5511E¯17 1 | ||
</ | </syntaxhighlight> | ||
== External links == | == External links == | ||
Line 65: | Line 65: | ||
* [http://microapl.com/apl_help/ch_020_020_270.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_270.htm APLX] | ||
* [http://wiki.nars2000.org/index.php/Matrix_Inverse/Divide NARS2000] | * [http://wiki.nars2000.org/index.php/Matrix_Inverse/Divide NARS2000] | ||
* J [https://www.jsoftware.com/help/dictionary/d131.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/percentdot NuVoc] (as <source lang=j inline>%.</ | * J [https://www.jsoftware.com/help/dictionary/d131.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/percentdot NuVoc] (as <source lang=j inline>%.</syntaxhighlight>) | ||
{{APL built-ins}}[[Category:Primitive functions]] | {{APL built-ins}}[[Category:Primitive functions]] |