473,473 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Row major data access behavior for 2 dimensional arrays

I have found that deployed "RELEASE" versions of applications employing
matrix multiplications perform much more efficiently (1.5 to 2 X) when the
algorithm accesses the data in inner loop of the multiplication in a row by
row fashion.

For example:

For k = 1 to m : For i = 1 to n : For j = 1 to p
C(i, j) = A(i, k)*B(k, j) + C(i, j)
Next : Next : Next

Has an inner loop which accesses whole rows of B and C sequentially and
executes twice as fast a variant that accesses whole columns of A and C
sequentially:

For j = 1 to m : For k = 1 to n : For i = 1 to p
C(i, j) = A(i, k)*B(k, j) + C(i, j)
Next : Next : Next

Evidently, my arrays are stored using a row major structure.

FINALLY, my question is; Is this an artifact of

A. Windows
B. .NET
C. Processor/Memory Configuration
D. VB
E. Other Ideas?

-- mark b
Nov 21 '05 #1
0 959

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Steven James Samuel Stapleton | last post by:
Will calling ksort() on an array speed up it's access? For example, I have the array $file_index, which is accessed by a key (the entry id) and has two sub elements in a one dimensional array...
7
by: Pete | last post by:
Quick question: What does ary return in C/C++? I know that C/C++ does not have two-dimensional arrays, thus ary is not valid notation. Instead I should use ary . But. But I was...
16
by: TTroy | last post by:
I FOUND MAJOR ERRORS in K&R2 (making it almost useless for the herein mentioned topics). K&R2 Section 5.9 Pointers vs. Multidimension Arrays starts of like this... "Newcomers to C are...
3
by: Amelyan | last post by:
When we want radio button to belong to a group name we say, radio1.GroupName="GroupA". In this case, radio1 will be unselected if another radio button is selected in "GroupA". Is there a way...
16
by: rguti | last post by:
Hi, How do I create a two dimensional array? I have created a one dimensional doing this: Dim laFields As ArrayList = New ArrayList How about to do a 2 dimensional?
2
by: Jef Driesen | last post by:
I'm working on a project where i need to exchange multidimensional data between C/C++ (row-major) and matlab (column-major). I understand the difference between those two mappings to linear memory....
24
by: Kavya | last post by:
int main (){ int a={{1,2,3},{4,5,6}}; int (*ptr)=a; /* This should be fine and give 3 as output*/ printf("%d\n",(*ptr)); ++ptr;
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
3
by: Lax | last post by:
Isn't it "technically" meaningless to call C a "row major language," since there are no such things as multidimensional arrays in C. In C you can define arrays of arrays, and the way that the...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.