Commit 5165cb52 authored by Davis King's avatar Davis King

Tweaked a few things.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402785
parent a8cd8389
......@@ -28,7 +28,7 @@ namespace dlib
struct is_small_matrix { static const bool value = false; };
template < typename EXP >
struct is_small_matrix<EXP, typename enable_if_c<EXP::NR>=1 && EXP::NC>=1 &&
EXP::NR<=30 && EXP::NC<=30 && (EXP::cost <= 70)>::type> { static const bool value = true; };
EXP::NR<=17 && EXP::NC<=17 && (EXP::cost <= 70)>::type> { static const bool value = true; };
}
// ----------------------------------------------------------------------------------------
......
......@@ -58,19 +58,7 @@ namespace dlib
const EXP2& rhs
)
{
// This loop is optimized assuming that the data is laid out in
// row major order in memory.
for (long r = 0; r< lhs.nr(); ++r)
{
for (long c = 0; c< lhs.nc(); ++c)
{
const typename EXP2::type temp = lhs(r,c);
for (long i = 0; i < rhs.nc(); ++i)
{
dest(r,i) += rhs(c,i)*temp;
}
}
}
matrix_assign_default(dest, lhs*rhs, 1, true);
}
// ------------------------------------------------------------------------------------
......@@ -92,19 +80,7 @@ namespace dlib
// if the matrices are small enough then just use the simple multiply algorithm
if (lhs.nc() <= 2 || rhs.nc() <= 2 || lhs.nr() <= 2 || rhs.nr() <= 2 || (lhs.size() <= bs*10 && rhs.size() <= bs*10) )
{
// This loop is optimized assuming that the data is laid out in
// row major order in memory.
for (long r = 0; r< lhs.nr(); ++r)
{
for (long c = 0; c< lhs.nc(); ++c)
{
const typename EXP2::type temp = lhs(r,c);
for (long i = 0; i < rhs.nc(); ++i)
{
dest(r,i) += rhs(c,i)*temp;
}
}
}
matrix_assign_default(dest, lhs*rhs, 1, true);
}
else
{
......
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