Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.independent

Topic: matrices as vectors
Replies: 4   Last Post: Feb 22, 2013 12:43 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Michael Stemper

Posts: 671
Registered: 6/26/08
Re: matrices as vectors
Posted: Feb 20, 2013 1:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <496eaca6-79de-4d35-bd4b-190428fb2af2@googlegroups.com>, leonard14279@gmail.com writes:

>Had the idea to represent a 2d-matrix as a 1d-vector.

That's how most (if not all) programming languages do it.

>Need a function to map [ row, col ] indices to an index [ n ], and vice-versa.
>
>Then the rest should be straightforward.
>
>So we have two functions ...


>Then the rest of the code can be refactored to use the 1d-vector representation of a 2d-matrix.
>
>The question is, are there already existing formulas for matrix operations, where the matrix is represented as a 1d-vector?


Yes, and this approach can be generalized to p-dimensional arrays, as well.
See any book on data structures, or possibly Section 8.9 of:
<http://people.cis.ksu.edu/~schmidt/PPJv12pdf/ch8V12.pdf>

--
Michael F. Stemper
#include <Standard_Disclaimer>
"Writing about jazz is like dancing about architecture" - Thelonious Monk



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.