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

Function assign_mat

dlib/matlab/mex_wrapper.cpp:437–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435 typename EXP
436 >
437 typename dlib::enable_if_c<is_matrix<matrix_type>::value && is_same_type<typename inner_type<matrix_type>::type,typename EXP::type>::value >::type
438 assign_mat (
439 const long arg_idx,
440 matrix_type& m,
441 const matrix_exp<EXP>& src
442 )
443 {
444 if (matrix_type::NR != 0 && matrix_type::NR != src.nc())
445 {
446 std::ostringstream sout;
447 sout << "Argument " << arg_idx+1 << " expects a matrix with " << matrix_type::NR << " rows but got one with " << src.nc();
448 throw invalid_args_exception(sout);
449 }
450 if (matrix_type::NC != 0 && matrix_type::NC != src.nr())
451 {
452 std::ostringstream sout;
453 sout << "Argument " << arg_idx+1 << " expects a matrix with " << matrix_type::NC << " columns but got one with " << src.nr();
454 throw invalid_args_exception(sout);
455 }
456
457
458 m = trans(src);
459 }
460
461 template <
462 typename matrix_type,

Callers 1

Calls 5

assign_imageFunction · 0.70
transFunction · 0.50
ncMethod · 0.45
nrMethod · 0.45

Tested by

no test coverage detected