Commit d2d2c291 authored by Davis King's avatar Davis King

Renamed sparse_vector::dot_product() to sparse_vector::dot() so that both

dense and sparse vectors have a global function with the same name (i.e. dot()).

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403531
parent 03dbbddc
......@@ -746,7 +746,7 @@ namespace dlib
const sample_type& x
) const
{
return alpha*sparse_vector::dot_product(w,x);
return alpha*sparse_vector::dot(w,x);
}
scalar_type inner_product (
......@@ -760,7 +760,7 @@ namespace dlib
<< "\n\tthis: " << this
);
return alpha*x.alpha*sparse_vector::dot_product(w,x.w);
return alpha*x.alpha*sparse_vector::dot(w,x.w);
}
scalar_type squared_norm (
......@@ -1039,7 +1039,7 @@ namespace dlib
) const
{
if (samples_seen > 0)
return alpha*(sparse_vector::dot_product(w,x) + w_extra*x_extra);
return alpha*(sparse_vector::dot(w,x) + w_extra*x_extra);
else
return 0;
}
......@@ -1056,7 +1056,7 @@ namespace dlib
);
if (samples_seen > 0 && x.samples_seen > 0)
return alpha*x.alpha*(sparse_vector::dot_product(w,x.w) + w_extra*x.w_extra);
return alpha*x.alpha*(sparse_vector::dot(w,x.w) + w_extra*x.w_extra);
else
return 0;
}
......
......@@ -123,7 +123,7 @@ namespace dlib
const sample_type& b
) const
{
return std::pow(gamma*(sparse_vector::dot_product(a,b)) + coef, degree);
return std::pow(gamma*(sparse_vector::dot(a,b)) + coef, degree);
}
sparse_polynomial_kernel& operator= (
......@@ -211,7 +211,7 @@ namespace dlib
const sample_type& b
) const
{
return std::tanh(gamma*(sparse_vector::dot_product(a,b)) + coef);
return std::tanh(gamma*(sparse_vector::dot(a,b)) + coef);
}
sparse_sigmoid_kernel& operator= (
......@@ -284,7 +284,7 @@ namespace dlib
const sample_type& b
) const
{
return sparse_vector::dot_product(a,b);
return sparse_vector::dot(a,b);
}
bool operator== (
......
......@@ -196,7 +196,7 @@ namespace dlib
// ------------------------------------------------------------------------------------
template <typename T, typename U>
typename T::value_type::second_type dot_product (
typename T::value_type::second_type dot (
const T& a,
const U& b
)
......
......@@ -125,7 +125,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template <typename T, typename U>
typename T::value_type::second_type dot_product (
typename T::value_type::second_type dot (
const T& a,
const U& b
);
......
......@@ -42,7 +42,8 @@ namespace
const sample_type& b
) const
{
return sparse_vector::dot_product(a,b);
using namespace sparse_vector;
return dot(a,b);
}
bool operator== (
......
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