This project has moved and is read-only. For the latest updates, please go here.

Matrix Pivot

May 19, 2010 at 10:17 PM


I was just implementing the LU factorization and wanted to get some feedback on the following API question. The LU factorization of a matrix A gives us two factors: a lower triangular L and upper triangular U matrix. It also produces a permutation matrix (encoded as a set of transpositions int[]) so that P*A=L*U.

Imagine someone wants to actually use the pivots, I think it would make sense that we provide a mechanism to do so. A few options:

  • we create a permutation object in Math.Net which the LU decomposition generates. We then add a method Matrix.PermuteRows(Permutation foo) and Matrix.PermuteColumns(Permutation foo)
  • we add a method Matrix.PermuteRows(int[] foo) and Matrix.PermuteColumns(int[] foo)
  • we add a Pivot method to the LU decomposition which pivots any matrix according to the pivots it generated internally
  • other suggestions?

Cheers, J

May 22, 2010 at 6:04 AM

Hi Jurgen,

Adding a Permutation class and permute methods to the matrix class is a good idea. But do we need the a Pivot method on the LU class? How would it be used?



Jun 5, 2010 at 9:53 PM

Nope, once I create the Pivot class on the matrix class I don't think we need a Pivot method on the LU class anymore. People can just apply the pivot to the L or U matrix which they get from the LU class.

Cheers, J