30#ifndef _FULLY_DIST_VEC_H_
31#define _FULLY_DIST_VEC_H_
46template <
class IT,
class NT>
49template <
class IT,
class NT,
class DER>
55template <
class IU,
class NU>
56class DenseVectorLocalIterator;
60template <
class IT,
class NT>
61class FullyDistVec:
public FullyDist<IT,NT, typename combblas::disable_if< combblas::is_boolean<NT>::value, NT >::type >
67 FullyDistVec ( std::shared_ptr<CommGrid> grid, IT globallen, NT initval);
69 FullyDistVec (
const std::vector<NT> & fillarr, std::shared_ptr<CommGrid> grid );
72 template <
class ITRHS,
class NTRHS>
80 template <
typename c,
typename t>
88 template <
typename c,
typename t>
89 void save(std::basic_ostream<c,t>&
os,
const NT& v,
IT index)
95 template <
class HANDLER>
104 template <
typename _BinaryOperation>
112 template <
class HANDLER>
116 template <
class HANDLER>
121 template <
class ITRHS,
class NTRHS>
129#pragma omp parallel for
131 for(
IT i=0; i < arr.size(); ++i)
152 template <
class NT1,
typename _BinaryOperationIdx,
typename _BinaryOperationVal>
154 template <
class NT1,
typename _BinaryOperationIdx>
170 template <
typename _Predicate>
175 template <
typename _Predicate>
178 template <
typename _Predicate>
181 template <
typename _UnaryOperation>
184 std::transform(arr.begin(), arr.end(), arr.begin(),
__unary_op);
187 template <
typename _BinaryOperation>
192 #pragma omp parallel for
194 for(
size_t i=0; i < arr.size(); ++i)
198 template <
typename _UnaryOperation,
typename IRRELEVANT_NT>
202 template <
typename _BinaryOperation,
typename _BinaryPredicate,
class NT2>
204 template <
typename _BinaryOperation,
typename _BinaryPredicate,
class NT2>
208 template <
typename _BinaryOperation,
typename _BinaryPredicate,
class NT2>
216 template <
typename _BinaryOperation,
typename _BinaryPredicate,
class NT2>
226 template <
typename T1,
typename T2>
235 template <
typename _BinaryOperation,
class NT2>
240 template <
typename _BinaryOperation,
class NT2>
250 std::copy(arr.begin(), arr.end(), std::ostream_iterator<NT> (
output,
" "));
257 std::shared_ptr<CommGrid>
getcommgrid()
const {
return commGrid; }
262 template <
typename _BinaryOperation>
265 template <
typename OUT,
typename _BinaryOperation,
typename _UnaryOperation>
270 template <
typename _BinaryOperation,
typename OUT =
typename std::result_of<_BinaryOperation&(NT,NT)>::type>
277 std::vector< NT > arr;
279 template <
typename _BinaryOperation>
282 template <
class IU,
class NU>
285 template <
class IU,
class NU,
class UDER>
288 template <
class IU,
class NU>
291 template <
class IU,
class NU>
294 template <
class IU,
class NU>
297 template <
typename SR,
typename IU,
typename NUM,
typename NUV,
typename UDER>
301 template <
typename IU,
typename NU1,
typename NU2>
305 template <
typename IU,
typename NU1,
typename NU2,
typename _BinaryOperation>
309 template <
typename RET,
typename IU,
typename NU1,
typename NU2,
typename _BinaryOperation,
typename _BinaryPredicate>
313 template <
typename RET,
typename IU,
typename NU1,
typename NU2,
typename _BinaryOperation,
typename _BinaryPredicate>
317 template <
typename IU>
320 template <
typename IU,
typename NU>
323 template <
typename IU,
typename NU>
326 template <
class IU,
class DER>
void save(std::basic_ostream< c, t > &os, const NT &v, IT index)
NT read(std::basic_istream< c, t > &is, IT index)
bool operator()(const T1 &x, const T2 &y)
FullyDistVec< IT, IT > FindInds(_Predicate pred) const
Return the indices where pred is true.
friend FullyDistSpVec< IU, RET > EWiseApply_threaded(const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, _BinaryOperation _binary_op, _BinaryPredicate _doOp, bool allowVNulls, NU1 Vzero, const bool useExtendedBinOp)
void ParallelRead(const std::string &filename, bool onebased, _BinaryOperation BinOp)
friend FullyDistVec< IU, typename promote_trait< NUM, NUV >::T_promote > SpMV(const SpParMat< IU, NUM, UDER > &A, const FullyDistVec< IU, NUV > &x)
void ParallelWrite(const std::string &filename, bool onebased, bool includeindices=true)
void EWiseApply(const FullyDistSpVec< IT, NT2 > &other, _BinaryOperation __binary_op, bool applyNulls, NT2 nullValue)
std::ifstream & ReadDistribute(std::ifstream &infile, int master, HANDLER handler)
NT Reduce(_BinaryOperation __binary_op, NT identity) const
friend FullyDistSpVec< IU, typename promote_trait< NU1, NU2 >::T_promote > EWiseApply(const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, _BinaryOperation _binary_op, typename promote_trait< NU1, NU2 >::T_promote zero)
FullyDistVec< IT, NT > operator()(const FullyDistVec< IT, IT > &ri) const
void EWiseApply(const FullyDistSpVec< IT, NT2 > &other, _BinaryOperation __binary_op, _BinaryPredicate _do_op, bool applyNulls, NT2 nullValue)
void EWiseApply(const FullyDistVec< IT, NT2 > &other, _BinaryOperation __binary_op, _BinaryPredicate _do_op)
void ParallelWrite(const std::string &filename, bool onebased, HANDLER handler, bool includeindices=true)
FullyDistSpVec< IT, NT > Find(_Predicate pred) const
Return the elements for which pred is true.
bool operator==(const FullyDistVec< IT, NT > &rhs) const
void PrintInfo(std::string vectorname) const
void SaveGathered(std::ofstream &outfile, int master, HANDLER handler, bool printProcSplits=false)
void ApplyInd(_BinaryOperation __binary_op)
FullyDistVec< IT, NT > & operator-=(const FullyDistSpVec< IT, NT > &rhs)
friend SpParMat< IU, bool, DER > PermMat(const FullyDistVec< IU, IU > &ri, const IU ncol)
void SetElement(IT indx, NT numx)
void iota(IT globalsize, NT first)
std::shared_ptr< CommGrid > getcommgrid() const
friend void RenameVertices(DistEdgeList< IU > &DEL)
NT operator[](IT indx) const
void Set(const FullyDistSpVec< IT, NT > &rhs)
friend class FullyDistVec
FullyDistSpVec< IT, NT > GGet(const FullyDistSpVec< IT, NT1 > &spVec, _BinaryOperationIdx __binopIdx, NT nullValue)
IT Count(_Predicate pred) const
Return the number of elements for which pred is true.
FullyDistVec< IT, NT > & operator+=(const FullyDistSpVec< IT, NT > &rhs)
FullyDistVec< IT, NT > & operator=(NT fixedval)
friend FullyDistSpVec< IU, typename promote_trait< NU1, NU2 >::T_promote > EWiseMult(const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, bool exclude, NU2 zero)
void SelectCandidates(double nver)
ABAB: Put concept check, NT should be integer for this to make sense.
friend void Augment(FullyDistVec< int64_t, int64_t > &mateRow2Col, FullyDistVec< int64_t, int64_t > &mateCol2Row, FullyDistVec< int64_t, int64_t > &parentsRow, FullyDistVec< int64_t, int64_t > &leaves)
void Apply(_UnaryOperation __unary_op)
void EWiseOut(const FullyDistVec< IT, NT > &rhs, _BinaryOperation __binary_op, FullyDistVec< IT, OUT > &result)
void EWiseApply(const FullyDistVec< IT, NT2 > &other, _BinaryOperation __binary_op)
friend void maximumMatching(SpParMat< int64_t, bool, SpDCCols< int64_t, bool > > &A, FullyDistVec< int64_t, int64_t > &mateRow2Col, FullyDistVec< int64_t, int64_t > &mateCol2Row)
void PrintToFile(std::string prefix)
void SaveGathered(std::ofstream &outfile, int master)
void SetLocalElement(IT index, NT value)
const NT * GetLocArr() const
void GSet(const FullyDistSpVec< IT, NT1 > &spVec, _BinaryOperationIdx __binopIdx, _BinaryOperationVal __binopVal, MPI_Win win)
std::ifstream & ReadDistribute(std::ifstream &infile, int master)
NT GetElement(IT indx) const
friend FullyDistVec< IU, NU > Concatenate(std::vector< FullyDistVec< IU, NU > > &vecs)
FullyDistVec< IT, NT > & operator=(const FullyDistVec< ITRHS, NTRHS > &rhs)
std::pair< IT, NT > MinElement() const
FullyDistVec< IT, IT > sort()