Package: release.debian.org Severity: normal User: release.debian.org@packages.debian.org Usertags: pu Tags: wheezy X-Debbugs-CC: pkg-octave-devel@lists.alioth.debian.org Please find attached a proposed update for package octave. The patch fixes the rcond function, which computes (the inverse of) the condition number of a matrix. For some matrices, the function currently returns a completely incorrect value. This is a problem that I consider severe enough to warrant a stable update (there is no associated bug in the Debian BTS, but I consider it of severity important). Thanks, -- .''`. Sébastien Villemot : :' : Debian Developer `. `' http://www.dynare.org/sebastien `- GPG Key: 4096R/381A7594
diff --git a/debian/changelog b/debian/changelog index 125dd1d..a2d53ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +octave (3.6.2-5+deb7u1) stable; urgency=low + + * rcond.patch: new patch taken from upstream, fixes rcond function + + -- Sébastien Villemot <sebastien@debian.org> Wed, 08 May 2013 20:05:07 +0200 + octave (3.6.2-5) unstable; urgency=low * Make liboctave-dev coinstallable again with all HDF5 variants diff --git a/debian/patches/rcond.patch b/debian/patches/rcond.patch new file mode 100644 index 0000000..45dcecc --- /dev/null +++ b/debian/patches/rcond.patch @@ -0,0 +1,210 @@ +Description: Fix rcond function + Use new copy of data for full factorization if positive definite cholesky + factorization fails. +Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/rev/197774b411ec +Bug: http://savannah.gnu.org/bugs/?37336 +Applied-Upstream: version, 3.6.4 +Last-Update: 2012-09-14 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +diff --git a/liboctave/CMatrix.cc b/liboctave/CMatrix.cc +--- a/liboctave/CMatrix.cc ++++ b/liboctave/CMatrix.cc +@@ -1786,13 +1786,15 @@ + else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) + { + double anorm = -1.0; +- ComplexMatrix atmp = *this; +- Complex *tmp_data = atmp.fortran_vec (); + + if (typ == MatrixType::Hermitian) + { + octave_idx_type info = 0; + char job = 'L'; ++ ++ ComplexMatrix atmp = *this; ++ Complex *tmp_data = atmp.fortran_vec (); ++ + anorm = atmp.abs().sum(). + row(static_cast<octave_idx_type>(0)).max(); + +@@ -1829,6 +1831,9 @@ + { + octave_idx_type info = 0; + ++ ComplexMatrix atmp = *this; ++ Complex *tmp_data = atmp.fortran_vec (); ++ + Array<octave_idx_type> ipvt (dim_vector (nr, 1)); + octave_idx_type *pipvt = ipvt.fortran_vec (); + +@@ -2098,8 +2103,10 @@ + { + info = 0; + char job = 'L'; ++ + ComplexMatrix atmp = *this; + Complex *tmp_data = atmp.fortran_vec (); ++ + anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max(); + + F77_XFCN (zpotrf, ZPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr, +diff --git a/liboctave/dMatrix.cc b/liboctave/dMatrix.cc +--- a/liboctave/dMatrix.cc ++++ b/liboctave/dMatrix.cc +@@ -1454,13 +1454,15 @@ + else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) + { + double anorm = -1.0; +- Matrix atmp = *this; +- double *tmp_data = atmp.fortran_vec (); + + if (typ == MatrixType::Hermitian) + { + octave_idx_type info = 0; + char job = 'L'; ++ ++ Matrix atmp = *this; ++ double *tmp_data = atmp.fortran_vec (); ++ + anorm = atmp.abs().sum(). + row(static_cast<octave_idx_type>(0)).max(); + +@@ -1495,6 +1497,9 @@ + { + octave_idx_type info = 0; + ++ Matrix atmp = *this; ++ double *tmp_data = atmp.fortran_vec (); ++ + Array<octave_idx_type> ipvt (dim_vector (nr, 1)); + octave_idx_type *pipvt = ipvt.fortran_vec (); + +@@ -1760,8 +1765,10 @@ + { + info = 0; + char job = 'L'; ++ + Matrix atmp = *this; + double *tmp_data = atmp.fortran_vec (); ++ + anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max(); + + F77_XFCN (dpotrf, DPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr, +@@ -1838,6 +1845,7 @@ + + Matrix atmp = *this; + double *tmp_data = atmp.fortran_vec (); ++ + if(anorm < 0.) + anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max(); + +diff --git a/liboctave/fCMatrix.cc b/liboctave/fCMatrix.cc +--- a/liboctave/fCMatrix.cc ++++ b/liboctave/fCMatrix.cc +@@ -1782,13 +1782,15 @@ + else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) + { + float anorm = -1.0; +- FloatComplexMatrix atmp = *this; +- FloatComplex *tmp_data = atmp.fortran_vec (); + + if (typ == MatrixType::Hermitian) + { + octave_idx_type info = 0; + char job = 'L'; ++ ++ FloatComplexMatrix atmp = *this; ++ FloatComplex *tmp_data = atmp.fortran_vec (); ++ + anorm = atmp.abs().sum(). + row(static_cast<octave_idx_type>(0)).max(); + +@@ -1825,6 +1827,9 @@ + { + octave_idx_type info = 0; + ++ FloatComplexMatrix atmp = *this; ++ FloatComplex *tmp_data = atmp.fortran_vec (); ++ + Array<octave_idx_type> ipvt (dim_vector (nr, 1)); + octave_idx_type *pipvt = ipvt.fortran_vec (); + +@@ -2094,8 +2099,10 @@ + { + info = 0; + char job = 'L'; ++ + FloatComplexMatrix atmp = *this; + FloatComplex *tmp_data = atmp.fortran_vec (); ++ + anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max(); + + F77_XFCN (cpotrf, CPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr, +diff --git a/liboctave/fMatrix.cc b/liboctave/fMatrix.cc +--- a/liboctave/fMatrix.cc ++++ b/liboctave/fMatrix.cc +@@ -1454,13 +1454,15 @@ + else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) + { + float anorm = -1.0; +- FloatMatrix atmp = *this; +- float *tmp_data = atmp.fortran_vec (); + + if (typ == MatrixType::Hermitian) + { + octave_idx_type info = 0; + char job = 'L'; ++ ++ FloatMatrix atmp = *this; ++ float *tmp_data = atmp.fortran_vec (); ++ + anorm = atmp.abs().sum(). + row(static_cast<octave_idx_type>(0)).max(); + +@@ -1495,6 +1497,9 @@ + { + octave_idx_type info = 0; + ++ FloatMatrix atmp = *this; ++ float *tmp_data = atmp.fortran_vec (); ++ + Array<octave_idx_type> ipvt (dim_vector (nr, 1)); + octave_idx_type *pipvt = ipvt.fortran_vec (); + +@@ -1760,8 +1765,10 @@ + { + info = 0; + char job = 'L'; ++ + FloatMatrix atmp = *this; + float *tmp_data = atmp.fortran_vec (); ++ + anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max(); + + F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr, +@@ -1838,6 +1845,7 @@ + + FloatMatrix atmp = *this; + float *tmp_data = atmp.fortran_vec (); ++ + if(anorm < 0.) + anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max(); + +diff --git a/src/DLD-FUNCTIONS/rcond.cc b/src/DLD-FUNCTIONS/rcond.cc +--- a/src/DLD-FUNCTIONS/rcond.cc ++++ b/src/DLD-FUNCTIONS/rcond.cc +@@ -93,4 +93,12 @@ + %!assert( rcond ([1 1; 2 1]), 1/9) + %!assert( rcond (magic (4)), 0, eps) + ++%!shared x, sx ++%! x = [-5.25, -2.25; -2.25, 1] * eps () + ones (2) / 2; ++%! sx = [-5.25, -2.25; -2.25, 1] * eps ("single") + ones (2) / 2; ++%!assert (rcond (x) < eps ()); ++%!assert (rcond (sx) < eps ('single')); ++%!assert (rcond (x*i) < eps ()); ++%!assert (rcond (sx*i) < eps ('single')); ++ + */ + diff --git a/debian/patches/series b/debian/patches/series index a40c692..5b50072 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -8,3 +8,4 @@ correct_typos use_system_gl2ps drop_version_from_mkoctfile_function_call mkoctfile-mpi.diff +rcond.patch
Attachment:
signature.asc
Description: Digital signature