Added a premultiply_projections_by() function to the empirical_kernel_map.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403317
This commit is contained in:
Davis King 2009-12-13 19:24:19 +00:00
parent 5586185562
commit ff0e7f6e03
2 changed files with 31 additions and 0 deletions

View File

@ -164,6 +164,23 @@ namespace dlib
return distance_function<kernel_type>(trans(weights)*vect, dot(vect,vect), kernel, vector_to_matrix(basis));
}
template <typename EXP>
void premultiply_projections_by (
const matrix_exp<EXP>& mat
)
{
// make sure requires clause is not broken
DLIB_ASSERT(out_vector_size() != 0 && mat.nc() == out_vector_size(),
"\t void empirical_kernel_map::premultiply_projections_by()"
<< "\n\t Invalid inputs to this function."
<< "\n\t out_vector_size(): " << out_vector_size()
<< "\n\t mat.nc(): " << mat.nc()
<< "\n\t this: " << this
);
weights = mat*weights;
}
const matrix<scalar_type,0,1,mem_manager_type>& project (
const sample_type& samp
) const

View File

@ -122,6 +122,20 @@ namespace dlib
- returns 0
!*/
template <typename EXP>
void premultiply_projections_by (
const matrix_exp<EXP>& mat
);
/*!
requires
- out_vector_size() != 0
- mat.nc() == out_vector_size()
ensures
- #out_vector_size() == mat.nr()
- TODO explain what this does. introduce functions to get the
weights and basis vectors and relate it to those.
!*/
const matrix<scalar_type,0,1,mem_manager_type>& project (
const sample_type& sample
) const;