Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Array programming
(section)
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!
==Mathematical reasoning and language notation== The matrix left-division operator concisely expresses some semantic properties of matrices. As in the scalar equivalent, if the ([[determinant]] of the) coefficient (matrix) <code>A</code> is not null then it is possible to solve the (vectorial) equation <code>A * x = b</code> by left-multiplying both sides by the [[inverse matrix|inverse]] of <code>A</code>: <code>A<sup>β1</sup></code> (in both MATLAB and GNU Octave languages: <code>A^-1</code>). The following mathematical statements hold when <code>A</code> is a [[matrix rank#Properties|full rank]] [[square matrix]]: :<code>A^-1 *(A * x)==A^-1 * (b)</code> :<code>(A^-1 * A)* x ==A^-1 * b </code> (matrix-multiplication [[associativity]]) :<code>x = A^-1 * b</code> where <code>==</code> is the equivalence [[relational operator]]. The previous statements are also valid MATLAB expressions if the third one is executed before the others (numerical comparisons may be false because of round-off errors). If the system is overdetermined β so that <code>A</code> has more rows than columns β the pseudoinverse <code>A<sup>+</sup></code> (in MATLAB and GNU Octave languages: <code>pinv(A)</code>) can replace the inverse <code>A<sup>β1</sup></code>, as follows: :{{code|2=matlab|1=pinv(A) *(A * x)==pinv(A) * (b)}} :{{code|2=matlab|1=(pinv(A) * A)* x ==pinv(A) * b}} (matrix-multiplication associativity) :{{code|2=matlab|1=x = pinv(A) * b}} However, these solutions are neither the most concise ones (e.g. still remains the need to notationally differentiate overdetermined systems) nor the most computationally efficient. The latter point is easy to understand when considering again the scalar equivalent <code>a * x = b</code>, for which the solution <code>x = a^-1 * b</code> would require two operations instead of the more efficient <code>x = b / a</code>. The problem is that generally matrix multiplications are not [[commutativity|commutative]] as the extension of the scalar solution to the matrix case would require: :<code>(a * x)/ a ==b / a</code> :<code>(x * a)/ a ==b / a</code> (commutativity does not hold for matrices!) :<code>x * (a / a)==b / a</code> (associativity also holds for matrices) :<code>x = b / a</code> The MATLAB language introduces the left-division operator <code>\</code> to maintain the essential part of the analogy with the scalar case, therefore simplifying the mathematical reasoning and preserving the conciseness: :<code>A \ (A * x)==A \ b</code> :<code>(A \ A)* x ==A \ b</code> (associativity also holds for matrices, commutativity is no more required) :<code>x = A \ b</code> This is not only an example of terse array programming from the coding point of view but also from the computational efficiency perspective, which in several array programming languages benefits from quite efficient linear algebra libraries such as [[Automatically Tuned Linear Algebra Software|ATLAS]] or [[LAPACK]].<ref>{{cite web |title= GNU Octave Manual. Appendix G Installing Octave. |url= https://www.gnu.org/software/octave/doc/interpreter/Installation.html |access-date= 2011-03-19}}</ref> Returning to the previous quotation of Iverson, the rationale behind it should now be evident: {{quote|it is important to distinguish the difficulty of describing and of learning a piece of notation from the difficulty of mastering its implications. For example, learning the rules for computing a matrix product is easy, but a mastery of its implications (such as its associativity, its distributivity over addition, and its ability to represent linear functions and geometric operations) is a different and much more difficult matter. Indeed, the very suggestiveness of a notation may make it seem harder to learn because of the many properties it suggests for explorations.}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)