28 #define mComputeTrendAandB( sz ) { \ 29 aval = mCast(T,( (fT)sz * crosssum - sum * sumindexes ) / \ 30 ( (fT)sz * sumsqidx - sumindexes * sumindexes ) );\ 31 bval = mCast(T,( sum * sumsqidx - sumindexes * crosssum ) / \ 32 ( (fT)sz * sumsqidx - sumindexes * sumindexes ) ); } 37 template <
class T,
class fT>
41 if ( out && in_.
info() != out_.
info() )
54 const T* inpptr = in_.
getData();
57 if ( inpptr && outptr )
60 for (
int idx=0; idx<sz; idx++ )
62 const T value = inpptr[idx];
71 const fT fidx =
mCast(fT,idx);
73 sumsqidx += fidx * fidx;
74 crosssum += inpptr[idx] * fidx;
83 avg = sum / (fT)count;
85 for (
int idx=0; idx<sz; idx++ )
87 const T value = inpptr[idx];
89 : (trend ? value - (aval*(fT)idx+bval)
96 int index = 0, count = 0;
100 const T value = in_.
getND( iter.getPos() );
111 sumsqidx += index * index;
112 crosssum += value * (fT)index;
113 }
while ( iter.next() );
122 avg = sum / (fT)count;
129 : (trend ? inpval - avg-(aval*(fT)index+bval)
131 out_.
setND(iter.getPos(), outval );
133 }
while ( iter.next() );
142 template <
class T,
class fT>
145 return removeLinPart<T,fT>( inout, 0, false );
150 template <
class T,
class fT>
153 return removeLinPart<T,fT>( in, &out, false );
158 template <
class T,
class fT>
161 return removeLinPart<T,fT>( inout, 0, true );
166 template <
class T,
class fT>
169 return removeLinPart<T,fT>( in, &out, true );
183 T sum = 0;
int count = 0;
184 for (
int idx=0; idx<sz; idx++ )
186 const T val = in.get( idx );
188 { sum += val; count++; }
206 if ( sz < 1 || !data )
210 for (
int idx=0; idx<sz; idx++ )
212 const T val = data[idx];
213 if ( !
mIsUdf(val) && val > maxval )
229 if ( sz < 1 || !data )
233 for (
int idx=0; idx<sz; idx++ )
235 const T val = data[idx];
236 if ( !
mIsUdf(val) && val < minval )
250 for (
int idx=0; idx<sz; idx++ )
252 const fT val = in.
get( idx );
281 for (
int idx=0; idx<sz; idx++ )
283 const fT val = in.
get( idx );
288 for (
int idx=0; idx<sz; idx++ )
290 const fT val = in.
get( idx );
320 float paramval=
mUdf(
float));
323 bool isOK()
const {
return window_; }
328 void setValue(
int idx,
float val) { window_[idx]=val; }
330 bool setType(
const char*,
float paramval=
mUdf(
float));
340 if ( in->
info() != size_ )
return false;
342 const od_int64 totalsz = size_.getTotalSz();
346 if ( indata && outdata )
348 for (
unsigned long idx = 0; idx<totalsz; idx++ )
350 Type inval = indata[idx];
351 outdata[idx] =
mIsUdf( inval ) ? inval : inval * window_[idx];
359 if ( instorage && outstorage )
361 for (
unsigned long idx = 0; idx < totalsz; idx++ )
365 mIsUdf( inval ) ? inval : inval * window_[idx] );
376 mIsUdf( inval ) ? inval : inval * window_[idx] );
379 }
while ( iter.
next() );
395 bool buildWindow(
const char* winnm,
float pval);
401 float p0,
float p1,
float p2,
402 bool posperiodic =
false )
406 float dist0 = p0 - intpos0;
407 int prevpos0 = intpos0;
416 float dist1 = p1 - intpos1;
417 int prevpos1 = intpos1;
426 float dist2 = p2 - intpos2;
427 int prevpos2 = intpos2;
436 if ( !posperiodic && ( prevpos0 < 0 || prevpos0 > size.
getSize(0) -2 ||
437 prevpos1 < 0 || prevpos1 > size.
getSize(1) -2 ||
438 prevpos2 < 0 || prevpos2 > size.
getSize(2) -2 ))
441 if ( !posperiodic && ( !prevpos0 || prevpos0 > size.
getSize(0) -3 ||
442 !prevpos1 || prevpos1 > size.
getSize(1) -3 ||
443 !prevpos2 || prevpos2 > size.
getSize(2) -3 ))
445 return linearInterpolate3D(
446 array.
get( prevpos0 , prevpos1 , prevpos2 ),
447 array.
get( prevpos0 , prevpos1 , prevpos2+1),
448 array.
get( prevpos0 , prevpos1+1, prevpos2 ),
449 array.
get( prevpos0 , prevpos1+1, prevpos2+1),
450 array.
get( prevpos0+1, prevpos1 , prevpos2 ),
451 array.
get( prevpos0+1, prevpos1 , prevpos2+1),
452 array.
get( prevpos0+1, prevpos1+1, prevpos2 ),
453 array.
get( prevpos0+1, prevpos1+1, prevpos2+1),
454 dist0, dist1, dist2 );
457 int firstpos0 = prevpos0 - 1;
458 int nextpos0 = prevpos0 + 1;
459 int lastpos0 = prevpos0 + 2;
465 int firstpos1 = prevpos1 - 1;
466 int nextpos1 = prevpos1 + 1;
467 int lastpos1 = prevpos1 + 2;
473 int firstpos2 = prevpos2 - 1;
474 int nextpos2 = prevpos2 + 1;
475 int lastpos2 = prevpos2 + 2;
481 return polyInterpolate3D (
482 array.
get( firstpos0 , firstpos1 , firstpos2 ),
483 array.
get( firstpos0 , firstpos1 , prevpos2 ),
484 array.
get( firstpos0 , firstpos1 , nextpos2 ),
485 array.
get( firstpos0 , firstpos1 , lastpos2 ),
487 array.
get( firstpos0 , prevpos1 , firstpos2 ),
488 array.
get( firstpos0 , prevpos1 , prevpos2 ),
489 array.
get( firstpos0 , prevpos1 , nextpos2 ),
490 array.
get( firstpos0 , prevpos1 , lastpos2 ),
492 array.
get( firstpos0 , nextpos1 , firstpos2 ),
493 array.
get( firstpos0 , nextpos1 , prevpos2 ),
494 array.
get( firstpos0 , nextpos1 , nextpos2 ),
495 array.
get( firstpos0 , nextpos1 , lastpos2 ),
497 array.
get( firstpos0 , lastpos1 , firstpos2 ),
498 array.
get( firstpos0 , lastpos1 , prevpos2 ),
499 array.
get( firstpos0 , lastpos1 , nextpos2 ),
500 array.
get( firstpos0 , lastpos1 , lastpos2 ),
503 array.
get( prevpos0 , firstpos1 , firstpos2 ),
504 array.
get( prevpos0 , firstpos1 , prevpos2 ),
505 array.
get( prevpos0 , firstpos1 , nextpos2 ),
506 array.
get( prevpos0 , firstpos1 , lastpos2 ),
508 array.
get( prevpos0 , prevpos1 , firstpos2 ),
509 array.
get( prevpos0 , prevpos1 , prevpos2 ),
510 array.
get( prevpos0 , prevpos1 , nextpos2 ),
511 array.
get( prevpos0 , prevpos1 , lastpos2 ),
513 array.
get( prevpos0 , nextpos1 , firstpos2 ),
514 array.
get( prevpos0 , nextpos1 , prevpos2 ),
515 array.
get( prevpos0 , nextpos1 , nextpos2 ),
516 array.
get( prevpos0 , nextpos1 , lastpos2 ),
518 array.
get( prevpos0 , lastpos1 , firstpos2 ),
519 array.
get( prevpos0 , lastpos1 , prevpos2 ),
520 array.
get( prevpos0 , lastpos1 , nextpos2 ),
521 array.
get( prevpos0 , lastpos1 , lastpos2 ),
524 array.
get( nextpos0 , firstpos1 , firstpos2 ),
525 array.
get( nextpos0 , firstpos1 , prevpos2 ),
526 array.
get( nextpos0 , firstpos1 , nextpos2 ),
527 array.
get( nextpos0 , firstpos1 , lastpos2 ),
529 array.
get( nextpos0 , prevpos1 , firstpos2 ),
530 array.
get( nextpos0 , prevpos1 , prevpos2 ),
531 array.
get( nextpos0 , prevpos1 , nextpos2 ),
532 array.
get( nextpos0 , prevpos1 , lastpos2 ),
534 array.
get( nextpos0 , nextpos1 , firstpos2 ),
535 array.
get( nextpos0 , nextpos1 , prevpos2 ),
536 array.
get( nextpos0 , nextpos1 , nextpos2 ),
537 array.
get( nextpos0 , nextpos1 , lastpos2 ),
539 array.
get( nextpos0 , lastpos1 , firstpos2 ),
540 array.
get( nextpos0 , lastpos1 , prevpos2 ),
541 array.
get( nextpos0 , lastpos1 , nextpos2 ),
542 array.
get( nextpos0 , lastpos1 , lastpos2 ),
545 array.
get( lastpos0 , firstpos1 , firstpos2 ),
546 array.
get( lastpos0 , firstpos1 , prevpos2 ),
547 array.
get( lastpos0 , firstpos1 , nextpos2 ),
548 array.
get( lastpos0 , firstpos1 , lastpos2 ),
550 array.
get( lastpos0 , prevpos1 , firstpos2 ),
551 array.
get( lastpos0 , prevpos1 , prevpos2 ),
552 array.
get( lastpos0 , prevpos1 , nextpos2 ),
553 array.
get( lastpos0 , prevpos1 , lastpos2 ),
555 array.
get( lastpos0 , nextpos1 , firstpos2 ),
556 array.
get( lastpos0 , nextpos1 , prevpos2 ),
557 array.
get( lastpos0 , nextpos1 , nextpos2 ),
558 array.
get( lastpos0 , nextpos1 , lastpos2 ),
560 array.
get( lastpos0 , lastpos1 , firstpos2 ),
561 array.
get( lastpos0 , lastpos1 , prevpos2 ),
562 array.
get( lastpos0 , lastpos1 , nextpos2 ),
563 array.
get( lastpos0 , lastpos1 , lastpos2 ),
564 dist0, dist1, dist2 );
575 const int ndim = destsz.
getNDim();
576 if ( ndim != srcsz.
getNDim() || ndim != copypos.
size() )
return false;
578 for (
int idx=0; idx<ndim; idx++ )
590 for (
int idx=0; idx<ndim; idx++ )
592 srcposition[idx] = copypos[idx] + destposition[idx];
598 dest.
setND( destposition.
getPos(), src.get( &srcposition[0] ));
601 }
while ( destposition.
next() );
609 int p0,
int p1,
int p2,
bool srcperiodic=
false )
614 const int destsz0 = destsz.
getSize(0);
615 const int destsz1 = destsz.
getSize(1);
616 const int destsz2 = destsz.
getSize(2);
618 const int srcsz0 = srcsz.
getSize(0);
619 const int srcsz1 = srcsz.
getSize(1);
620 const int srcsz2 = srcsz.
getSize(2);
624 if ( p0 + destsz0 > srcsz0 ||
625 p1 + destsz1 > srcsz1 ||
626 p2 + destsz2 > srcsz2 )
633 for (
int id0=0; id0<destsz0; id0++ )
635 for (
int id1=0; id1<destsz1; id1++ )
637 for (
int id2=0; id2<destsz2; id2++ )
654 bool destperiodic=
false )
659 const int ndim = destsz.
getNDim();
660 if ( ndim != srcsz.
getNDim() || ndim != pastepos.
size() )
return false;
662 for (
int idx=0; idx<ndim; idx++ )
664 if ( !destperiodic &&
677 for (
int idx=0; idx<ndim; idx++ )
679 destposition[idx] = pastepos[idx] + srcposition[idx];
685 dest( destposition ) = ptr[ptrpos++];
687 }
while ( srcposition.
next() );
695 int p0,
int p1,
bool destperiodic=
false )
700 const int srcsz0 = srcsz.
getSize(0);
701 const int srcsz1 = srcsz.
getSize(1);
703 const int destsz0 = destsz.
getSize(0);
704 const int destsz1 = destsz.
getSize(1);
708 if ( p0 + srcsz0 > destsz0 ||
709 p1 + srcsz1 > destsz1 )
717 for (
int id0=0; id0<srcsz0; id0++ )
719 for (
int id1=0; id1<srcsz1; id1++ )
733 int p0,
int p1,
int p2,
734 bool destperiodic=
false )
739 const int srcsz0 = srcsz.
getSize(0);
740 const int srcsz1 = srcsz.
getSize(1);
741 const int srcsz2 = srcsz.
getSize(2);
743 const int destsz0 = destsz.
getSize(0);
744 const int destsz1 = destsz.
getSize(1);
745 const int destsz2 = destsz.
getSize(2);
749 if ( p0 + srcsz0 > destsz0 ||
750 p1 + srcsz1 > destsz1 ||
751 p2 + srcsz2 > destsz2 )
759 for (
int id0=0; id0<srcsz0; id0++ )
761 for (
int id1=0; id1<srcsz1; id1++ )
763 for (
int id2=0; id2<srcsz2; id2++ )
812 return canCopyAll() ? 0 : commontks_.nrLines();
819 return tksout_ == tksin_ && in_.getData() &&
820 (
out_.getData() ||
out_.getStorage() );
825 if ( in_.info().getSize(0) != tksin_.nrLines() ||
826 in_.info().getSize(1) != tksin_.nrTrcs() )
831 if (
out_.info().getSize(0) != tksout_.nrLines() ||
832 out_.info().getSize(1) != tksout_.nrTrcs() )
835 if ( !outimpl || !outimpl->setSize( tksout_.nrLines(),
846 if (
out_.getData() )
847 in_.getAll(
out_.getData() );
848 else if (
out_.getStorage() )
849 in_.getAll( *
out_.getStorage() );
861 const bool usearrayptrs = in_.getData() &&
out_.getData() &&
868 const int nrcrl = tks.
nrTrcs();
869 const od_int64 nrbytes = nrcrl *
sizeof(T);
872 const int startcrlidyin = tksin.
trcIdx( startcrl );
873 const int startcrlidyout = tksout.
trcIdx( startcrl );
874 for (
int idx=
mCast(
int,start); idx<=
mCast(
int,stop); idx++)
877 const int inlidxin = tksin.
lineIdx( inl );
878 const int inlidxout = tksout.
lineIdx( inl );
882 in_.info().getOffset(inlidxin,startcrlidyin) );
884 out_.info().getOffset(inlidxout,startcrlidyout) );
891 for (
int idy=0; idy<nrcrl; idy++ )
894 in_.get( inlidxin, startcrlidyin+idy );
895 out_.set( inlidxout, startcrlidyout+idy, val );
923 : ParallelTask(
"Array 3D Resizer")
942 const Array3DInfoImpl infoin( tkzsin_.hsamp_.nrLines(), \ 943 tkzsin_.hsamp_.nrTrcs(), tkzsin_.nrZ() ); \ 944 const Array3DInfoImpl infoout( tkzsout_.hsamp_.nrLines(), \ 945 tkzsout_.hsamp_.nrTrcs(), tkzsout_.nrZ() ); 950 if ( in_.info() != infoin )
953 if (
out_.info() != infoout && !
out_.setInfo(infoout) )
956 if ( tkzsin_.hsamp_.survid_ != tkzsout_.hsamp_.survid_ )
959 if ( !tkzsin_.zsamp_.isCompatible(tkzsout_.zsamp_) )
973 const int nrzout = infoout.getSize(2);
976 const int nrztocopy = zrg.
nrSteps() + 1;
977 const int z0in = tkzsin_.zsamp_.nearestIndex( zrg.
start );
978 const int z0out = tkzsout_.zsamp_.nearestIndex( zrg.
start );
981 const T* inptr = in_.getData();
982 T* outptr =
out_.getData();
985 const bool hasarrayptr = inptr && outptr;
986 const bool hasstorage = instor && outstor;
987 const bool needgetset = !hasarrayptr && !hasstorage;
990 infoout.getSize( 1 ) );
992 iter.setGlobalPos( start );
994 const od_int64 offsetout = start * nrzout + z0out;
998 for (
od_int64 idx=start; idx<=stop; idx++, iter.next(),
999 outptr+=nrzout, validxout+=nrzout,
1000 quickAddToNrDone(idx) )
1002 const int inlidx = iter[0];
1003 const int crlidx = iter[1];
1008 const int inlidxin = tksin.
lineIdx( bid.lineNr() );
1009 const int crlidxin = tksin.
trcIdx( bid.trcNr() );
1010 const od_int64 offsetin = needgetset ? 0
1011 : infoin.getOffset( inlidxin, crlidxin, z0in );
1016 else if ( hasstorage )
1018 for (
int idz=0; idz<nrztocopy; idz++ )
1020 outstor->setValue( validxout+idz,
1021 instor->
value(offsetin+idz));
1026 for (
int idz=0, idzin=z0in; idz<nrztocopy; idz++,
1030 in_.get( inlidxin, crlidxin, idzin );
1031 out_.set( inlidx, crlidx, idz, val );
1064 static const
char* sKeyOrder() {
return "Polynomial Order"; }
1069 const IDXABLE& valuelistj);
1076 template <
class T>
void apply(
const Coord& pos,
bool dir,T&)
const;
1094 void initOrder1(
const TypeSet<Coord>&,
1096 void initOrder2(
const TypeSet<Coord>&,
1098 void initCenter(
const TypeSet<Coord>&);
1104 template <
class IDXABLE>
inline 1107 int sz = poslist.
size();
1114 for (
int idx=0; idx<sz; idx++ )
1116 if ( !poslist[idx].isDefined() ||
mIsUdf(vals[idx]) )
1119 posnoudf += poslist[idx];
1120 valsnoudf += (double) vals[idx];
1123 sz = valsnoudf.
size();
1138 template <
class T>
inline 1144 const double fact = dir ? -1. : 1;
1145 double inp = (double) val;
1153 const double dx = pos.
x -
posc_.
x;
1154 const double dy = pos.
y -
posc_.
y;
1155 inp += fact * (
f1_ * dx +
f2_ * dy );
1162 const double dx2 = dx * dx;
1163 const double dxy = dx * dy;
1164 const double dyy = dy * dy;
1165 inp += fact * (
f11_ * dx2 +
f12_ * dxy +
f22_ * dyy );
1178 bool dosqout=
false,
bool doabs=
false,
1179 bool donormalizesum=
false,
1180 bool dosqrtsum=
false)
1185 , donormalizesum_(donormalizesum)
1186 , dosqrtsum_(dosqrtsum)
1203 template <
class RT,
class AT>
1211 , sz_(xvals.info().getTotalSz())
1212 , xfact_(
mUdf(double))
1213 , yfact_(
mUdf(double))
1241 if ( yarr_ && yarr_->info().getTotalSz() != sz_ )
1244 return sumvals_.setSize( nrthreads );
1256 for (
int idx=0; idx<sumvals_.size(); idx++ )
1258 if (
mIsUdf(sumvals_[idx]) )
1261 cumsum_ += sumvals_[idx];
1268 if ( setup_.donormalizesum_ )
1269 cumsum_ /=
mCast(
RT,xarr_.info().getTotalSz());
1271 if ( setup_.dosqrtsum_ )
1292 template <
class RT,
class AT>
inline 1296 RT sumval = 0, comp = 0;
1298 const AT* xvals = xarr_.getData();
1299 const AT* yvals = yarr_ ? yarr_->getData() : 0;
1303 ArrayNDIter* yiter = ( yarr_ && ( yvals || ystor ) ) || !yarr_
1306 if ( yiter ) yiter->setGlobalPos( start );
1307 const bool doscalexvals = !
mIsUdf(xfact_);
1308 const bool hasyvals = yarr_;
1309 const bool doscaleyvals = !
mIsUdf(yfact_);
1310 for (
od_int64 idx=start; idx<=stop; idx++ )
1312 RT xvalue = xvals ? xvals[idx]
1313 : xstor ? xstor->
value(idx)
1314 : xarr_.getND( xiter->
getPos() );
1315 if ( !noudf_ &&
mIsUdf(xvalue) )
1317 if ( xiter ) xiter->
next();
1318 if ( yiter ) yiter->next();
1322 if ( setup_.dosqinp_ ) xvalue *= xvalue;
1323 if ( doscalexvals ) xvalue *= xfact_;
1326 RT yvalue = yvals ? yvals[idx]
1327 : ystor ? ystor->
value(idx)
1328 : yarr_->getND( yiter->getPos() );
1329 if ( !noudf_ &&
mIsUdf(yvalue) )
1331 if ( xiter ) xiter->
next();
1332 if ( yiter ) yiter->next();
1336 if ( setup_.dosqinp_ ) yvalue *= yvalue;
1337 if ( doscaleyvals ) yvalue *= yfact_;
1338 if ( setup_.doadd_ )
1344 if ( setup_.doabs_ )
1346 else if ( setup_.dosqout_ )
1350 const RT t = sumval + xvalue;
1351 comp = ( t - sumval ) - xvalue;
1354 if ( xiter ) xiter->
next();
1355 if ( yiter ) yiter->next();
1358 delete xiter;
delete yiter;
1359 sumvals_[threadidx] = count==0 ?
mUdf(
RT) : sumval;
1370 #define mSetResAndContinue(res) \ 1373 outvals[idx] = res; \ 1374 else if ( outstor ) \ 1375 outstor->setValue( idx, res );\ 1377 outarr_.setND( outiter->getPos(), res ); \ 1379 if ( xiter ) xiter->next(); \ 1380 if ( yiter ) yiter->next(); \ 1381 if ( outiter ) outiter->next(); \ 1389 template <
class OperType,
class ArrType>
1400 , sz_(xvals.info().getTotalSz())
1401 , xfact_(
mUdf(double))
1402 , yfact_(
mUdf(double))
1403 , shift_(
mUdf(double))
1429 if ( outarr_.info().getTotalSz() != sz_ )
1432 if ( yarr_ && yarr_->info().getTotalSz() != sz_ )
1455 template <
class OperType,
class ArrType>
1458 const ArrType* xvals = xarr_.getData();
1459 const ArrType* yvals = yarr_ ? yarr_->getData() : 0;
1460 ArrType* outvals = outarr_.getData();
1465 ArrayNDIter* yiter = ( yarr_ && ( yvals || ystor ) ) || !yarr_
1470 if ( yiter ) yiter->setGlobalPos( start );
1471 if ( outiter ) outiter->setGlobalPos( start );
1472 const bool doscalexvals = !
mIsUdf(xfact_);
1473 const bool hasyvals = yarr_;
1474 const bool doscaleyvals = !
mIsUdf(yfact_);
1475 const bool doshiftoutvals = !
mIsUdf(shift_);
1476 for (
od_int64 idx=start; idx<=stop; idx++ )
1478 OperType xvalue = xvals ? xvals[idx]
1479 : xstor ? xstor->
value(idx)
1480 : xarr_.getND( xiter->
getPos() );
1481 if ( !noudf_ &&
mIsUdf(xvalue) )
1484 if ( doscalexvals ) xvalue *= xfact_;
1487 OperType yvalue = yvals ? yvals[idx]
1488 : ystor ? ystor->
value(idx)
1489 : yarr_->getND( yiter->getPos() );
1490 if ( !noudf_ &&
mIsUdf(yvalue) )
1493 if ( doscaleyvals ) yvalue *= yfact_;
1494 if ( setup_.doadd_ )
1500 if ( doshiftoutvals )
1506 delete xiter;
delete yiter;
delete outiter;
1537 return sumvals_.setSize( nrthreads );
1544 for (
int idx=
mCast(
int,start); idx<=stop; idx++ )
1546 const T value = vals_[idx];
1547 if ( !noudf_ &&
mIsUdf(value) )
1554 sumvals_[threadidx] = count==0 ?
mUdf(T) : sumval;
1566 for (
int idx=0; idx<sumvals_.size(); idx++ )
1568 if (
mIsUdf(sumvals_[idx]) )
1571 cumsum_ += sumvals_[idx];
1614 {
return getSum<T>( in, noudf, true ); }
1635 {
return getAverage<T>( in, noudf, true ); }
1642 bool noudf,
bool parallel )
1644 const od_uint64 sz = in.info().getTotalSz();
1660 const T*,arrin,T*,arrout,T,fact,T,shift,
bool,noudf)
1670 double shift,
bool noudf,
bool parallel )
1684 T fact, T shift,
bool noudf,
bool parallel )
1685 {
return getScaledArray( in, out_, fact, shift, noudf, parallel ); }
1691 T fact, T shift,
bool noudf )
1698 const T*,arr1,
const T*,arr2,T*,out,T,fact1,T,fact2,
bool,noudf)
1701 { out_[idx] =
mUdf(T);
continue; } \
1709 bool noudf,
bool parallel )
1722 ArrayND<T>& out, T fact1, T fact2,
bool noudf,
1724 {
getSumArrays( in1, in2, out, fact1, fact2, noudf, parallel ); }
1729 ArrayND<T>& out, T fact1, T fact2,
bool noudf )
1730 {
getSumArrays( in1, in2, out, fact1, fact2, noudf,
true ); }
1737 const T*,arr1,
const T*,arr2,T*,out,
bool,noudf)
1740 {
out_[idx] =
mUdf(T);
continue; } \
1760 {
return getProduct<T>( in1, in2, out, noudf, true ); }
1780 {
return getSum<T>( in1, in2, out, noudf, true ); }
1787 bool noudf,
bool parallel )
1801 bool noudf,
bool parallel )
1808 return mUdf(
double);
1810 return sumprodexec.
getSum();
1817 {
return getSumProduct<T>( in1, in2, noudf, true ); }
1838 {
return getSumSq<T>( in, noudf, true ); }
1864 return mUdf(
double);
1866 return norm2exec.
getSum();
1873 {
return getNorm2<T>( in, noudf, true ); }
1895 {
return getRMS<T>( in, noudf, true ); }
1920 {
return getResidual<T>( in1, in2, noudf, true ); }
1944 {
return getSumXMY2<T>( in1, in2, noudf, true ); }
1967 {
return getSumX2PY2<T>( in1, in2, noudf, true ); }
1991 {
return getSumX2MY2<T>( in1, in2, noudf, true ); }
1996 template <
class T,
class fT>
1998 T& intercept, T& gradient )
2005 const bool hasxvals = inx_;
2010 if ( !inxtmp->
isOK() )
2011 {
delete inxtmp;
return false; }
2013 T* inxvals = inxtmp->
getData();
2017 inxvals[idx] =
mCast(fT,idx);
2025 inxtmp->
setND( iter.getPos(),
mCast(fT,idx) );
2027 }
while ( iter.next() );
2033 T avgxvals =
getAverage( *inx,
false,
true );
2035 {
if ( !hasxvals)
delete inx;
return false; }
2039 removeBias<T,fT>( inyed );
2040 removeBias<T,fT>( inxed );
2043 if ( !crossprodxy.isOK() )
2044 {
if ( !hasxvals )
delete inx;
return false; }
2046 getProduct( *inx, iny, crossprodxy,
false,
true );
2050 intercept = avgyvals - gradient * avgxvals;
2077 : ParallelTask(
"Array Udf Replacer")
2080 , undefidxs_(undefidxs)
2088 : ParallelTask(
"Array Udf Replacer")
2091 , undefidxs_(undefidxs)
2094 , totalnr_(inp.info().getTotalSz()/inp.info().getSize(2))
2099 return tr(
"Replacing undefined values");
2110 trcssampling_ = trcssampling;
2122 undefidxs_->setEmpty();
2129 const bool isrect = tks_ && trcssampling_
2130 ? trcssampling_->isFullyRectAndReg()
2133 const int nrtrcsp = info.
getSize( inp_.get1DDim() );
2134 T* dataptr = inp_.getData();
2136 const bool hasarrayptr = dataptr;
2137 const bool hasstorage = datastor;
2138 const bool neediterator = !hasarrayptr && !hasstorage;
2139 const od_int64 offset = start * nrtrcsp;
2147 const T replval = replval_;
2148 for (
od_int64 idx=start; idx<=stop; idx++,
2149 quickAddToNrDone(idx))
2151 const bool hastrcdata = isrect ?
true 2152 : trcssampling_->isValid(idx,*tks_);
2155 for (
int idz=0; idz<nrtrcsp; idz++ )
2157 const int* pos = iter ? iter->
getPos() : 0;
2158 const T val = hasarrayptr ? *dataptr
2160 ? datastor->
value( validx )
2161 : inp_.getND( pos );
2164 if ( hasarrayptr ) dataptr++;
2165 else if ( hasstorage ) validx++;
2174 *undefidxs_ += idx*nrtrcsp + idz;
2179 *dataptr++ = replval;
2180 else if ( hasstorage )
2181 datastor->
setValue( validx++, replval );
2184 inp_.setND( pos, replval );
2196 else if ( hasstorage )
2198 for (
int idz=0; idz<nrtrcsp; idz++ )
2199 datastor->
setValue( validx++, replval );
2203 for (
int idz=0; idz<nrtrcsp; idz++ )
2205 inp_.setND( iter->
getPos(), replval );
2242 : ParallelTask(
"Udf retriever")
2243 , undefidxs_(undefidxs)
2245 , totalnr_(undefidxs.
size())
2260 T* outpptr = outp_.getData();
2266 const T udfval =
mUdf(T);
2268 for (
od_int64 idx=start; idx<=stop; idx++,
2269 quickAddToNrDone(idx) )
2271 const od_uint64 sidx = undefidxs_[idx];
2273 outpptr[sidx] = udfval;
2274 else if ( outpstor )
2275 outpstor->
setValue( sidx, udfval );
2279 outp_.setND( pos, udfval );
2303 : ParallelTask(
"Udf traces retriever")
2304 , trcssampling_(trcssampling)
2325 const int nrtrcsp = info.
getSize( outp_.get1DDim() );
2326 T* outpptr = outp_.getData();
2328 const bool hasarrayptr = outpptr;
2329 const bool hasstorage = outstor;
2330 const od_int64 offset = start * nrtrcsp;
2338 hiter->setGlobalPos( start );
2340 for (
od_int64 idx=start; idx<=stop; idx++ )
2342 if ( trcssampling_.isValid(idx,tks_) )
2344 if ( hasarrayptr ) outpptr+=nrtrcsp;
2345 else if ( hasstorage ) validx+=nrtrcsp;
2356 else if ( hasstorage )
2358 for (
int idz=0; idz<nrtrcsp; idz++ )
2363 const int inlidx = (*hiter)[0];
2364 const int crlidx = (*hiter)[1];
2365 for (
int idz=0; idz<nrtrcsp; idz++ )
2366 outp_.set( inlidx, crlidx, idz,
mUdf(T) );
2395 : ParallelTask(
"Mute Array Extracter")
2398 , tailmute_(tailmute)
2407 return tr(
"Extracting mute positions");
2416 trcssampling_ = trcssampling;
2427 const int data1ddim = data_.get1DDim();
2428 if ( ( data1ddim != 1 && data1ddim != 2 ) ||
2429 topmute_.get1DDim() != data1ddim-1 ||
2430 tailmute_.get1DDim() != data1ddim-1 )
2433 topmute_.setAll( 0 );
2435 mCast(
int,data_.info().getTotalSz()/totalnr_);
2436 tailmute_.setAll( nrz-1 );
2443 const bool isrect = tks_ && trcssampling_
2444 ? trcssampling_->isFullyRectAndReg()
2446 const T* dataptr = data_.getData();
2447 int* topmuteptr = topmute_.getData();
2448 int* tailmuteptr = tailmute_.getData();
2452 const bool hasarrayptr = dataptr && topmuteptr &&
2454 const bool hasstorage = datastor && topmutestor &&
2456 const bool neediterator = !hasarrayptr && !hasstorage;
2458 const int zidx = data_.get1DDim();
2459 const int nrtrcsp = info.
getSize( zidx );
2460 const od_int64 offset = start * nrtrcsp;
2464 topmuteptr += start;
2465 tailmuteptr += start;
2469 const int ndim = info.
getNDim();
2470 const bool is2d = ndim == 2;
2471 const int nrlines = is2d ? 1 : info.
getSize(0);
2472 const int nrtrcs = info.
getSize( is2d ? 0 : 1 );
2479 const T zeroval =
mCast(T,0);
2484 for (
od_int64 idx=start; idx<=stop; idx++,
2485 quickAddToNrDone(idx) )
2487 const bool hastrcdata = isrect ?
true 2488 : trcssampling_->isValid(idx,*tks_);
2497 if ( hasstorage ) validx+=nrtrcsp;
2503 const int* hpos = hiter ? hiter->
getPos() : 0;
2506 for (
int ipos=0; ipos<ndim; ipos++ )
2507 pos[ipos] = hpos[ipos];
2511 bool allnull =
true;
2512 for (
int idz=0; idz<nrtrcsp; idz++ )
2514 if ( hiter ) pos[zidx] = idz;
2515 const T val = hasarrayptr
2518 ? datastor->
value( validx++ )
2519 : data_.getND( pos );
2520 if ( val == zeroval )
2525 *topmuteptr++ = idz;
2526 dataptr += nrtrcsp-idz-2;
2528 else if ( hasstorage )
2531 validx += nrtrcsp-idz-2;
2534 topmute_.setND( hpos, idz );
2544 *topmuteptr++ = nrtrcsp;
2545 *tailmuteptr++ = -1;
2547 else if ( hasstorage )
2549 topmutestor->
setValue( idx, nrtrcsp );
2550 tailmutestor->setValue( idx, -1 );
2554 topmute_.setND( hpos, nrtrcsp );
2555 tailmute_.setND( hpos, -1 );
2561 for (
int idz=nrtrcsp-1; idz>=0; idz-- )
2563 if ( hiter ) pos[zidx] = idz;
2564 const T val = hasarrayptr
2567 ? datastor->
value( validx-- )
2568 : data_.getND( pos );
2569 if ( val == zeroval )
2574 *tailmuteptr++ = idz;
2575 dataptr += nrtrcsp-idz+1;
2577 else if ( hasstorage )
2579 tailmutestor->setValue( idx, idz );
2580 validx += nrtrcsp-idz+1;
2583 tailmute_.setND( hpos, idz );
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: arrayndalgo.h:1219
bool doabs_
Definition: arrayndalgo.h:1192
Array1D ( Subclass of ArrayND ) is a one dimensional array.
Definition: arraynd.h:101
Definition: arrayndalgo.h:1061
const TrcKeySampling * tks_
Definition: arrayndalgo.h:2220
T * arr()
Definition: valseries.h:329
#define mExpClass(module)
Definition: commondefs.h:160
void initOrder0(const TypeSet< double > &)
virtual uint64_t getTotalSz() const
virtual int getNDim() const =0
int totalSizeInside(const TrcKeySampling &hrg) const
bool isOK() const
Definition: arrayndalgo.h:323
bool rectangular_
Definition: arrayndalgo.h:390
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:287
virtual T value(int64_t) const =0
static uiString sDone()
Definition: uistrings.h:280
double f2_
Definition: arrayndalgo.h:1087
od_uint64 sz_
Definition: arrayndalgo.h:1280
uiString uiMessage() const
will be message() again in 7.x
Definition: arrayndalgo.h:806
Array2D< T > & out_
Definition: arrayndalgo.h:910
static uiString sTrcFinished()
Definition: paralleltask.h:90
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: arrayndalgo.h:1524
const od_int64 totalnr_
Definition: arrayndalgo.h:2379
#define mDeclareAndTryAlloc(tp, var, stmt)
Creates variable, try to alloc and catch bad_alloc.
Definition: commondefs.h:248
void setShift(double shift)
Definition: arrayndalgo.h:1419
ArrayOperExecSetup(bool doadd=true, bool dosqinp=false, bool dosqout=false, bool doabs=false, bool donormalizesum=false, bool dosqrtsum=false)
Definition: arrayndalgo.h:1177
bool isOK() const
Definition: arrayndimpl.h:67
InterpolType
Definition: mathfunc.h:155
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
Definition: arrayndalgo.h:2072
bool doWork(od_int64 start, od_int64 stop, int)
Definition: arrayndalgo.h:2127
void setScaler(double scaler, bool forx=true)
Definition: arrayndalgo.h:1412
#define mComputeTrendAandB(sz)
Definition: arrayndalgo.h:28
float * getValues() const
Definition: arrayndalgo.h:326
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
const ArrayND< ArrType > & xarr_
Definition: arrayndalgo.h:1446
Contains the information about the size of Array3D, and in what order the data is stored (if accessab...
Definition: arrayndinfo.h:118
od_int64 nrIterations() const
Definition: arrayndalgo.h:1423
Parallel task for computing the element wise operations of one array and optionally a second input ar...
Definition: arrayndalgo.h:1390
#define mDefParallelCalc4Pars(clss, uimsg, T1, v1, T2, v2, T3, v3, T4, v4)
Definition: paralleltask.h:226
uiString uiMessage() const
will be message() again in 7.x
Definition: arrayndalgo.h:1525
const ArrayND< AT > & xarr_
Definition: arrayndalgo.h:1284
od_uint64 sz_
Definition: arrayndalgo.h:1443
#define mGlobal(module)
Definition: commondefs.h:163
bool doPrepare(int)
Definition: arrayndalgo.h:1427
double getNorm2D(const ArrayND< T > &in, bool noudf, bool parallel)
Definition: arrayndalgo.h:1857
const ValueSeries< T > * getStorage() const
Definition: arraynd.h:46
#define mCast(tp, v)
Definition: commondefs.h:124
Tapers the N-dimentional ArrayND with a windowFunction.
Definition: arrayndalgo.h:309
void setOrder(PolyTrend::Order t)
Definition: arrayndalgo.h:1067
#define od_int64
Definition: plftypes.h:36
T getSum() const
Definition: arrayndalgo.h:1527
bool dosqrtsum_
Definition: arrayndalgo.h:1194
Definition: arrayndalgo.h:2297
bool set(const TypeSet< Coord > &, const IDXABLE &valuelistj)
Definition: arrayndalgo.h:1105
virtual void set(int, T)=0
const TrcKeyZSampling & tkzsin_
Definition: arrayndalgo.h:1039
Order getOrder() const
Definition: arrayndalgo.h:1074
double xfact_
Definition: arrayndalgo.h:1286
bool doWork(od_int64 start, od_int64 stop, int)
Definition: arrayndalgo.h:855
double f11_
Definition: arrayndalgo.h:1088
Implementation of ArrayNDInfo.
Definition: arrayndinfo.h:219
Implementation of Array2D.
Definition: arrayndimpl.h:102
int nrSteps() const
Definition: ranges.h:771
bool noudf_
Definition: arrayndalgo.h:1582
Contains the information about the size of ArrayND, and in what order the data is stored (if accessab...
Definition: arrayndinfo.h:23
double f0_
Definition: arrayndalgo.h:1085
Threads::Mutex lck_
Definition: arrayndalgo.h:2223
Array2DCopier(const Array2D< T > &in, const TrcKeySampling &tksin, const TrcKeySampling &tksout, Array2D< T > &out)
Definition: arrayndalgo.h:782
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: arrayndalgo.h:2250
TrcKeySampling commontks_
Definition: arrayndalgo.h:909
BinID atIndex(int i0, int i1) const
double getSumProductD(const ArrayND< T > &in1, const ArrayND< T > &in2, bool noudf, bool parallel)
Definition: arrayndalgo.h:1800
mDeprecated T getRMS(const ArrayND< T > &in, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1894
float * window_
Definition: arrayndalgo.h:388
bool Array3DCopy(Array3D< T > &dest, const Array3D< T > &src, int p0, int p1, int p2, bool srcperiodic=false)
Definition: arrayndalgo.h:608
virtual bool getArrayPos(uint64_t, int *) const
void limitTo(const BasicInterval< X > &i)
Definition: ranges.h:65
Definition: uistring.h:89
T atIndex(int) const
Definition: ranges.h:687
ValueSeries of offsets.
Definition: valseries.h:69
uiString uiMessage() const
will be message() again in 7.x
Definition: arrayndalgo.h:1409
Definition: arrayndalgo.h:1061
od_int64 nrIterations() const
Definition: arrayndalgo.h:1531
virtual void setND(const int *, T)=0
A cartesian coordinate in 2D space.
Definition: coord.h:25
mODTextTranslationClass(ArrayUdfValRestorer) public
Definition: arrayndalgo.h:2238
double f1_
Definition: arrayndalgo.h:1086
bool removeBias(ArrayND< T > &inout)
Removes the bias from an ArrayND.
Definition: arrayndalgo.h:143
int lineIdx(Pos::LineID) const
Definition: trckeysampling.h:220
mDeprecated void getProduct(const ArrayND< T > &in1, const ArrayND< T > &in2, ArrayND< T > &out, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1758
BufferString windowtypename_
Definition: arrayndalgo.h:392
void setReplacementValue(T val)
Definition: arrayndalgo.h:2104
unsigned int Abs(unsigned int i)
Definition: math2.h:80
virtual int get1DDim() const
Definition: arraynd.h:358
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
virtual void set(int, int, T)=0
FixedString None()
Definition: keystrs.h:90
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
const TrcKeySampling & tks_
Definition: arrayndalgo.h:2376
ArrayND< T > & outp_
Definition: arrayndalgo.h:2289
static uiString sInline(int num=1)
Definition: uistrings.h:330
Definition: arrayndalgo.h:1174
const T inpval
Definition: arrayndalgo.h:1661
bool doFinish(bool success)
Definition: arrayndalgo.h:1249
bool Array2DPaste(Array2D< T > &dest, const Array2D< T > &src, int p0, int p1, bool destperiodic=false)
Definition: arrayndalgo.h:694
const ArrayOperExecSetup & setup_
Definition: arrayndalgo.h:1279
mODTextTranslationClass(ArrayUdfValReplacer) public
Definition: arrayndalgo.h:2073
TypeSet< RT > sumvals_
Definition: arrayndalgo.h:1283
ArrOperExec(const ArrayND< ArrType > &xvals, const ArrayND< ArrType > *yvals, bool noudf, const ArrayOperExecSetup &setup, ArrayND< ArrType > &outvals)
Definition: arrayndalgo.h:1393
virtual int getSize(int dim) const =0
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: arrayndalgo.h:2102
bool hasUndefs(const Array1D< fT > &in)
Returns whether there are undefs in the Array1D.
Definition: arrayndalgo.h:247
Transfers the common samples from one 3D array to another.
Definition: arrayndalgo.h:917
bool dosqout_
Definition: arrayndalgo.h:1191
#define mSetResAndContinue(res)
Definition: arrayndalgo.h:1370
bool doadd_
Definition: arrayndalgo.h:1189
#define mNINT32(x)
Definition: commondefs.h:45
const T * getData() const
Definition: arraynd.h:55
const TrcKeySampling & tksin_
Definition: arrayndalgo.h:907
const Array2D< T > & in_
Definition: arrayndalgo.h:906
virtual T getND(const int *) const =0
WindowType
Definition: arrayndalgo.h:312
const T val2
Definition: arrayndalgo.h:1699
double shift_
Definition: arrayndalgo.h:1451
virtual const Array3DInfo & info() const =0
bool apply(ArrayND< Type > *in, ArrayND< Type > *out_=0) const
Definition: arrayndalgo.h:334
float getParamVal() const
Definition: arrayndalgo.h:325
T mDeprecated getSumX2MY2(const ArrayND< T > &in1, const ArrayND< T > &in2, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1989
mODTextTranslationClass(PolyTrend)
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:27
Array3D< T > & out_
Definition: arrayndalgo.h:1044
T mDeprecated getSumX2PY2(const ArrayND< T > &in1, const ArrayND< T > &in2, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1965
CumSumExec(const T *vals, od_int64 sz, bool noudf)
Definition: arrayndalgo.h:1517
bool noudf_
Definition: arrayndalgo.h:1444
void initOrder2(const TypeSet< Coord > &, const TypeSet< double > &)
bool doWork(od_int64 start, od_int64 stop, int threadidx)
Definition: arrayndalgo.h:1540
static uiString sPosFinished()
Definition: paralleltask.h:89
Definition: arrayndalgo.h:1171
float paramval_
Definition: arrayndalgo.h:393
bool doPrepare(int nrthreads)
Definition: arrayndalgo.h:1239
bool ArrayNDPaste(ArrayND< T > &dest, const ArrayND< T > &src, const TypeSet< int > &pastepos, bool destperiodic=false)
Definition: arrayndalgo.h:652
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
T y
Definition: geometry.h:67
double f22_
Definition: arrayndalgo.h:1090
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
Interface to a series of values.
Definition: odmemory.h:17
bool isDefined() const
Definition: geometry.h:352
arrout_[idx]
Definition: arrayndalgo.h:1664
const ArrayND< ArrType > * yarr_
Definition: arrayndalgo.h:1447
mDeprecated T getSumSq(const ArrayND< T > &in, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1837
T mDeprecated getSumXMY2(const ArrayND< T > &in1, const ArrayND< T > &in2, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1942
bool setGlobalPos(int64_t)
Definition: arraynd.h:264
void setSampling(const TrcKeySampling &tks, const PosInfo::CubeData *trcssampling)
Definition: arrayndalgo.h:2106
int trcIdx(Pos::TraceID) const
Definition: trckeysampling.h:228
double f12_
Definition: arrayndalgo.h:1089
Definition: arrayndalgo.h:1514
bool noudf_
Definition: arrayndalgo.h:1281
const TrcKeyZSampling & tkzsout_
Definition: arrayndalgo.h:1040
T getMax(const ArrayND< T > &in)
returns the Maximum of all defined values in the ArrrayND. Returns UDF if empty or only udfs encounte...
Definition: arrayndalgo.h:202
mODTextTranslationClass(Array3DCopier) public
Definition: arrayndalgo.h:918
out_[idx]
Definition: arrayndalgo.h:1702
double yfact_
Definition: arrayndalgo.h:1450
bool removeLinPart(const ArrayND< T > &in_, ArrayND< T > *out, bool trend)
[do not use, helper function]
Definition: arrayndalgo.h:38
bool doPrepare(int nrthreads)
Definition: arrayndalgo.h:1535
bool removeTrend(ArrayND< T > &inout)
Removes a linear trend from an ArrayND.
Definition: arrayndalgo.h:159
bool ArrayNDCopy(ArrayND< T > &dest, const ArrayND< T > &src, const TypeSet< int > ©pos, bool srcperiodic=false)
Definition: arrayndalgo.h:569
bool doPrepare(int)
Definition: arrayndalgo.h:823
virtual void set(int, int, int, T)=0
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: arrayndalgo.h:800
std::complex< float > float_complex
Definition: odcomplex.h:18
uiString uiMessage() const
will be message() again in 7.x
Definition: arrayndalgo.h:2248
bool Array3DPaste(Array3D< T > &dest, const Array3D< T > &src, int p0, int p1, int p2, bool destperiodic=false)
Definition: arrayndalgo.h:732
double yfact_
Definition: arrayndalgo.h:1287
void setND(const int *pos, T v)
Definition: arraynd.h:108
mDeclareEnumUtils(Order) static const char *sKeyOrder()
Definition: arrayndalgo.h:1062
double xfact_
Definition: arrayndalgo.h:1449
bool doFinish(bool success)
Definition: arrayndalgo.h:1559
bool doPrepare(int)
Definition: arrayndalgo.h:2119
#define mDynamicCastGet(typ, out, in)
Definition: commondefs.h:131
void setOffset(int64_t no)
Definition: valseries.h:344
virtual bool executeParallel(bool parallel)
void initOrder1(const TypeSet< Coord > &, const TypeSet< double > &)
void add(xT x, yT y)
Definition: mathfunc.h:406
virtual T get(int p0, int p1, int p2) const =0
ArrayND< T > & inp_
Definition: arrayndalgo.h:2217
#define mGetInfo()
Definition: arrayndalgo.h:941
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: arrayndalgo.h:1408
T getAverage(const ArrayND< T > &in)
returns the average of all defined values in the Arrray1D. Returns UDF if empty or only udfs encounte...
Definition: arrayndalgo.h:177
virtual void setValue(int64_t, T)
Definition: valseries.h:45
const TrcKeySampling & tksout_
Definition: arrayndalgo.h:908
LargeValVec< od_uint64 > * undefidxs_
Definition: arrayndalgo.h:2219
StepInterval< int > lineRange() const
Type
Definition: angles.h:27
od_int64 sz_
Definition: arrayndalgo.h:1581
#define od_uint64
Definition: plftypes.h:37
Coord posc_
Definition: arrayndalgo.h:1091
An ArrayND is an array with a given number of dimensions and a size.
Definition: arraynd.h:33
void apply(const Coord &pos, bool dir, T &) const
Definition: arrayndalgo.h:1139
bool getInterceptGradient(const ArrayND< T > &iny, const ArrayND< T > *inx_, T &intercept, T &gradient)
returns the intercept and gradient of two arrays
Definition: arrayndalgo.h:1997
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: arrayndalgo.h:2314
Iterates through all samples in an ArrayND.
Definition: arraynd.h:179
CumArrOperExec(const ArrayND< AT > &xvals, bool noudf, const ArrayOperExecSetup &setup)
Definition: arrayndalgo.h:1207
void sysMemCopy(void *, const void *, int64_t)
void setValue(int idx, float val)
Definition: arrayndalgo.h:328
IdxType & crl()
Definition: posidxpair.h:48
bool includes(const TrcKeySampling &, bool ignoresteps=false) const
float_complex mDeprecated getAverage< float_complex >(const ArrayND< float_complex > &in, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1651
bool interpUdf(Array1D< fT > &in, typename BendPointBasedMathFunction< fT, fT >::InterpolType ipoltyp=BendPointBasedMathFunction< fT, fT >::Poly)
Definition: arrayndalgo.h:272
#define mPlural
Definition: uistrings.h:19
size_type size() const
Definition: typeset.h:254
od_int64 nrIterations() const
Definition: arrayndalgo.h:2254
#define mDeprecated
Definition: plfdefs.h:233
mDeprecated T getNorm2(const ArrayND< T > &in, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1872
ArrayND< ArrType > & outarr_
Definition: arrayndalgo.h:1448
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
T dePeriodize(T val, T period)
Definition: periodicvalue.h:26
bool donormalizesum_
Definition: arrayndalgo.h:1193
od_int64 nrIterations() const
Definition: arrayndalgo.h:1235
void getScaledArray(const ArrayND< T > &in, ArrayND< T > *out_, double fact, double shift, bool noudf, bool parallel)
returns a scaled array
Definition: arrayndalgo.h:1669
#define mDefParallelCalc6Pars(clss, uimsg, T1, v1, T2, v2, T3, v3, T4, v4, T5, v5, T6, v6)
Definition: paralleltask.h:251
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: arrayndalgo.h:933
T Array3DInterpolate(const Array3D< T > &array, float p0, float p1, float p2, bool posperiodic=false)
Definition: arrayndalgo.h:400
bool doPrepare(int)
Definition: arrayndalgo.h:947
bool resize(const char *, int64_t)
Definition: arrayndalgo.h:313
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
const T * vals_
Definition: arrayndalgo.h:1585
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
virtual const Array1DInfo & info() const =0
T x
Definition: geometry.h:66
Definition: arrayndalgo.h:2237
const int * getPos() const
Definition: arraynd.h:191
bool doWork(od_int64 start, od_int64 stop, int)
Definition: arrayndalgo.h:2258
mDeprecated void getSumProduct(const ArrayND< T > &in1, const ArrayND< T > &in2, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1815
virtual T get(int) const =0
Definition: arrayndalgo.h:1061
T * sysMemValueSet(T *, T, int64_t nrsamp)
Definition: odmemory.h:466
Implementation of Array2DInfo.
Definition: arrayndinfo.h:166
RT getSum() const
Definition: arrayndalgo.h:1231
uiString uiMessage() const
will be message() again in 7.x
Definition: arrayndalgo.h:2097
TypeSet< T > sumvals_
Definition: arrayndalgo.h:1584
const LargeValVec< od_uint64 > & undefidxs_
Definition: arrayndalgo.h:2288
Order order_
Definition: arrayndalgo.h:1084
uiString uiMessage() const
will be message() again in 7.x
Definition: arrayndalgo.h:931
Parallel task for computing the sum of element wise operations of one array and optionally a second i...
Definition: arrayndalgo.h:1204
const PosInfo::CubeData & trcssampling_
Definition: arrayndalgo.h:2375
void convertUndefinedIndexList(const TrcKeyZSampling &tkzsin, const TrcKeyZSampling &tkzsout, LargeValVec< od_uint64 > &)
Definition: arrayndalgo.h:1061
T start
Definition: ranges.h:92
bool doWork(od_int64 start, od_int64 stop, int)
Definition: arrayndalgo.h:968
if(!noudf_ &&(mIsUdf(val1)||mIsUdf(val2)))
Definition: arrayndalgo.h:1700
bool canCopyAll() const
Definition: arrayndalgo.h:817
od_int64 nrIterations() const
Definition: arrayndalgo.h:937
void getSumArrays(const ArrayND< T > &in1, const ArrayND< T > &in2, ArrayND< T > &out, double fact1, double fact2, bool noudf, bool parallel)
computes the sum array between two arrays with scaling
Definition: arrayndalgo.h:1707
bool getInterSection(const TrcKeySampling &, TrcKeySampling &) const
Returns false if intersection is empty.
const Array3D< T > & in_
Definition: arrayndalgo.h:1043
od_int64 nrIterations() const
Definition: arrayndalgo.h:810
bool doWork(od_int64 start, od_int64 stop, int)
Definition: arrayndalgo.h:2322
virtual const ArrayNDInfo & info() const =0
const od_int64 totalnr_
Definition: arrayndalgo.h:1041
MathFunction based on bend points.
Definition: mathfunc.h:151
static uiString phrJoinStrings(const uiString &a, const uiString &b)
"
const PosInfo::CubeData * trcssampling_
Definition: arrayndalgo.h:2221
Implementation of Array1D.
Definition: arrayndimpl.h:52
ArrayUdfValReplacer(Array3D< T > &inp, LargeValVec< od_uint64 > *undefidxs)
Definition: arrayndalgo.h:2086
mODTextTranslationClass(Array3DUdfTrcRestorer) public
Definition: arrayndalgo.h:2298
#define mClass(module)
Definition: commondefs.h:164
virtual const Array2DInfo & info() const =0
mDeprecated void getScaled(const ArrayND< T > &in, ArrayND< T > *out_, T fact, T shift, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1690
const ArrayND< AT > * yarr_
Definition: arrayndalgo.h:1285
const T val1
Definition: arrayndalgo.h:1699
void setScaler(double scaler, bool forx)
Definition: arrayndalgo.h:1223
const Array1DInfo & info() const
Definition: arrayndimpl.h:76
#define mDefParallelCalcBody(preop, impl, postop)
Definition: paralleltask.h:279
Order
Definition: arrayndalgo.h:1061
bool dosqinp_
Definition: arrayndalgo.h:1190
Position info for an entire 3D cube. The LineData's are not sorted.
Definition: posinfo.h:95
ArrayNDInfoImpl size_
Definition: arrayndalgo.h:389
RT cumsum_
Definition: arrayndalgo.h:1288
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
const od_int64 totalnr_
Definition: arrayndalgo.h:2222
od_int64 nrIterations() const
Definition: arrayndalgo.h:2115
uiString uiMessage() const
will be message() again in 7.x
Definition: arrayndalgo.h:2312
uiString uiMessage() const
will be message() again in 7.x
Definition: arrayndalgo.h:1220
const ArrayOperExecSetup & setup_
Definition: arrayndalgo.h:1442
T replval_
Definition: arrayndalgo.h:2218
const od_int64 totalnr_
Definition: arrayndalgo.h:2290
void setYVals(const ArrayND< ArrType > &yvals)
Definition: arrayndalgo.h:1411
Polynomial trend with order 0 (mean), 1 (linear) or 2 (parabolic) The trend is derived from a set of ...
Definition: arrayndalgo.h:1054
uiString od_static_tr(const char *function, const char *text, const char *disambiguation=0, int pluralnr=-1)
mDeprecated T getResidual(const ArrayND< T > &in1, const ArrayND< T > &in2, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1918
yT getValue(xT x) const
Definition: mathfunc.h:168
void setYVals(const ArrayND< AT > &yvals)
Definition: arrayndalgo.h:1222
T cumsum_
Definition: arrayndalgo.h:1586
Transfers the common samples from one 2D array to another.
Definition: arrayndalgo.h:779
od_int64 nrIterations() const
Definition: arrayndalgo.h:2318
mDeprecated void getSum(const ArrayND< T > &in1, const ArrayND< T > &in2, ArrayND< T > &out, bool noudf)
will be removed after 6.0
Definition: arrayndalgo.h:1778
Array3D< T > & outp_
Definition: arrayndalgo.h:2377
T getMin(const ArrayND< T > &in)
returns the Minimum of all defined values in the ArrrayND. Returns UDF if empty or only udfs encounte...
Definition: arrayndalgo.h:225
TrcKeySampling hsamp_
Definition: trckeyzsampling.h:60
#define mDefParallelCalc5Pars(clss, uimsg, T1, v1, T2, v2, T3, v3, T4, v4, T5, v5)
Definition: paralleltask.h:239
BinID start_
Definition: trckeysampling.h:131