It's UWAweek 47

help5507

This forum is provided to promote discussion amongst students enrolled in CITS5507 High Performance Computing.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 148 articles.
Currently 18 other people reading this forum.


 UWA week 35 (2nd semester, week 6) ↓
SVG not supported

Login to reply

👍?
helpful
10:36am Fri 30th Aug, ANONYMOUS

Hi Professor,

If we have a matrix A with N rows and N columns, we can compress it into two new matrices, AX and AY, each with N rows and M columns. The problem is, we don’t know what M is when allocating memory for AX and AY. I could go through the original matrix A to find the row with the most non-zero elements and use that number as M. But this isn't very efficient because it means I would need to create the whole matrix A first, which uses a lot of memory, and iterate it twice—once to determine M and once to fill in AX and AY. Additionally, many rows in AX and AY might not use all the space allocated, leading to wasted memory.

To solve this, I’m thinking of using arrays that can grow as needed to store the rows of AX and AY. This way, each row can be as long as necessary, and we don’t need to figure out M ahead of time. It also means we can create the compressed matrices directly without needing to build A first.

Another idea I had is to combine AX and AY into one data structure to make things simpler and more efficient. Instead of storing values and indices separately, I would store them together as pairs in the same array. I think this would improve performance.

Could you please let me know if these approaches are acceptable? If not, could you clarify the required data structure we should use? Thank you for your time.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy