26 #if ! defined (octave_Sparse_perm_op_defs_h)
27 #define octave_Sparse_perm_op_defs_h 1
29 #include "octave-config.h"
39 template <
typename SM>
51 r.xcidx (j) = a.cidx (j);
61 r.xridx (i) = pcol[a.ridx (i)];
63 sort.
sort (
r.xridx () +
r.xcidx (j), sidx,
r.xcidx (j+1) -
r.xcidx (j));
65 r.xdata (i) = a.data (sidx[ii++]);
71 template <
typename SM>
77 p.
rows (), p.
cols (), a.rows (), a.cols ());
82 template <
typename SM>
93 r.xcidx (prow[j_src]) = a.cidx (j_src+1) - a.cidx (j_src);
109 for (k =
r.xcidx (j); k_src < kend_src; ++k, ++k_src)
111 r.xridx (k) = a.ridx (k_src);
112 r.xdata (k) = a.data (k_src);
115 assert (k_src == nent);
120 template <
typename SM>
133 r.xcidx (j+1) =
r.xcidx (j) + (a.cidx (j_src+1) - a.cidx (j_src));
135 assert (
r.xcidx (nc) == nent);
144 for (k_src = a.cidx (j_src); k_src < kend_src; ++k_src, ++k)
146 r.xridx (k) = a.ridx (k_src);
147 r.xdata (k) = a.data (k_src);
155 template <
typename SM>
161 a.rows (), a.cols (), p.
rows (), p.
cols ());
SM octinternal_do_mul_sm_colpm(const SM &a, const octave_idx_type *pcol)
SM octinternal_do_mul_pm_sm(const PermMatrix &p, const SM &a)
SM octinternal_do_mul_sm_rowpm(const SM &a, const octave_idx_type *prow)
SM octinternal_do_mul_colpm_sm(const octave_idx_type *pcol, const SM &a)
SM octinternal_do_mul_sm_pm(const SM &a, const PermMatrix &p)
const T * data() const
Size of the specified dimension.
octave_idx_type rows() const
octave_idx_type cols() const
const Array< octave_idx_type > & col_perm_vec() const
void sort(T *data, octave_idx_type nel)
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)