Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Efficient Matrix representation for linear algebra

1 view
Skip to first unread message

Jon Harrop

unread,
Apr 21, 2008, 3:38:22 PM4/21/08
to

What would be the most efficient matrix representation for linear algebra
on .NET?

I recently benchmarked a 2D array, a flat array and an array of arrays and
got the following performance results for LU decomposition:

2D array: 147 MFLOPS
Flat array: 340 MFLOPS
Array of arrays: 419 MFLOPS

However, I am not sure this is applicable to other algorithms. Does anyone
have any other data on this?

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u

Arne Vajhøj

unread,
May 11, 2008, 10:49:49 PM5/11/08
to
Jon Harrop wrote:
> What would be the most efficient matrix representation for linear algebra
> on .NET?
>
> I recently benchmarked a 2D array, a flat array and an array of arrays and
> got the following performance results for LU decomposition:
>
> 2D array: 147 MFLOPS
> Flat array: 340 MFLOPS
> Array of arrays: 419 MFLOPS
>
> However, I am not sure this is applicable to other algorithms. Does anyone
> have any other data on this?

The results seems to match what would be expected.

Array of array is more flexible and need to support
non rectangular data - that obvious cost something.

By using 2D array instead of explicit calculation of
index into a 1D array you leave the indexing to the
compiler, which should enable it to better optimize.

Arne

0 new messages