Commit 2bbab691 authored by Davis King's avatar Davis King

Changed chol() so it only calls LAPACK if the matrix is big enough

to benefit from LAPACK.
parent 65af5bfb
...@@ -1134,11 +1134,17 @@ convergence: ...@@ -1134,11 +1134,17 @@ convergence:
typename matrix_exp<EXP>::matrix_type L(A.nr(),A.nc()); typename matrix_exp<EXP>::matrix_type L(A.nr(),A.nc());
#ifdef DLIB_USE_LAPACK #ifdef DLIB_USE_LAPACK
// Only call LAPACK if the matrix is big enough. Otherwise,
// our own code is faster, especially for statically dimensioned
// matrices.
if (A.nr() > 4)
{
L = A; L = A;
lapack::potrf('L', L); lapack::potrf('L', L);
// mask out upper triangular area // mask out upper triangular area
return lowerm(L); return lowerm(L);
#else }
#endif
typedef typename EXP::type T; typedef typename EXP::type T;
set_all_elements(L,0); set_all_elements(L,0);
...@@ -1192,7 +1198,6 @@ convergence: ...@@ -1192,7 +1198,6 @@ convergence:
} }
return L; return L;
#endif
} }
......
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