107 if( (A_n_cols == 1) || (A_n_rows == 1) )
113 if( (A_n_rows <= 4) && (A_n_rows == A_n_cols) )
119 for(
uword k=0; k < A_n_cols; ++k)
123 const eT* colptr = A.
colptr(k);
125 for(i=0, j=1; j < A_n_rows; i+=2, j+=2)
127 const eT tmp_i = colptr[i];
128 const eT tmp_j = colptr[j];
130 out.
at(k, i) = tmp_i;
131 out.
at(k, j) = tmp_j;
136 out.
at(k, i) = colptr[i];
145 template<
typename eT>
165 const uword N = n_rows;
167 for(
uword k=0; k < N; ++k)
169 eT* colptr = out.
colptr(k);
173 for(i=(k+1), j=(k+2); j < N; i+=2, j+=2)
175 std::swap(out.
at(k,i), colptr[i]);
176 std::swap(out.
at(k,j), colptr[j]);
181 std::swap(out.
at(k,i), colptr[i]);
197 template<
typename T1>
204 typedef typename T1::elem_type eT;
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the matrix
void set_size(const uword in_elem)
change the matrix to have user specified dimensions (data is not preserved)
arma_hot static arma_inline void copy(eT *dest, const eT *src, const uword n_elem)
static void apply(Mat< eT > &out, const Mat< eT > &A)
const uword n_cols
number of columns in the matrix (read-only)
static void apply_noalias_tinysq(Mat< eT > &out, const Mat< eT > &A)
for tiny square matrices (size <= 4x4)
const uword n_elem
number of elements in the matrix (read-only)
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)
arma_inline arma_warn_unused eT * colptr(const uword in_col)
returns a pointer to array of eTs for a specified column; no bounds check
arma_inline arma_warn_unused eT & at(const uword i)
linear element accessor (treats the matrix as a vector); no bounds check.
#define arma_extra_debug_sigprint
arma_aligned const eT *const mem
pointer to the memory used by the matrix (memory is read-only)
static void apply_noalias(Mat< eT > &out, const Mat< eT > &A)
Immediate transpose of a dense matrix.