Commit 002683b1 authored by Davis King's avatar Davis King

Changed the default matrix multiplication expression object slightly

to optimize it a little more.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403101
parent 9da5852d
...@@ -216,12 +216,12 @@ namespace dlib ...@@ -216,12 +216,12 @@ namespace dlib
inline const static type eval ( inline const static type eval (
const RHS_& rhs, const RHS_& rhs,
const LHS_& lhs, const LHS_& lhs,
long r, const long r,
long c const long c
) )
{ {
type temp = type(); type temp = lhs(r,0)*rhs(0,c);
for (long i = 0; i < rhs.nr(); ++i) for (long i = 1; i < rhs.nr(); ++i)
{ {
temp += lhs(r,i)*rhs(i,c); temp += lhs(r,i)*rhs(i,c);
} }
...@@ -241,12 +241,12 @@ namespace dlib ...@@ -241,12 +241,12 @@ namespace dlib
inline const static type eval ( inline const static type eval (
const RHS_& rhs, const RHS_& rhs,
const LHS_& lhs, const LHS_& lhs,
long r, const long r,
long c const long c
) )
{ {
type temp = type(); type temp = lhs(r,0)*rhs(0,c);
for (long i = 0; i < lhs.nc(); ++i) for (long i = 1; i < lhs.nc(); ++i)
{ {
temp += lhs(r,i)*rhs(i,c); temp += lhs(r,i)*rhs(i,c);
} }
...@@ -347,8 +347,8 @@ namespace dlib ...@@ -347,8 +347,8 @@ namespace dlib
} }
inline const type operator() ( inline const type operator() (
long r, const long r,
long c const long c
) const ) const
{ {
return matrix_multiply_helper<LHS,RHS>::eval(rhs,lhs,r,c); return matrix_multiply_helper<LHS,RHS>::eval(rhs,lhs,r,c);
......
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