Merge pull request #78 from ernestotapiar/issue_orthogonalize

orthogonalize does not work with fixed-sized matrices
This commit is contained in:
Davis E. King 2016-02-12 15:40:50 -05:00
commit 1af517bcf0
2 changed files with 14 additions and 2 deletions

View File

@ -62,8 +62,9 @@ namespace dlib
const matrix_type get_q (
) const;
template <typename T, long R, long C, typename MM, typename L>
void get_q (
matrix_type& Q
matrix<T,R,C,MM,L>& Q
) const;
template <typename EXP>
@ -270,9 +271,10 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template <typename matrix_exp_type>
template <typename T, long R, long C, typename MM, typename L>
void qr_decomposition<matrix_exp_type>::
get_q(
matrix_type& X
matrix<T,R,C,MM,L>& X
) const
{
#ifdef DLIB_USE_LAPACK

View File

@ -631,6 +631,16 @@ namespace
3,3,3;
DLIB_TEST(upperbound(m,3) == M);
}
{
matrix<double,9,5> A = randm(9,5);
matrix<double> B = A;
orthogonalize(A);
orthogonalize(B);
DLIB_TEST(equal(A,B));
}
}