13 template <
class IT,
class NT,
class DER>
37 template <
class IT,
class NT>
43 SpParVec ( shared_ptr<CommGrid> grid);
44 SpParVec ( shared_ptr<CommGrid> grid, IT loclength);
56 CVT.ind = vector<IT>(ind.begin(), ind.end());
57 CVT.num = vector<NNT>(num.begin(), num.end());
62 void iota(IT size, NT first);
79 IT locnnz = ind.size();
80 MPI_Allreduce( &locnnz, & totnnz, 1, MPIType<IT>(), MPI_SUM, commGrid->GetWorld());
90 MPI_Comm DiagWorld = commGrid->GetDiagWorld();
91 if(DiagWorld != MPI_COMM_NULL)
94 MPI_Comm_rank(DiagWorld,&rank);
97 IT offset =
static_cast<IT
>(rank) * n_perproc;
99 transform(ind.begin(), ind.end(), num.begin(), bind2nd(plus<IT>(), offset));
103 template <
typename _UnaryOperation>
104 void Apply(_UnaryOperation __unary_op)
106 transform(num.begin(), num.end(), num.begin(), __unary_op);
109 template <
typename _BinaryOperation>
110 NT
Reduce(_BinaryOperation __binary_op, NT init);
116 shared_ptr<CommGrid> commGrid;
122 template <
class IU,
class NU>
125 template <
class IU,
class NU>
128 template <
class IU,
class NU,
class UDER>
131 template <
typename SR,
typename IU,
typename NUM,
typename NUV,
typename UDER>
135 template <
typename IU,
typename NU1,
typename NU2>
139 template <
typename IU>
142 template <
typename IU>