🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.math.num-analysis
Article #265

In-situ 2-d non-square matrix transposition

#265
From: Keith Slavin
Date: Thu, 09 Apr 1992 17:16
25 lines
1287 bytes
Does anyone have an algorithm for IN-SITU transposition of a 2-d NON-SQUARE
matrix stored in a linear address space:

source memory location = source width * i + j,

move data to:

destination memory location = source height * j + i

(note: source height = destination width)

without requiring allocation of extra memory - the matrix is large
and I don't have much memory left.

Speed is not too much of an issue. I have found simple coordinate
transformation sequences which work for certain values of width and height,
but in many cases, these transformations produce closed sequences which are
only a subset of the total coordinate space, and a search (analogous to a
sieve) is required to complete the process. The sieve requires extra memory.

Is it even possible in the general case?

Thanks,

Keith Slavin
Technical Details
Message-ID: <1992Apr9.171623.19279@tvnews.tv.tek.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zephyr.ens.tek.com!tvnews!euler.tv.tek.com!keith
References: <1943@eru.mt.luth.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zephyr.ens.tek.com!tvnews!euler.tv.tek.com!keith
From: keith@euler.tv.tek.com (Keith Slavin)
Newsgroups: sci.math.num-analysis
Subject: In-situ 2-d non-square matrix transposition
Keywords: matrix transposition
Message-ID: <1992Apr9.171623.19279@tvnews.tv.tek.com>
Date: 9 Apr 92 17:16:23 GMT
References: <1943@eru.mt.luth.se>
Sender: news@tvnews.tv.tek.com (news user)
Organization: Tektronix TV Products
Lines: 25