28 typedef typename T1::elem_type eT;
46 for(
uword i=0; i<N; ++i)
48 packet_vec[i].
val = std::rand();
49 packet_vec[i].index = i;
52 std::sort( packet_vec.begin(), packet_vec.end() );
64 for(
uword i=0; i<N; ++i)
66 out.
row(i) = X.
row(packet_vec[i].index);
71 for(
uword i=0; i<N; ++i)
73 out.
col(i) = X.
col(packet_vec[i].index);
85 for(
uword i=0; i<N; ++i)
87 packet_vec[i].val = 0;
92 for(
uword i=0; i<N; ++i)
94 if(packet_vec[i].val == 0)
96 const uword j = packet_vec[i].index;
100 packet_vec[j].val = 1;
106 for(
uword i=0; i<N; ++i)
108 if(packet_vec[i].val == 0)
110 const uword j = packet_vec[i].index;
114 packet_vec[j].val = 1;
132 for(
uword i=0; i<N; ++i)
134 out[i] = X[ packet_vec[i].index ];
146 for(
uword i=0; i<N; ++i)
148 out[i] = X[ packet_vec[i].index ];
165 for(
uword i=0; i<N; ++i)
167 packet_vec[i].val = 0;
174 for(
uword i=0; i<N; ++i)
176 if(packet_vec[i].val == 0)
178 const uword j = packet_vec[i].index;
180 std::swap(out[i], out[j]);
182 packet_vec[j].val = 1;
191 for(
uword i=0; i<N; ++i)
193 if(packet_vec[i].val == 0)
195 const uword j = packet_vec[i].index;
197 std::swap(out[i], out[j]);
199 packet_vec[j].val = 1;
arma_inline arma_warn_unused bool is_vec() const
returns true if the object can be interpreted as a column or row vector
const uword n_cols
number of columns in the matrix (read-only)
arma_inline subview_col< eT > col(const uword col_num)
creation of subview (column vector)
arma_inline subview_row< eT > row(const uword row_num)
creation of subview (row vector)
const uword n_rows
number of rows in the matrix (read-only)
#define arma_extra_debug_print
arma_aligned const T1 & m
storage of reference to the operand (eg. a matrix)
void copy_size(const Mat< eT2 > &m)
change the matrix (without preserving data) to have the same dimensions as the given matrix ...
void swap_cols(const uword in_col1, const uword in_col2)
#define arma_extra_debug_sigprint
arma_inline const Op< T1, op_sort > sort(const Base< typename T1::elem_type, T1 > &X, const uword sort_type=0, const uword dim=0)
static void apply(Mat< typename T1::elem_type > &out, const Op< T1, op_shuffle > &in)
arma_aligned uword aux_uword_a
storage of auxiliary data, uword format
void swap_rows(const uword in_row1, const uword in_row2)
arma_inline arma_warn_unused bool is_empty() const
returns true if the matrix has no elements