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