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

Various minor fixes to the LAPACK bindings.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403829
parent 0c06fb57
...@@ -226,7 +226,7 @@ namespace dlib ...@@ -226,7 +226,7 @@ namespace dlib
if (jobz == 'V') if (jobz == 'V')
vs.set_size(n,n); vs.set_size(n,n);
else else
vs.set_size(1,1); vs.set_size(NR4?NR4:1, NC4?NC4:1);
// figure out how big the workspace needs to be. // figure out how big the workspace needs to be.
T work_size = 1; T work_size = 1;
......
...@@ -189,12 +189,12 @@ namespace dlib ...@@ -189,12 +189,12 @@ namespace dlib
if (jobvl == 'V') if (jobvl == 'V')
vl.set_size(n,n); vl.set_size(n,n);
else else
vl.set_size(1,1); vl.set_size(NR4?NR4:1, NC4?NC4:1);
if (jobvr == 'V') if (jobvr == 'V')
vr.set_size(n,n); vr.set_size(n,n);
else else
vr.set_size(1,1); vr.set_size(NR5?NR5:1, NC5?NC5:1);
// figure out how big the workspace needs to be. // figure out how big the workspace needs to be.
......
...@@ -228,8 +228,8 @@ namespace dlib ...@@ -228,8 +228,8 @@ namespace dlib
} }
else else
{ {
u.set_size(1,1); u.set_size(NR3?NR3:1, NC3?NC3:1);
vt.set_size(1,1); vt.set_size(NR4?NR4:1, NC4?NC4:1);
} }
// figure out how big the workspace needs to be. // figure out how big the workspace needs to be.
...@@ -272,8 +272,8 @@ namespace dlib ...@@ -272,8 +272,8 @@ namespace dlib
matrix<integer,0,1,MM,row_major_layout> iwork; matrix<integer,0,1,MM,row_major_layout> iwork;
// Row major order matrices are transposed from LAPACK's point of view. // Row major order matrices are transposed from LAPACK's point of view.
matrix<T,NR3,NC3,MM,row_major_layout>& u = vt_; matrix<T,NR4,NC4,MM,row_major_layout>& u = vt_;
matrix<T,NR4,NC4,MM,row_major_layout>& vt = u_; matrix<T,NR3,NC3,MM,row_major_layout>& vt = u_;
const long m = a.nc(); const long m = a.nc();
...@@ -300,8 +300,8 @@ namespace dlib ...@@ -300,8 +300,8 @@ namespace dlib
} }
else else
{ {
u.set_size(1,1); u.set_size(NR4?NR4:1, NC4?NC4:1);
vt.set_size(1,1); vt.set_size(NR3?NR3:1, NC3?NC3:1);
} }
// figure out how big the workspace needs to be. // figure out how big the workspace needs to be.
......
...@@ -205,14 +205,14 @@ namespace dlib ...@@ -205,14 +205,14 @@ namespace dlib
else if (jobu == 'S') else if (jobu == 'S')
u.set_size(m, std::min(m,n)); u.set_size(m, std::min(m,n));
else else
u.set_size(1,1); u.set_size(NR3?NR3:1, NC3?NC3:1);
if (jobvt == 'A') if (jobvt == 'A')
vt.set_size(n,n); vt.set_size(n,n);
else if (jobvt == 'S') else if (jobvt == 'S')
vt.set_size(std::min(m,n), n); vt.set_size(std::min(m,n), n);
else else
vt.set_size(1,1); vt.set_size(NR4?NR4:1, NC4?NC4:1);
if (jobu == 'O' || jobvt == 'O') if (jobu == 'O' || jobvt == 'O')
...@@ -261,8 +261,8 @@ namespace dlib ...@@ -261,8 +261,8 @@ namespace dlib
matrix<T,0,1,MM,row_major_layout> work; matrix<T,0,1,MM,row_major_layout> work;
// Row major order matrices are transposed from LAPACK's point of view. // Row major order matrices are transposed from LAPACK's point of view.
matrix<T,NR3,NC3,MM,row_major_layout>& u = vt_; matrix<T,NR4,NC4,MM,row_major_layout>& u = vt_;
matrix<T,NR4,NC4,MM,row_major_layout>& vt = u_; matrix<T,NR3,NC3,MM,row_major_layout>& vt = u_;
std::swap(jobu, jobvt); std::swap(jobu, jobvt);
const long m = a.nc(); const long m = a.nc();
...@@ -274,14 +274,14 @@ namespace dlib ...@@ -274,14 +274,14 @@ namespace dlib
else if (jobu == 'S') else if (jobu == 'S')
u.set_size(std::min(m,n), m); u.set_size(std::min(m,n), m);
else else
u.set_size(1,1); u.set_size(NR4?NR4:1, NC4?NC4:1);
if (jobvt == 'A') if (jobvt == 'A')
vt.set_size(n,n); vt.set_size(n,n);
else if (jobvt == 'S') else if (jobvt == 'S')
vt.set_size(n, std::min(m,n)); vt.set_size(n, std::min(m,n));
else else
vt.set_size(1,1); vt.set_size(NR3?NR3:1, NC3?NC3:1);
if (jobu == 'O' || jobvt == 'O') if (jobu == 'O' || jobvt == 'O')
{ {
......
...@@ -197,6 +197,8 @@ namespace dlib ...@@ -197,6 +197,8 @@ namespace dlib
a = trans(a); a = trans(a);
return info;
} }
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
......
...@@ -326,7 +326,7 @@ namespace dlib ...@@ -326,7 +326,7 @@ namespace dlib
} }
else else
{ {
z.set_size(1,1); z.set_size(NR3?NR3:1, NC3?NC3:1);
} }
// figure out how big the workspace needs to be. // figure out how big the workspace needs to be.
...@@ -399,7 +399,7 @@ namespace dlib ...@@ -399,7 +399,7 @@ namespace dlib
} }
else else
{ {
z.set_size(1,1); z.set_size(NR3?NR3:1, NC3?NC3:1);
} }
// figure out how big the workspace needs to be. // figure out how big the workspace needs to be.
......
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