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

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