13 #include "generalmod.h" 19 template <
class IPT,
class FT>
class ValueIdxPair;
20 template <
class IPT,
class FT>
class IdxPairValues;
46 IdxPairValueSet(
int nr_vals,
bool allow_dupl_idxpairs);
48 IdxPairValueSet& operator =(
const IdxPairValueSet&);
51 {
return data_.allowDuplicateIdxPairs(yn); }
53 {
return data_.allowsDuplicateIdxPairs(); }
56 bool append(
const IdxPairValueSet& oth )
57 {
return data_.append( oth.
data_ ); }
58 void remove(
const IdxPairValueSet& oth )
59 { data_.remove( oth.data_ ); }
60 void copyStructureFrom(
const IdxPairValueSet&);
64 {
return data_.find( ip ); }
66 {
return data_.findOccurrence( ip, occ ); }
67 bool next( SPos& spos,
bool skip_dupl_idxpairs=
false )
const 68 {
return data_.next( spos, skip_dupl_idxpairs ); }
69 bool prev( SPos& spos,
bool skip_dupl_idxpairs=
false )
const 70 {
return data_.prev( spos, skip_dupl_idxpairs ); }
72 {
return data_.isValid( spos ); }
74 void get(
const SPos&,
float* v=0,
int mxnrvals=-1)
const;
75 void get(
const SPos&,
IdxPair&,
float* v=0,
int mxnrv=-1)
const;
77 {
return data_.getIdxPair( spos ); }
78 SPos
getPos(GlobIdxType global_idx)
const 79 {
return data_.getPos( global_idx ); }
80 SPos add(
const IdxPair&,
const float* vs=0);
82 SPos add(
const DataRow&);
84 void set(SPos,
const float* vs=0);
94 {
return data_.nrFirst(); }
95 inline IdxType
nrSecond( IdxType firstidx )
const 96 {
return data_.nrSecond(firstidx); }
98 {
return data_.isEmpty(); }
99 inline bool includes(
const IdxPair& ip )
const 100 {
return data_.includes( ip ); }
102 {
return data_.hasFirst( inl ); }
104 {
return data_.hasSecond( crl ); }
106 {
return data_.firstIdxPair(); }
108 {
return data_.totalSize(); }
110 {
return data_.firstRange(); }
112 {
return data_.secondRange( frstidx ); }
118 {
return data_.hasDuplicateIdxPairs(); }
120 {
return data_.nrDuplicateIdxPairs(); }
122 { data_.removeDuplicateIdxPairs(); }
124 { data_.randomSubselect( maxsz ); }
127 bool avoiddups=
true);
129 inline void remove(
const SPos& spos )
130 { data_.remove( spos ); }
132 { data_.remove( torem ); }
136 { data_.remove( hrg, inside ); }
140 SPos add(
const PairVal&);
141 SPos add(
const IdxPair&,
float);
142 SPos add(
const IdxPair&,
double);
143 SPos add(
const IdxPair&,
float,
float);
145 void get(
const SPos&,DataRow&)
const;
146 void get(
const SPos&,PairVal&)
const;
147 void get(
const SPos&,IdxPair&,
float&)
const;
148 void get(
const SPos&,IdxPair&,
float&,
float&)
const;
150 int mxnrvals=-1)
const;
151 void get(
const SPos&,TypeSet<float>&,
int maxnrvals=-1)
const;
152 void set(
const SPos&,float);
153 void set(
const SPos&,float,float);
154 void set(
const SPos&,
const TypeSet<float>&);
155 void getColumn(
int valnr,TypeSet<float>&,
bool incudf)
const;
166 inline ArrIdxType
nrPos( ArrIdxType lineidx )
const 167 {
return data_.nrPos(lineidx); }
168 float* getVals(
const SPos&);
170 const float* getVals(
const SPos&)
const;
172 float getVal(
const SPos& pos,
int valnr)
const;
174 bool haveDataRow(
const DataRow&)
const;
177 inline ArrIdxType
nrInls()
const {
return nrFirst(); }
178 inline ArrIdxType
nrCrls( IdxType inl )
const {
return nrSecond(inl); }
179 inline ArrIdxType
nrRows()
const {
return nrFirst(); }
180 inline ArrIdxType
nrCols( IdxType row )
const {
return nrSecond(row); }
181 bool hasInl( IdxType inl )
const {
return hasFirst(inl); }
182 bool hasCrl( IdxType crl )
const {
return hasSecond(crl); }
183 inline bool hasRow( IdxType row )
const {
return hasFirst(row); }
184 inline bool hasCol( IdxType col )
const {
return hasSecond(col); }
188 {
return secondRange(inl); }
190 {
return secondRange(row); }
198 {
return (
float*)data_.
getObj( spos ); }
199 inline const float*
gtVals(
const SPos& spos )
const 200 {
return (
const float*)data_.
getObj( spos ); }
#define mExpClass(module)
Definition: commondefs.h:157
Interval< IdxType > firstRange() const
Definition: posidxpairvalset.h:109
IdxPair firstIdxPair() const
Definition: posidxpairvalset.h:105
ArrIdxType nrInls() const
Definition: posidxpairvalset.h:177
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:25
Interval< IdxType > secondRange(IdxType frstidx=-1) const
Definition: posidxpairvalset.h:111
bool isValid(const IdxPair &spos) const
Definition: posidxpairvalset.h:71
const float * gtVals(const SPos &spos) const
Definition: posidxpairvalset.h:199
Set of data points with group selection.
Definition: datapointset.h:47
ArrIdxType nrCols(IdxType row) const
Definition: posidxpairvalset.h:180
IdxPairDataSet data_
Definition: posidxpairvalset.h:195
IdxType nrSecond(IdxType firstidx) const
Definition: posidxpairvalset.h:95
IdxPair with a value.
Definition: posidxpairvalue.h:27
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
bool hasCol(IdxType col) const
Definition: posidxpairvalset.h:184
#define od_int64
Definition: plftypes.h:34
IdxPair with position indices; base class for BinID et al.
Definition: posidxpair.h:27
IdxPairDataSet::SPos SPos
Definition: posidxpairvalset.h:42
bool includes(const IdxPair &ip) const
Definition: posidxpairvalset.h:99
ValueIdxPair< IdxPair, float > PairVal
Definition: posidxpairvalset.h:40
TypeSet< IdxType >::size_type ArrIdxType
Definition: posidxpairdataset.h:65
IdxPair::IdxType IdxType
Definition: posidxpairvalset.h:39
IdxType nrFirst() const
Definition: posidxpairvalset.h:93
ArrIdxType nrRows() const
Definition: posidxpairvalset.h:179
IdxPair with 0-N values.
Definition: posidxpairvalue.h:21
bool hasDuplicateIdxPairs() const
Definition: posidxpairvalset.h:117
ArrIdxType nrDuplicateIdxPairs() const
Definition: posidxpairvalset.h:119
OD class for stream read.
Definition: od_istream.h:23
const void * getObj(SPos) const
bool prev(SPos &spos, bool skip_dupl_idxpairs=false) const
Definition: posidxpairvalset.h:69
void allowDuplicateIdxPairs(bool yn)
Definition: posidxpairvalset.h:50
A sorted set of IdxPairs and associated data buffer.
Definition: posidxpairdataset.h:60
IdxPair getIdxPair(const SPos &spos) const
Definition: posidxpairvalset.h:76
IdxPairDataSet::GlobIdxType GlobIdxType
Definition: posidxpairvalset.h:44
Interval< IdxType > inlRange() const
Definition: posidxpairvalset.h:185
virtual ~IdxPairValueSet()
Definition: posidxpairvalset.h:47
uses an IdxPairDataSet to hold arrays of floats
Definition: posidxpairvalset.h:35
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:25
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:270
void setEmpty()
Definition: posidxpairvalset.h:54
Position.
Definition: commontypes.h:38
bool hasInl(IdxType inl) const
Definition: posidxpairvalset.h:181
od_int64 GlobIdxType
Definition: posidxpairdataset.h:67
void removeDuplicateIdxPairs()
Definition: posidxpairvalset.h:121
IdxPairValues< IdxPair, float > DataRow
Definition: posidxpairvalset.h:41
bool allowsDuplicateIdxPairs() const
Definition: posidxpairvalset.h:52
bool hasRow(IdxType row) const
Definition: posidxpairvalset.h:183
void removeRange(ODSET &inst, size_type start, size_type stop)
Removes a range from the set.
Definition: odset.h:55
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
Interval< IdxType > crlRange(IdxType inl=-1) const
Definition: posidxpairvalset.h:187
Index_Type GeomID
Definition: commontypes.h:48
bool hasCrl(IdxType crl) const
Definition: posidxpairvalset.h:182
bool isEmpty() const
Definition: posidxpairvalset.h:97
ArrIdxType nrCrls(IdxType inl) const
Definition: posidxpairvalset.h:178
Index_Type IdxType
Definition: idxpair.h:32
GlobIdxType totalSize() const
Definition: posidxpairvalset.h:107
SPos findOccurrence(const IdxPair &ip, int occ=0) const
Definition: posidxpairvalset.h:65
IdxPairDataSet::ArrIdxType ArrIdxType
Definition: posidxpairvalset.h:43
void randomSubselect(od_int64 maxsz)
Definition: posidxpairvalset.h:123
SPos find(const IdxPair &ip) const
Definition: posidxpairvalset.h:63
const int nrvals_
Definition: posidxpairvalset.h:194
float * gtVals(const SPos &spos)
Definition: posidxpairvalset.h:197
SPos getPos(GlobIdxType global_idx) const
Definition: posidxpairvalset.h:78
bool append(const IdxPairValueSet &oth)
Definition: posidxpairvalset.h:56
bool hasSecond(IdxType crl) const
Definition: posidxpairvalset.h:103
Set Position: position in IdxPairDataSet.
Definition: posidxpairdataset.h:75
bool next(SPos &spos, bool skip_dupl_idxpairs=false) const
Definition: posidxpairvalset.h:67
Position info for an entire 3D cube. The LineData's are not sorted.
Definition: posinfo.h:96
Data set consisting of data vectors.
Definition: posvecdataset.h:29
int nrVals() const
Definition: posidxpairvalset.h:91
Interval< IdxType > colRange(IdxType row=-1) const
Definition: posidxpairvalset.h:189
ArrIdxType nrPos(ArrIdxType lineidx) const
Definition: posidxpairvalset.h:166
Interval< IdxType > rowRange() const
Definition: posidxpairvalset.h:186
bool hasFirst(IdxType inl) const
Definition: posidxpairvalset.h:101