Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000293 [ALGLIB] Linear algebra crash always 2010-02-07 22:26 2010-02-08 10:38
Reporter wvd_vegt View Status public  
Assigned To SergeyB
Priority normal Resolution no change required  
Status resolved   Product Version 2.3.0
Summary 0000293: SVD Algorithhm crashes on array bounds
Description Hi,

When i try to run an SVD the routine crashes on an array index out of bounds in

Test method LsaTest.LsaTests.TestDecompose threw exception: System.IndexOutOfRangeException: De index ligt buiten de matrixgrenzen..

The error comes from the loop

                for(i_=1; i_<=nmip1;i_++)
                {
                    t[i_] = a[i,i_+i1_];
                }

where the i_ index runs from 0 to 25 (in the alglib svd test code) where the array is only 25 elements and start at 0 (so the index should run from 0..24).
Additional Information Callstack:

alglib.lq.lqdecomposition(Double[,]& a, Int32 m, Int32 n, Double[]& tau) in Alglib\lq.cs: line 285

alglib.svd.svddecomposition(Double[,] a, Int32 m, Int32 n, Int32 uneeded, Int32 vtneeded, Int32 additionalmemory, Double[]& w, Double[,]& u, Double[,]& vt) in
Alglib\svd.cs: line 517

--<rest is from my test probject.
Lsa.NET.Lsa.Decompose() in C:\Documents and Settings\veg\Mijn documenten\Visual Studio 2008\Projects\Lsa\lsa\Lsa.cs: line 942
LsaTest.LsaTests.TestDecompose() in C:\Documents and Settings\veg\Mijn documenten\Visual Studio 2008\Projects\Lsa\lsatest\LsaTests.cs: line 175


As you can see I compiled and ran a vs2k8 unit test (copied the code from the alglib test into it).
Programming language C#
Attached Files

- Relationships

-  Notes
(0000045)
SergeyB (administrator)
2010-02-08 10:38

It is not a bug.

alglib.svd.svddecomposition is an obsolete routine which uses old 1-based notation from LAPACK. It accepts matrix with [1..N,1..N] numeration, not with [0..N-1,0..N-1] indexes. It was left for backward compatibility, new users should use rmatrixsvd which uses modern 0-based array indexes.

P.S. looks like it is better to purge it from next release...

- Issue History
Date Modified Username Field Change
2010-02-07 22:26 wvd_vegt New Issue
2010-02-07 22:26 wvd_vegt Programming language => C#
2010-02-08 10:30 SergeyB Status new => assigned
2010-02-08 10:30 SergeyB Assigned To => SergeyB
2010-02-08 10:33 SergeyB Category Statistics => Linear algebra
2010-02-08 10:38 SergeyB Note Added: 0000045
2010-02-08 10:38 SergeyB Status assigned => resolved
2010-02-08 10:38 SergeyB Resolution open => no change required


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker