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

QR Factorization for SparseMatrix

Dec 8, 2012 at 4:24 PM
Edited Dec 8, 2012 at 4:28 PM

I have a trouble. When i use a big sparse matrix for QR factorization it fails and rises OutOfRange Exception. Could you help me please?

SparseMatrix m = new SparseMatrix(....); rows count = column count and grater than 1000

var qr = m.QR(); --- Fails

System.ArgumentOutOfRangeException was unhandled by user code
  Message=Non-negative number required.
Parameter name: length
  Source=mscorlib
  ParamName=length
  StackTrace:
       at System.Array.BinarySearch[T](T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
       at System.Array.BinarySearch[T](T[] array, Int32 index, Int32 length, T value)
       at MathNet.Numerics.LinearAlgebra.Storage.SparseCompressedRowMatrixStorage`1.FindItem(Int32 row, Int32 column) in c:\TeamCity\buildAgent\work\d4ecde2945c804d6\src\Numerics\LinearAlgebra\Storage\SparseCompressedRowMatrixStorage.cs:line 180
       at MathNet.Numerics.LinearAlgebra.Storage.SparseCompressedRowMatrixStorage`1.At(Int32 row, Int32 column, T value) in c:\TeamCity\buildAgent\work\d4ecde2945c804d6\src\Numerics\LinearAlgebra\Storage\SparseCompressedRowMatrixStorage.cs:line 77
       at MathNet.Numerics.LinearAlgebra.Generic.Matrix`1.At(Int32 row, Int32 column, T value) in c:\TeamCity\buildAgent\work\d4ecde2945c804d6\src\Numerics\LinearAlgebra\Generic\Matrix.cs:line 204
       at MathNet.Numerics.LinearAlgebra.Double.Factorization.UserQR.ComputeQR(Double[] u, Matrix`1 a, Int32 rowStart, Int32 rowDim, Int32 columnStart, Int32 columnDim, Int32 availableCores) in c:\TeamCity\buildAgent\work\d4ecde2945c804d6\src\Numerics\LinearAlgebra\Double\Factorization\UserQR.cs:line 218
       at MathNet.Numerics.LinearAlgebra.Double.Factorization.UserQR.<>c__DisplayClass6.<ComputeQR>b__3() in c:\TeamCity\buildAgent\work\d4ecde2945c804d6\src\Numerics\LinearAlgebra\Double\Factorization\UserQR.cs:line 204
       at System.Threading.Tasks.Task.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()
  InnerException: