Commit 85d75dae authored by Davis King's avatar Davis King

Added missing *= operator

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403906
parent 3124735e
...@@ -1273,6 +1273,15 @@ namespace dlib ...@@ -1273,6 +1273,15 @@ namespace dlib
return *this; return *this;
} }
template <typename EXP>
matrix& operator *= (
const matrix_exp<EXP>& m
)
{
*this = *this * m;
return *this;
}
matrix& operator += ( matrix& operator += (
const matrix& m const matrix& m
) )
......
...@@ -204,6 +204,16 @@ namespace ...@@ -204,6 +204,16 @@ namespace
DLIB_TEST(lr == fliplr(m)); DLIB_TEST(lr == fliplr(m));
DLIB_TEST(ud == flipud(m)); DLIB_TEST(ud == flipud(m));
} }
{
matrix<int> a, b;
a = matrix_cast<int>(round(10*randm(3,3)));
b = a;
b *= b;
DLIB_TEST(b == a*a);
}
} }
......
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