55 commGrid.reset(
new CommGrid(MPI_COMM_WORLD, 0, 0));
60 for(
int i=0; i< rows; ++i)
62 std::fill_n(array[i], cols, value);
66 DenseParMat (
NT ** seqarr, std::shared_ptr<CommGrid> grid,
IT rows,
IT cols): array(seqarr), m(rows), n(cols)
75 array = SpHelper::allocate2D<NT>(m, n);
76 for(int i=0; i< m; ++i)
78 std::copy(array[i], array[i]+n, rhs.array[i]);
81 commGrid.reset(
new CommGrid(*(rhs.commGrid)));
84 DenseParMat< IT,NT > & operator=(
const DenseParMat< IT,NT > & rhs);
86 template <
typename DER>
87 DenseParMat< IT,NT > & operator+=(
const SpParMat< IT,NT,DER > & rhs);
89 template <
typename _BinaryOperation>
90 FullyDistVec< IT,NT > Reduce(
Dim dim, _BinaryOperation __binary_op,
NT identity)
const;
103 MPI_Allreduce(&m, &glrows, 1,
MPIType<IT>(), MPI_SUM, commGrid->GetColWorld());
110 MPI_Allreduce(&n, &glcols, 1,
MPIType<IT>(), MPI_SUM, commGrid->GetRowWorld());
115 std::shared_ptr<CommGrid> commGrid;
119 template <
class IU,
class NU,
class DER>