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

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