Commit fda8545b authored by Davis King's avatar Davis King

Minor change to avoid a warning from gcc.

parent 891dd2fb
...@@ -173,8 +173,11 @@ namespace dlib ...@@ -173,8 +173,11 @@ namespace dlib
{ {
using dlib::sparse_vector::dot; using dlib::sparse_vector::dot;
using dlib::dot; using dlib::dot;
// The reason for using w_size_m1 and not just w.size()-1 is because
// doing it this way avoids an inane warning from gcc that can occur in some cases.
const long w_size_m1 = w.size()-1;
for (long i = 0; i < samples.size(); ++i) for (long i = 0; i < samples.size(); ++i)
dot_prods[i] = dot(colm(w,0,w.size()-1), samples(i)) - w(w.size()-1); dot_prods[i] = dot(colm(w,0,w_size_m1), samples(i)) - w(w_size_m1);
if (is_first_call) if (is_first_call)
{ {
......
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