Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 template<typename T1>
00027 inline
00028 void
00029 op_repmat::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_repmat>& in)
00030 {
00031 arma_extra_debug_sigprint();
00032
00033 typedef typename T1::elem_type eT;
00034
00035 const unwrap_check<T1> tmp(in.m, out);
00036 const Mat<eT>& X = tmp.M;
00037
00038 arma_debug_check( (X.n_elem == 0), "op_repmat::apply(): given object has no elements" );
00039
00040 const u32 copies_per_row = in.aux_u32_a;
00041 const u32 copies_per_col = in.aux_u32_b;
00042
00043 out.set_size(X.n_rows * copies_per_row, X.n_cols * copies_per_col);
00044
00045 for(u32 col = 0; col < out.n_cols; col += X.n_cols)
00046 {
00047 for(u32 row = 0; row < out.n_rows; row += X.n_rows)
00048 {
00049 out.submat(row, col, row+X.n_rows-1, col+X.n_cols-1) = X;
00050 }
00051 }
00052 }
00053
00054
00055
00056