23 #if ! defined (octave_Sparse_perm_op_defs_h)
24 #define octave_Sparse_perm_op_defs_h 1
26 #include "octave-config.h"
30 template <
typename SM>
42 r.
xcidx (j) = a.cidx (j);
52 r.xridx (
i) = pcol[a.ridx (
i)];
54 sort.
sort (r.xridx () + r.xcidx (j), sidx, r.xcidx (j+1) - r.xcidx (j));
56 r.xdata (
i) = a.data (sidx[ii++]);
62 template <
typename SM>
68 p.
rows (), p.
cols (), a.rows (), a.cols ());
73 template <
typename SM>
84 r.xcidx (prow[j_src]) = a.cidx (j_src+1) - a.cidx (j_src);
100 for (k = r.xcidx (j); k_src < kend_src; ++
k, ++k_src)
102 r.xridx (k) = a.ridx (k_src);
103 r.xdata (k) = a.data (k_src);
106 assert (k_src == nent);
111 template <
typename SM>
124 r.xcidx (j+1) = r.xcidx (j) + (a.cidx (j_src+1) - a.cidx (j_src));
126 assert (r.xcidx (nc) == nent);
135 for (k_src = a.cidx (j_src); k_src < kend_src; ++k_src, ++
k)
137 r.xridx (k) = a.ridx (k_src);
138 r.xdata (k) = a.data (k_src);
146 template <
typename SM>
152 a.rows (), a.cols (), p.
rows (), p.
cols ());
octave_idx_type rows(void) const
SM octinternal_do_mul_colpm_sm(const octave_idx_type *pcol, const SM &a)
octave_idx_type cols(void) const
SM octinternal_do_mul_pm_sm(const PermMatrix &p, const SM &a)
octave_idx_type * xcidx(void)
SM octinternal_do_mul_sm_pm(const SM &a, const PermMatrix &p)
SM octinternal_do_mul_sm_colpm(const SM &a, const octave_idx_type *pcol)
SM octinternal_do_mul_sm_rowpm(const SM &a, const octave_idx_type *prow)
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
const Array< octave_idx_type > & col_perm_vec(void) const
Sparse< bool > sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
const T * data(void) const
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
void sort(T *data, octave_idx_type nel)
=val(i)}if ode{val(i)}occurs in table i
#define OCTAVE_LOCAL_BUFFER(T, buf, size)