mirror of https://github.com/davisking/dlib.git
Minor change to get better cache locality. Gives a nice speedup though.
--HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403797
This commit is contained in:
parent
2bdd9bf2c7
commit
303ee78bdd
|
@ -372,9 +372,12 @@ namespace dlib
|
|||
matrix<column_matrix_type,0,1,mem_manager_type > Vx;
|
||||
if (lambda == 0 || output_looe)
|
||||
{
|
||||
// Save the transpose of V into a temporary because the subsequent matrix
|
||||
// vector multiplies will be faster (because of better cache locality).
|
||||
const general_matrix_type transV(trans(V));
|
||||
Vx.set_size(proj_x.size());
|
||||
for (long i = 0; i < proj_x.size(); ++i)
|
||||
Vx(i) = squared(trans(V)*proj_x(i));
|
||||
Vx(i) = squared(transV*proj_x(i));
|
||||
}
|
||||
|
||||
the_lambda = lambda;
|
||||
|
|
Loading…
Reference in New Issue