Commit 6de61008 authored by Davis King's avatar Davis King

Added some code to avoid a bug in an older LAPACK implementation on Debian Etch.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403898
parent c9f5ba10
......@@ -243,6 +243,18 @@ namespace dlib
if (info != 0)
return info;
// There is a bug in an older version of LAPACK in Debian etch
// that causes the gesdd to return the wrong value for work_size
// when jobz == 'N'. So verify the value of work_size.
if (jobz == 'N')
{
using std::min;
using std::max;
const T min_work_size = 3*min(m,n) + max(max(m,n),7*min(m,n));
if (work_size < min_work_size)
work_size = min_work_size;
}
if (work.size() < work_size)
work.set_size(static_cast<long>(work_size), 1);
......@@ -315,6 +327,19 @@ namespace dlib
if (info != 0)
return info;
// There is a bug in an older version of LAPACK in Debian etch
// that causes the gesdd to return the wrong value for work_size
// when jobz == 'N'. So verify the value of work_size.
if (jobz == 'N')
{
using std::min;
using std::max;
const T min_work_size = 3*min(m,n) + max(max(m,n),7*min(m,n));
if (work_size < min_work_size)
work_size = min_work_size;
}
if (work.size() < work_size)
work.set_size(static_cast<long>(work_size), 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment