LLNL / libROM

Model reduction library with an emphasis on large scale parallelism and linear subspace methods
https://www.librom.net
Other
201 stars 36 forks source link

Fixing a bug in Matrix transpose #101

Closed dylan-copeland closed 2 years ago

kevinhkhuynh commented 2 years ago

Was transposing not working before or was it doing redundant work?

dylan-copeland commented 2 years ago

Was transposing not working before or was it doing redundant work?

It was looping over all entries, swapping A_ij with A_ji. This means the swapping was done twice, leaving the matrix unchanged. Only the upper (or lower) triangular part should be looped.

kevinhkhuynh commented 2 years ago

Was transposing not working before or was it doing redundant work?

It was looping over all entries, swapping A_ij with A_ji. This means the swapping was done twice, leaving the matrix unchanged. Only the upper (or lower) triangular part should be looped.

There are a few different Matrix transpose unit tests in libROM. It is strange to me why they passed before the bug fix and continued to pass afterwards.

dylan-copeland commented 2 years ago

@kevinhkhuynh In the tests directory, I see some tests for transposeMult, but not for transpose. Maybe a test should be added, if there is not one already.