1 #ifndef arrayndstacker_h 2 #define arrayndstacker_h 26 template <
class fT,
class ArrT >
39 totalnr_ = inp[0]->info().getTotalSz();
47 for (
int iarr=1; iarr<inp_.size(); iarr++ )
52 if ( inp_[iarr]->info().getTotalSz() > totalnr_ )
53 totalnr_ = inp_[iarr]->info().getTotalSz();
56 out_.setSize( totalnr_ );
57 if ( !
out_.getData() )
59 msg_ =
"Cannot stack this type of object";
69 fT* outarr =
out_.getData();
71 for (
od_int64 idx=start; idx<=stop; idx++ )
73 fT& outval = outarr[idx];
74 for (
int iarr=0; iarr<inp_.size(); iarr++ )
76 if ( !inp_[iarr] )
continue;
77 const fT* inparr = inp_[iarr]->getData();
79 idx >= inp_[iarr]->info().getTotalSz() )
82 const fT val = inparr[idx];
90 if ( normalize_ && count )
98 void doNormalize(
bool normalize ) { normalize_ = normalize; }
99 const char*
errMsg()
const {
return msg_.str(); }
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:287
Array1DStacker(const ObjectSet< ArrT > &inp, ArrT &out)
Definition: arrayndstacker.h:31
OD::String that holds an existing text string.
Definition: fixedstring.h:29
#define od_int64
Definition: plftypes.h:36
FixedString msg_
Definition: arrayndstacker.h:107
void doNormalize(bool normalize)
Definition: arrayndstacker.h:98
bool isEmpty() const
Definition: odset.h:45
bool normalize_
Definition: arrayndstacker.h:106
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
od_int64 nrIterations() const
Definition: arrayndstacker.h:97
const char * errMsg() const
Definition: arrayndstacker.h:99
bool doWork(od_int64 start, od_int64 stop, int threadidx)
Definition: arrayndstacker.h:67
out_[idx]
Definition: arrayndalgo.h:1702
bool doPrepare(int nrthreads)
Definition: arrayndstacker.h:42
ArrT & out_
Definition: arrayndstacker.h:105
Gently stacks ArrayND by summation along the secondary axis Currently implemented only 1D...
Definition: arrayndstacker.h:27
const ObjectSet< ArrT > & inp_
Definition: arrayndstacker.h:104
#define mClass(module)
Definition: commondefs.h:164
od_int64 totalnr_
Definition: arrayndstacker.h:103