29 #ifndef _FULLY_DIST_VEC_H_
30 #define _FULLY_DIST_VEC_H_
42 template <
class IT,
class NT>
45 template <
class IT,
class NT,
class DER>
51 template <
class IU,
class NU>
56 template <
class IT,
class NT>
57 class FullyDistVec:
public FullyDist<IT,NT, typename CombBLAS::disable_if< CombBLAS::is_boolean<NT>::value, NT >::type >
63 FullyDistVec ( shared_ptr<CommGrid> grid, IT globallen, NT initval);
66 template <
class ITRHS,
class NTRHS>
72 NT
getNoNum(IT index) {
return static_cast<NT
>(1); }
74 template <
typename c,
typename t>
75 NT
read(std::basic_istream<c,t>& is, IT index)
82 template <
typename c,
typename t>
83 void save(std::basic_ostream<c,t>& os,
const NT& v, IT index)
89 template <
class HANDLER>
90 ifstream&
ReadDistribute (ifstream& infile,
int master, HANDLER handler);
93 template <
class HANDLER>
94 void SaveGathered(ofstream& outfile,
int master, HANDLER handler,
bool printProcSplits =
false);
98 template <
class ITRHS,
class NTRHS>
122 void iota(IT globalsize, NT first);
132 template <
typename _Predicate>
135 template <
typename _Predicate>
138 template <
typename _Predicate>
139 IT
Count(_Predicate pred)
const;
141 template <
typename _UnaryOperation>
142 void Apply(_UnaryOperation __unary_op)
144 transform(arr.begin(), arr.end(), arr.begin(), __unary_op);
147 template <
typename _BinaryOperation>
150 IT offset = LengthUntil();
152 #pragma omp parallel for
154 for(IT i=0; (unsigned)i < arr.size(); ++i)
155 arr[i] = __binary_op(arr[i], i + offset);
158 template <
typename _UnaryOperation,
typename IRRELEVANT_NT>
162 template <
typename _BinaryOperation,
typename _BinaryPredicate,
class NT2>
164 template <
typename _BinaryOperation,
typename _BinaryPredicate,
class NT2>
165 void EWiseApply(
const FullyDistSpVec<IT,NT2> & other, _BinaryOperation __binary_op, _BinaryPredicate _do_op,
bool applyNulls, NT2 nullValue,
const bool useExtendedBinOp);
168 template <
typename _BinaryOperation,
typename _BinaryPredicate,
class NT2>
176 template <
typename _BinaryOperation,
typename _BinaryPredicate,
class NT2>
182 applyNulls, nullValue,
true);
186 template <
typename T1,
typename T2>
195 template <
typename _BinaryOperation,
class NT2>
200 template <
typename _BinaryOperation,
class NT2>
209 commGrid->OpenDebugFile(prefix, output);
210 copy(arr.begin(), arr.end(), ostream_iterator<NT> (output,
" "));
219 template <
typename _BinaryOperation>
222 template <
typename OUT,
typename _BinaryOperation,
typename _UnaryOperation>
223 OUT
Reduce(_BinaryOperation __binary_op, OUT default_val, _UnaryOperation __unary_op);
233 template <
typename _BinaryOperation>
236 template <
class IU,
class NU>
239 template <
class IU,
class NU,
class UDER>
242 template <
class IU,
class NU>
245 template <
class IU,
class NU>
248 template <
class IU,
class NU>
251 template <
typename SR,
typename IU,
typename NUM,
typename NUV,
typename UDER>
255 template <
typename IU,
typename NU1,
typename NU2>
259 template <
typename IU,
typename NU1,
typename NU2,
typename _BinaryOperation>
263 template <
typename RET,
typename IU,
typename NU1,
typename NU2,
typename _BinaryOperation,
typename _BinaryPredicate>
267 template <
typename IU>
270 template <
typename IU,
typename NU>