From 07725b4cc10b1a41b3fc22853b67545ffd9ef750 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Tue, 24 Sep 2013 20:03:17 +0200 Subject: [PATCH] LU: fix array length bug I've introduced into MILU(0) a few commits ago --- .../LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs index ded939e9..a127d284 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs @@ -100,8 +100,8 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers int[] ja = csr.ColumnIndices; int[] ia = csr.RowPointers; - _alu = new double[ia.Length]; - _jlu = new int[ia.Length]; + _alu = new double[ia[n] + 1]; + _jlu = new int[ia[n] + 1]; _diag = new int[n]; int code = Compute(n, a, ja, ia, _alu, _jlu, _diag, UseModified);