44 template<
class T,
class S>
64 int arows = (int)_acnt.
size();
65 const T *acnt = &_acnt[0];
66 const T *acol = &_acol[0];
67 const S *aele = &_aele[0];
68 const T *bcnt = &_bcnt[0];
69 const T *bcol = &_bcol[0];
70 const S *bele = &_bele[0];
72 int brows = (int)_bcnt.
size();
80 T *ccnt = _ccnt.
data();
81 T *clst = _clst.
data();
82 T *bdsp = _bdsp.
data();
84 for(
int m = 0, i = 0; i < arows; i++)
86 for(
int j = 0; j < acnt[i]; j++)
90 for(
int k = bdsp[c]; k < bdsp[c] + bcnt[c]; k++)
103 _clst.
assign(
size_t(_csize), -1);
111 T *ccol = _ccol.
data();
112 S *cele = _cele.
data();
113 T *cdsp = _cdsp.
data();
114 for(
int m = 0, i = 0; i < arows; i++)
116 for(
int j = 0; j < acnt[i]; j++)
121 for(
int k = bdsp[c]; k < bdsp[c] + bcnt[c]; k++)
166 int numnodes = a_cnt.
size();
173 multiply(a_cnt, a_con, a_ele, b_cnt, b_con, b_ele, numnodes, c_cnt, c_con, c_ele);
191 if(a_con.
size() == 0)
return;
194 T numnodes = *(std::max_element(a_con.
begin(), a_con.
end())) + 1;
199 for(
size_t i=0, k=0; i < a_cnt.
size(); i++)
200 for(
int j=0; j < a_cnt[i]; j++, k++) b_con[k] = i;
The vector class and related algorithms.
void multiply_connectivities(const vector< T > &a_cnt, const vector< T > &a_con, const vector< T > &b_cnt, const vector< T > &b_con, vector< T > &c_cnt, vector< T > &c_con)
void operator()(const vector< T > &_acnt, const vector< T > &_acol, const vector< S > &_aele, const vector< T > &_bcnt, const vector< T > &_bcol, const vector< S > &_bele, const T _csize, vector< T > &_ccnt, vector< T > &_ccol, vector< S > &_cele)
Execute the matrix multiply-transpose operation.
void count(const vector< T > &data, vector< S > &cnt)
Count number of occurrences of indices.
T * data()
Pointer to the vector's start.
const T * end() const
Pointer to the vector's end.
void transpose_connectivity(const vector< T > &a_cnt, const vector< T > &a_con, vector< T > &b_cnt, vector< T > &b_con)
Transpose CRS matrix graph A into B.
Various sorting algorithms.
size_t size() const
The current size of the vector.
Functor for the sparse matrix multiply-transpose operation.
A vector storing arbitrary data.
const T * begin() const
Pointer to the vector's start.
void assign(InputIterator s, InputIterator e)
Assign a memory range.
void resize(size_t n)
Resize a vector.
void binary_sort_sort(vector< T > &_V, vector< T > &_W)
void dsp_from_cnt(const vector< T > &cnt, vector< T > &dsp)
Compute displacements from counts.