Commit dd08cc4f authored by Davis King's avatar Davis King

Refactored a bunch of the matrix code into a cleaner form. I also added a

cost member to all the matrix expressions so that the complexity of an
expression can be measured and temporaries introduced when appropriate.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402732
parent 14121d95
......@@ -45,7 +45,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template <typename T>
template <typename T, typename helper = void>
struct is_matrix : public default_is_kind_value
{
/*!
......@@ -54,6 +54,9 @@ namespace dlib
- else
- is_matrix<T>::value == false
!*/
// Don't set the helper to anything. Just let it be void.
ASSERT_ARE_SAME_TYPE(helper,void);
};
// ----------------------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -167,6 +167,7 @@ namespace dlib
const static long NR = EXP::NR;
const static long NC = EXP::NC;
typedef matrix<type,NR,NC, mem_manager_type> matrix_type;
const static long cost = EXP::cost;
matrix_exp (
const EXP& exp
......
......@@ -50,6 +50,9 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// TODO
#if 0
template <
typename matrix_dest_type,
typename EXP1,
......@@ -117,6 +120,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
#endif
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -300,7 +300,13 @@ namespace
DLIB_CASSERT((round(m2*m1) == identity_matrix<double,4>()),"");
DLIB_CASSERT((round(tmp(m2*m1)) == identity_matrix<double,4>()),"");
DLIB_CASSERT(round(m2*10000) == round(inv(m1)*10000),"");
DLIB_CASSERT(round(m2*10000) == round(inv(m1)*10000),
round(m2*10000) - round(inv(m1)*10000)
<< "\n\n" << round(m2*10000)
<< "\n\n" << round(inv(m1)*10000)
<< "\n\n" << m2
<< "\n\n" << inv(m1)
);
DLIB_CASSERT(m1 == abs(-1*m1),"");
DLIB_CASSERT(abs(m2) == abs(-1*m2),"");
......
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