OpendTect  6.3
multidimstorage.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: K.Tingdahl
8  Date: Jan 2006
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "idxable.h"
14 #include "ranges.h"
15 #include "sets.h"
16 #include <limits.h>
17 
22 template <class T>
24 {
25 public:
26  MultiDimStorage(int ndims,int nvals);
27  MultiDimStorage(const MultiDimStorage<T>&);
28  virtual ~MultiDimStorage();
29  bool isOK() const;
30  MultiDimStorage<T>& operator=(const MultiDimStorage<T>&);
31 
32  bool getRange(int dim,Interval<int>&) const;
33  int nrDims() const;
34  int nrVals() const;
35  void setNrVals(int,bool keepdata);
36  void removeValue(int);
37 
38  bool allowsDuplicates() const;
41  bool allowDuplicates(bool);
44  bool isEmpty() const;
45  int totalSize() const;
47  int size() const;
49  MultiDimStorage<T>* operator[](int);
51  const MultiDimStorage<T>* operator[](int) const;
53  int indexOf(int pos) const;
55  int getPos(int idx) const;
57 
58 
59  template <class IDX> const T& getRef(const IDX& index,int val) const;
62  template <class IDX> T& getRef(const IDX& index,int val);
65  template <class V, class POS,class IDX>
66  bool add(const V& vals,const POS& pos,
67  IDX* index=0);
69  template <class V, class POS> bool add(const V& vals,const POS& pos);
71  bool append(const MultiDimStorage<T>&);
72  template <class IDX> void remove(const IDX& index);
73  void setEmpty();
76  template <class POS,class IDX> bool findFirst(const POS&,IDX&) const;
77  template <class IDX> bool getIndex(int global_pos,IDX&) const;
78  template <class IDX,class POS> bool getPos(const IDX&,POS&) const;
79  template <class IDX> bool next(IDX&,bool skipdups=false) const;
80  template <class IDX> bool prev(IDX&,bool skipdups=false) const;
81  template <class IDX> bool isValidPos(const IDX&) const;
82  void removeDuplicates();
83 
84  inline bool divide(ObjectSet<int>&) const;
87  template <class IDX> bool sort(TypeSet<IDX>& indices) const;
91  template <class POS> void getIndicesInRange(const POS& start,
92  const POS& stop,
93  TypeSet<int>& res) const;
97 protected:
98  void getRangeI(int dim,Interval<int>&) const;
99  template <class IDX> void setToLastPos(IDX&) const;
100  int findFirstPos(int pos) const;
101  template <class POS> void getIndicesInRangeI(const POS& start,
102  const POS& stop,
103  TypeSet<int>& curpos,
104  TypeSet<int>& res) const;
105 
110 
111 private:
112  int nrdims_;
113  int nrvals_;
114 };
115 
116 
117 template <class T> inline
118 MultiDimStorage<T>::MultiDimStorage( int nrdims, int nrvals )
119  : nrdims_( nrdims )
120  , nrvals_( nrvals )
121  , allowduplicates_( false )
122 {}
123 
124 
125 template <class T> inline
127 {
128  *this = templ;
129 }
130 
131 
132 template <class T> inline MultiDimStorage<T>&
134 {
135  nrdims_ = templ.nrdims_;
136  nrvals_ = templ.nrvals_;
138  positions_ = templ.positions_;
141  return *this;
142 }
143 
144 
145 template <class T> inline
147 {
148  setEmpty();
149 }
150 
151 
152 template <class T> inline
154 {
155  if ( nrdims_==1 )
156  {
157  if ( !positions_.arr() )
158  return false;
159 
160  return !nrvals_ || onedimstorage_.arr();
161  }
162 
163  for ( int idx=lowerdimstorage_.size()-1; idx>=0; idx-- )
164  {
165  if ( !lowerdimstorage_[idx]->isOK() )
166  return false;
167  }
168 
169  return true;
170 }
171 
172 
173 template <class T> inline
175 {
177  onedimstorage_.erase();
178  positions_.erase();
179 }
180 
181 
182 template <class T> inline
184 {
185  if ( b.nrdims_!=nrdims_ || b.nrvals_!=nrvals_ )
186  return false;
187 
188  for ( int idx=0; idx<b.size(); idx++ )
189  {
190  const int pos = b.getPos( idx );
191  int index = findFirstPos( pos );
192 
193  const bool match = positions_.validIdx(index) && positions_[index]==pos;
194  if ( nrdims_!=1 )
195  {
196  if ( !match )
197  {
198  MultiDimStorage<T>* newstorage =
199  new MultiDimStorage<T>( *b[idx] );
200  if ( index==lowerdimstorage_.size() )
201  {
202  lowerdimstorage_ += newstorage;
203  positions_ += pos;
204  }
205  else
206  {
207  if ( index==-1 )
208  index = 0;
209 
210  lowerdimstorage_.insertAt( newstorage, index );
211  positions_.insert( index, pos );
212  }
213  }
214  else
215  {
216  if ( !lowerdimstorage_[index]->append( *b[idx] ) )
217  return false;
218  }
219  }
220  else
221  {
222  if ( !add( &b.onedimstorage_[idx], &pos ) )
223  return false;
224  }
225  }
226 
227  return true;
228 }
229 
230 
231 template <class T> inline
233 { return allowduplicates_; }
234 
235 
236 template <class T> inline
238 {
239  const bool res = allowduplicates_;
240  allowduplicates_ = nv;
241  for ( int idx=lowerdimstorage_.size()-1; idx>=0; idx-- )
242  lowerdimstorage_[idx]->allowDuplicates( nv );
243 
244  if ( !nv && res )
246 
247  return res;
248 }
249 
250 
251 template <class T> inline
253 {
254  if ( nrdims_==1 )
255  return positions_.isEmpty();
256 
257  for ( int idx=lowerdimstorage_.size()-1; idx>=0; idx-- )
258  if ( !lowerdimstorage_[idx]->isEmpty() )
259  return false;
260 
261  return true;
262 }
263 
264 
265 template <class T> inline
267 {
268  if ( nrdims_==1 )
269  return positions_.size();
270 
271  int sum = 0;
272  for ( int idx=lowerdimstorage_.size()-1; idx>=0; idx-- )
273  sum += lowerdimstorage_[idx]->totalSize();
274 
275  return sum;
276 }
277 
278 
279 template <class T> inline
281 {
282  return positions_.size();
283 }
284 
285 
286 template <class T> inline
288 {
289  if ( nrdims_==1 ) return 0;
290  return lowerdimstorage_[idx];
291 }
292 
293 
294 template <class T> inline
296 {
297  if ( nrdims_==1 ) return 0;
298  return lowerdimstorage_[idx];
299 }
300 
301 
302 template <class T> inline
303 int MultiDimStorage<T>::indexOf( int pos ) const
304 { return positions_.indexOf( pos ); }
305 
306 
307 template <class T> inline
308 int MultiDimStorage<T>::getPos( int idx ) const
309 { return positions_[idx]; }
310 
311 
312 
313 template <class T> inline
314 bool MultiDimStorage<T>::getRange( int dim, Interval<int>& rg ) const
315 {
316  rg.stop = INT_MIN;
317  rg.start = INT_MAX;
318 
319  if ( !size() )
320  return false;
321 
322  getRangeI( dim, rg );
323 
324  return true;
325 }
326 
327 
328 template <class T> inline
330 {
331  if ( dim>=nrdims_ )
332  return;
333 
334  if ( dim==nrdims_-1 )
335  {
336  const int sz = positions_.size();
337  rg.include( positions_[0], false );
338  if ( sz>1 )
339  rg.include( positions_[sz-1], false );
340  return;
341  }
342 
343  for ( int idx=0; idx<lowerdimstorage_.size(); idx++ )
344  lowerdimstorage_[idx]->getRangeI( dim, rg );
345 }
346 
347 
348 
349 template <class T> inline
350 int MultiDimStorage<T>::nrDims() const { return nrdims_; }
351 
352 
353 template <class T> inline
354 int MultiDimStorage<T>::nrVals() const { return nrvals_; }
355 
356 
357 template <class T> inline
358 void MultiDimStorage<T>::setNrVals( int nn, bool keepdata )
359 {
360  if ( nn==nrvals_ )
361  return;
362 
363  if ( nrdims_!=1 )
364  {
365  for ( int idx=lowerdimstorage_.size()-1; idx>=0; idx-- )
366  lowerdimstorage_[idx]->setNrVals( nn );
367 
368  nrvals_ = nn;
369  return;
370  }
371 
372  const int nrvalstocp = mMIN( nn, nrvals_ );
373  const int nrpos = size();
374  TypeSet<T> newstorage( nrpos*nn, mUdf(T) );
375  if ( keepdata )
376  {
377  for ( int idx=0; idx<nrpos; idx++ )
378  {
379  for ( int idy=0; idy<nrvalstocp; idy++ )
380  newstorage[idx*nn+idy] = onedimstorage_[idx*nrvals_+idy];
381  }
382  }
383 
384  onedimstorage_ = newstorage;
385  nrvals_ = nn;
386 }
387 
388 
389 template <class T> template <class IDX> inline
390 T& MultiDimStorage<T>::getRef( const IDX& indexarr, int val )
391 {
392  const int index = indexarr[nrdims_-1];
393  return nrdims_==1
394  ? onedimstorage_[index*nrvals_+val]
395  : lowerdimstorage_[index]->getRef( indexarr, val );
396 }
397 
398 
399 template <class T> template <class IDX> inline
400 const T& MultiDimStorage<T>::getRef( const IDX& index, int val ) const
401 { return const_cast<MultiDimStorage<T>* >(this)->getRef(index,val); }
402 
403 
404 
405 template <class T> template <class V, class POS,class IDX> inline
406 bool MultiDimStorage<T>::add( const V& vals, const POS& posarr,
407  IDX* indexarr )
408 {
409  const int dim = nrdims_-1;
410  const int pos = mCast( int, posarr[dim] );
411  int index = findFirstPos( pos );
412 
413  const bool match = positions_.validIdx(index) && positions_[index]==pos;
414  if ( !match ) index++;
415 
416  if ( indexarr ) (*indexarr)[dim] = index;
417 
418  if ( dim )
419  {
420  if ( !match )
421  {
422  MultiDimStorage<T>* newstorage =
424  newstorage->allowDuplicates( allowduplicates_ );
425  if ( index==lowerdimstorage_.size() )
426  {
427  lowerdimstorage_ += newstorage;
428  positions_ += pos;
429  }
430  else
431  {
432  if ( index==-1 )
433  index = 0;
434 
435  lowerdimstorage_.insertAt( newstorage, index );
436  positions_.insert( index, pos );
437  }
438  }
439 
440  if ( !lowerdimstorage_[index]->add( vals, posarr, indexarr ) )
441  return false;
442  }
443  else
444  {
445  if ( !match || (match && allowduplicates_) )
446  {
447  for ( int idx=0; idx<nrvals_; idx++ )
448  {
449  const int arrpos = index*nrvals_+idx;
450  if ( arrpos>onedimstorage_.size() || arrpos<0 )
451  pErrMsg("Hmm");
452  else if ( arrpos==onedimstorage_.size() )
453  onedimstorage_ += vals[idx];
454  else
455  onedimstorage_.insert( index*nrvals_+idx, vals[idx] );
456  }
457 
458  if ( index==positions_.size() )
459  positions_ += pos;
460  else
461  positions_.insert( index, pos );
462  }
463  else if ( match )
464  {
465  for ( int idx=0; idx<nrvals_; idx++ )
466  onedimstorage_[index*nrvals_+idx] = vals[idx];
467  }
468  }
469 
470  return true;
471 }
472 
473 
474 template <class T> template <class V, class POS> inline
475 bool MultiDimStorage<T>::add( const V& vals, const POS& posarr )
476 {
477  return add<V,POS,int*>( vals, posarr, 0 );
478 }
479 
480 
481 template <class T> template<class IDX> inline
482 void MultiDimStorage<T>::remove( const IDX& indexarr )
483 {
484  const int dim = nrdims_-1;
485  const int index = indexarr[dim];
486 
487  if ( dim )
488  {
489  lowerdimstorage_[index]->remove( indexarr );
490  if ( lowerdimstorage_[index]->size() )
491  return;
492 
493  delete lowerdimstorage_[index];
495  positions_.removeSingle( index );
496  return;
497  }
498 
499  onedimstorage_.removeRange( index*nrvals_, index*nrvals_+nrvals_-1 );
500  positions_.removeSingle( index );
501 }
502 
503 
504 template <class T> template <class POS, class IDX> inline
505 bool MultiDimStorage<T>::findFirst( const POS& posarr, IDX& indexarr ) const
506 {
507  const int dim = nrdims_-1;
508  const int pos = posarr[dim];
509  const int index = findFirstPos( pos );
510 
511  if ( index==-1 || positions_[index]!=pos )
512  return false;
513 
514  indexarr[dim] = index;
515 
516  return dim ? lowerdimstorage_[index]->findFirst( posarr, indexarr ) : true;
517 }
518 
519 
520 template <class T> template <class IDX, class POS> inline
521 bool MultiDimStorage<T>::getPos( const IDX& indexarr, POS& pos ) const
522 {
523  const int dim = nrdims_-1;
524  int index = indexarr[dim];
525  if ( index>=positions_.size() )
526  return false;
527 
528  pos[dim] = positions_[index];
529  return dim ? lowerdimstorage_[index]->getPos( indexarr, pos ) : true;
530 }
531 
532 
533 template <class T> template <class IDX> inline
534 bool MultiDimStorage<T>::getIndex( int globalpos, IDX& indexarr ) const
535 {
536  const int dim = nrdims_-1;
537  int& index = indexarr[dim];
538 
539  if ( dim )
540  {
541  for ( int idx=0; idx<lowerdimstorage_.size(); idx++ )
542  {
543  const int localsum = lowerdimstorage_[idx]->totalSize();
544  if ( globalpos<localsum )
545  {
546  index = idx;
547  return lowerdimstorage_[idx]->getIndex( globalpos, indexarr );
548  }
549 
550  globalpos -= localsum;
551  }
552 
553  return false;
554  }
555 
556  if ( globalpos<positions_.size() )
557  {
558  index = globalpos;
559  return true;
560  }
561 
562  return false;
563 }
564 
565 
566 template <class T> template <class IDX> inline
567 bool MultiDimStorage<T>::next( IDX& indexarr, bool skipduplicate ) const
568 {
569  const int dim = nrdims_-1;
570  int& index = indexarr[dim];
571 
572  if ( dim )
573  {
574  if ( index<0 )
575  {
576  if ( lowerdimstorage_.size() )
577  index = 0;
578  else
579  return false;
580  }
581 
582  while ( !lowerdimstorage_[index]->next( indexarr, skipduplicate ) )
583  {
584  index++;
585  if ( index>=lowerdimstorage_.size() )
586  {
587  index = -1;
588  return false;
589  }
590  }
591 
592  return true;
593  }
594 
595  if ( index<0 )
596  {
597  if ( positions_.size() )
598  {
599  index = 0;
600  return true;
601  }
602  else
603  return false;
604  }
605 
606  const int oldpos = positions_[index];
607  do
608  {
609  index++;
610  if ( index>=positions_.size() )
611  {
612  index = -1;
613  return false;
614  }
615  } while ( skipduplicate && positions_[index]==oldpos );
616 
617  return true;
618 }
619 
620 
621 template <class T> template <class IDX> inline
622 bool MultiDimStorage<T>::prev( IDX& indexarr, bool skipduplicate ) const
623 {
624  const int dim = nrdims_-1;
625  int& index = indexarr[dim];
626  if ( dim )
627  {
628  if ( lowerdimstorage_[index]->prev( indexarr, skipduplicate ) )
629  return true;
630 
631  index--;
632  if ( index<0 )
633  return false;
634 
635  lowerdimstorage_[index]->setToLastPos( indexarr );
636  return true;
637  }
638 
639  return --index>=0;
640 }
641 
642 
643 template <class T> template<class IDX> inline
644 bool MultiDimStorage<T>::isValidPos( const IDX& indexarr ) const
645 {
646  const int dim = nrdims_-1;
647  const int index = indexarr[dim];
648 
649  if ( index<0 )
650  return false;
651 
652  if ( dim )
653  return index<lowerdimstorage_.size() &&
654  lowerdimstorage_[index]->isValidPos( indexarr );
655 
656  return index<positions_.size();
657 }
658 
659 
660 template <class T> inline
661 int MultiDimStorage<T>::findFirstPos( int index ) const
662 {
663  const bool mayhaveduplicates = allowduplicates_ && nrdims_==1;
664  int res;
665  if ( IdxAble::findPos(positions_,positions_.size(),index,-1,res) &&
666  mayhaveduplicates )
667  {
668  while ( res && positions_[res-1]==index )
669  res--;
670  }
671 
672  return res;
673 }
674 
675 
684 template <class T> template <class POS> inline
685 void MultiDimStorage<T>::getIndicesInRange(const POS& start, const POS& stop,
686  TypeSet<int>& res) const
687 {
688  TypeSet<int> curpos( nrdims_, -1 );
689  getIndicesInRangeI( start, stop, curpos, res );
690 }
691 
692 
693 template <class T> template <class POS> inline
694 void MultiDimStorage<T>::getIndicesInRangeI(const POS& startarr,
695  const POS& stoparr, TypeSet<int>& curpos, TypeSet<int>& res) const
696 {
697  const int dim = nrdims_-1;
698  const int start = startarr[dim];
699  const int stop = stoparr[dim];
700  const int sz = positions_.size();
701  if ( !sz || stop<positions_[0] || start>positions_[sz-1] )
702  return;
703 
704  int idx = findFirstPos(start);
705  if ( idx<0 ) idx = 0;
706  if ( positions_[idx]<start ) idx++;
707  for ( ; idx<sz; idx++ )
708  {
709  if ( positions_[idx]>stop )
710  break;
711 
712  curpos[dim] = idx;
713  if ( !dim )
714  res.append( curpos );
715  else
716  lowerdimstorage_[idx]->getIndicesInRangeI(startarr,stoparr,
717  curpos,res);
718  }
719 }
720 
721 
722 template <class T> template <class IDX> inline
723 void MultiDimStorage<T>::setToLastPos( IDX& indexarr ) const
724 {
725  const int dim = nrdims_-1;
726  const int index = indexarr[dim] = size()-1;
727  if ( dim )
728  lowerdimstorage_[index]->setToLastPos( indexarr );
729 }
730 
731 
732 template <class T> inline
734 {
735  if ( nrdims_!=1 ) return;
736 
737  for ( int idx=1; idx<positions_.size(); idx++ )
738  {
739  if ( positions_[idx-1]==positions_[idx] )
740  {
741  positions_.removeSingle( idx );
742  for ( int idy=0; idy<nrvals_; idy++ )
743  onedimstorage_.removeSingle( idx );
744 
745  idx--;
746  }
747  }
748 }
749 template <class T> inline
751 {
752  const int nrchunks = res.size();
753 
754  if ( !nrchunks )
755  return false;
756 
757  const int totalsize = totalSize();
758  if ( !totalsize )
759  return -1;
760 
761 
762  const int nrperchunk = mNINT32((float) totalsize / nrchunks );
763 
764  int allocidx[nrdims_];
765  int* idxs = allocidx;
766  for ( int idx=0; idx<nrdims_; idx++ )
767  idxs[idx] = -1;
768 
769  int idx=0;
770  int prevchunk = -1;
771  while ( next(idxs) )
772  {
773  int chunk = idx/nrperchunk;
774  if ( chunk>=nrchunks )
775  chunk = nrchunks-1;
776 
777  idx++;
778 
779  if ( chunk==prevchunk )
780  continue;
781 
782  for ( int idy=0; idy<nrdims_; idy++ )
783  res[chunk][idy] = idxs[idy];
784 
785  prevchunk = chunk;
786  }
787 
788  return true;
789 }
790 
791 
792 template <class T> template <class IDXS> inline
794 {
795  if ( !size() )
796  return false;
797 
798  TypeSet<long long> dimsizes;
799 
800  long long multiplicator = 1;
801  for ( int dim=0; dim<nrdims_; dim++ )
802  {
803  dimsizes += multiplicator;
804 
805  Interval<int> rg;
806  if ( getRange( dim, rg ) )
807  multiplicator *= ( rg.width()+1 );
808  }
809 
810  TypeSet<long long> sortkeys;
811  TypeSet<long long> idxs;
812 
813  for ( int idx=0; idx<indices.size(); idx++ )
814  {
815  long long sortkey = 0;
816  for ( int dim=0; dim<nrdims_; dim++ )
817  sortkey += indices[idx][dim] * dimsizes[dim];
818 
819  sortkeys += sortkey;
820  idxs += idx;
821  }
822 
823  sort_coupled( sortkeys.arr(), idxs.arr(), idxs.size() );
824 
825  TypeSet<IDXS> copy = indices;
826  for ( int idx=mCast(int,idxs.size()-1); idx>=0; idx-- )
827  indices[idx] = copy[(int)idxs[idx]];
828 
829  return true;
830 }
MultiDimStorage(int ndims, int nvals)
Definition: multidimstorage.h:118
virtual void insert(size_type, const T &)
Definition: typeset.h:368
Definition: multidimstorage.h:23
bool allowDuplicates(bool)
Definition: multidimstorage.h:237
#define mCast(tp, v)
Definition: commondefs.h:120
bool findFirst(const POS &, IDX &) const
Definition: multidimstorage.h:505
bool prev(IDX &, bool skipdups=false) const
Definition: multidimstorage.h:622
bool isEmpty() const
Definition: odset.h:43
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:173
int getPos(int idx) const
Definition: multidimstorage.h:308
int nrvals_
Definition: multidimstorage.h:113
void setNrVals(int, bool keepdata)
Definition: multidimstorage.h:358
bool getIndex(int global_pos, IDX &) const
Definition: multidimstorage.h:534
virtual T * removeSingle(size_type, bool keep_order=true)
Definition: objectset.h:464
#define mMIN(x, y)
Definition: commondefs.h:52
MultiDimStorage< T > & operator=(const MultiDimStorage< T > &)
Definition: multidimstorage.h:133
bool getRange(int dim, Interval< int > &) const
Definition: multidimstorage.h:314
virtual T * arr()
3rd party access
Definition: typeset.h:86
size_type size() const
Definition: objectset.h:48
bool append(TypeSetBase< T, I > &to, const TypeSetBase< S, J > &from)
append allowing a different type to be merged into set
Definition: typeset.h:205
T & getRef(ObjectSet< T > &objset, int i)
Definition: objectset.h:102
#define mNINT32(x)
Definition: commondefs.h:48
Set of (small) copyable elements.
Definition: commontypes.h:26
bool allowsDuplicates() const
Definition: multidimstorage.h:232
MultiDimStorage< T > * operator[](int)
Definition: multidimstorage.h:287
T width(bool allowrev=true) const
Definition: ranges.h:450
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:270
void getIndicesInRange(const POS &start, const POS &stop, TypeSet< int > &res) const
Definition: multidimstorage.h:685
virtual ~MultiDimStorage()
Definition: multidimstorage.h:146
bool isValidPos(const IDX &) const
Definition: multidimstorage.h:644
bool isEmpty() const
Definition: multidimstorage.h:252
int size() const
Definition: multidimstorage.h:280
bool add(const V &vals, const POS &pos, IDX *index=0)
Definition: multidimstorage.h:406
TypeSet< T > onedimstorage_
Definition: multidimstorage.h:108
void deepCopy(ObjectSet< T > &to, const ObjectSet< S > &from)
fill an ObjectSet with copies of the objects in the other set.
Definition: objectset.h:151
TypeSet< int > positions_
Definition: multidimstorage.h:106
bool append(const MultiDimStorage< T > &)
Definition: multidimstorage.h:183
void removeDuplicates()
Definition: multidimstorage.h:733
void getIndicesInRangeI(const POS &start, const POS &stop, TypeSet< int > &curpos, TypeSet< int > &res) const
Definition: multidimstorage.h:694
void setToLastPos(IDX &) const
Definition: multidimstorage.h:723
int nrdims_
Definition: multidimstorage.h:112
bool allowduplicates_
Definition: multidimstorage.h:109
void remove(const IDX &index)
Definition: multidimstorage.h:482
virtual bool append(const T *, size_type)
Definition: typeset.h:444
bool isOK() const
Definition: multidimstorage.h:153
int nrVals() const
Definition: multidimstorage.h:354
size_type size() const
Definition: typeset.h:263
T stop
Definition: ranges.h:91
void include(const T &, bool allowrev=true)
Definition: ranges.h:530
virtual void insertAt(T *newptr, size_type)
Definition: objectset.h:409
bool isEmpty(const char *)
void sort(ObjectSet< T > &os)
Sort ObjectSet. Must have operator > defined for elements.
Definition: objectset.h:224
int totalSize() const
Definition: multidimstorage.h:266
const T & getRef(const IDX &index, int val) const
Definition: multidimstorage.h:400
bool next(IDX &, bool skipdups=false) const
Definition: multidimstorage.h:567
ObjectSet< MultiDimStorage< T > > lowerdimstorage_
Definition: multidimstorage.h:107
int nrDims() const
Definition: multidimstorage.h:350
virtual void erase()
Definition: typeset.h:360
void setEmpty()
Definition: multidimstorage.h:174
void getRangeI(int dim, Interval< int > &) const
Definition: multidimstorage.h:329
T start
Definition: ranges.h:90
bool sort(TypeSet< IDX > &indices) const
void copy(TypeSetBase< T, I > &to, const TypeSetBase< S, I > &from)
Definition: typeset.h:221
virtual void removeSingle(size_type, bool preserver_order=true)
Definition: typeset.h:507
#define mClass(module)
Definition: commondefs.h:161
#define pErrMsg(msg)
Usual access point for programmer error messages.
Definition: errmsg.h:34
bool divide(ObjectSet< int > &) const
Definition: multidimstorage.h:750
virtual size_type indexOf(T, bool forward=true, size_type start=-1) const
Definition: typeset.h:332
virtual bool validIdx(int64_t) const
Definition: typeset.h:288
bool findPos(const T1 &posarr, T3 sz, T2 pos, T3 beforefirst, T3 &idx)
Definition: idxable.h:73
int findFirstPos(int pos) const
Definition: multidimstorage.h:661
int indexOf(int pos) const
Definition: multidimstorage.h:303
void deepErase(ObjectSet< T > &os)
empty the ObjectSet deleting all objects pointed to.
Definition: objectset.h:122
void sort_coupled(T *arr, IT *idxs, I sz)
Definition: sorting.h:40

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017