MCPcopy Create free account
hub / github.com/davisking/dlib / subtract_from

Function subtract_from

dlib/svm/sparse_vector.h:692–708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690
691 template <typename T, long NR, long NC, typename MM, typename L, typename EXP>
692 inline void subtract_from (
693 matrix<T,NR,NC,MM,L>& dest,
694 const matrix_exp<EXP>& src
695 )
696 {
697 // make sure requires clause is not broken
698 DLIB_ASSERT(is_vector(dest) && max_index_plus_one(src) <= static_cast<unsigned long>(dest.size()),
699 "\t void subtract_from(dest,src)"
700 << "\n\t dest must be a vector large enough to hold the src vector."
701 << "\n\t is_vector(dest): " << is_vector(dest)
702 << "\n\t max_index_plus_one(src): " << max_index_plus_one(src)
703 << "\n\t dest.size(): " << dest.size()
704 );
705
706 for (long r = 0; r < src.size(); ++r)
707 dest(r) -= src(r);
708 }
709
710 template <typename T, long NR, long NC, typename MM, typename L, typename EXP>
711 inline typename disable_if<is_matrix<EXP> >::type subtract_from (

Callers 6

test_sparseFunction · 0.85
threadMethod · 0.85
get_riskMethod · 0.85
get_riskMethod · 0.85
get_riskMethod · 0.85
get_riskMethod · 0.85

Calls 5

max_index_plus_oneFunction · 0.70
is_vectorFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

test_sparseFunction · 0.68