The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 <>, 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:

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.