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

Function add_to

dlib/svm/sparse_vector.h:643–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641
642 template <typename T, long NR, long NC, typename MM, typename L, typename EXP>
643 inline void add_to (
644 matrix<T,NR,NC,MM,L>& dest,
645 const matrix_exp<EXP>& src
646 )
647 {
648 // make sure requires clause is not broken
649 DLIB_ASSERT(is_vector(dest) && max_index_plus_one(src) <= static_cast<unsigned long>(dest.size()),
650 "\t void add_to(dest,src)"
651 << "\n\t dest must be a vector large enough to hold the src vector."
652 << "\n\t is_vector(dest): " << is_vector(dest)
653 << "\n\t max_index_plus_one(src): " << max_index_plus_one(src)
654 << "\n\t dest.size(): " << dest.size()
655 );
656
657 for (long r = 0; r < src.size(); ++r)
658 dest(r) += src(r);
659 }
660
661 template <typename T, long NR, long NC, typename MM, typename L, typename EXP>
662 inline typename disable_if<is_matrix<EXP> >::type add_to (

Callers 9

operator()Method · 0.85
test_sparseFunction · 0.85
call_oracleMethod · 0.85
do_trainMethod · 0.85
get_riskMethod · 0.85
call_oracleMethod · 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