Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
2bbab691
Commit
2bbab691
authored
Oct 01, 2011
by
Davis King
Browse files
Changed chol() so it only calls LAPACK if the matrix is big enough
to benefit from LAPACK.
parent
65af5bfb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
dlib/matrix/matrix_la.h
dlib/matrix/matrix_la.h
+11
-6
No files found.
dlib/matrix/matrix_la.h
View file @
2bbab691
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment