26 template <
class IPT,
class FT>
35 : IPT(f,s), val_(v) {}
43 {
return !(*
this == vip); }
47 FT&
val() {
return val_; }
48 FT
val()
const {
return val_; }
49 inline operator FT&() {
return val_; }
50 inline operator FT()
const {
return val_; }
52 inline void set( FT f ) { val_ = f; }
53 inline void set(
const IPT& ipt ) { IPT::operator=( ipt ); }
54 inline void set(
const IPT& ipt, FT f ) {
set( ipt );
set( f ); }
73 template <
class IPT,
class FT>
85 : IPT(i1,i2) { setSize(nrvals); }
87 : IPT(p) { setSize(nrvals); }
89 : IPT() { *
this = oth; }
91 : IPT(vip) { setSize(1); value(0) = vip; }
95 {
return !(*
this == ipvs); }
99 inline bool validIdx(
int i )
const {
return vals_.validIdx(i); }
100 inline size_type
size()
const {
return vals_.size(); }
101 inline FT&
value(
int idx ) {
return vals_[idx]; }
102 inline FT
value(
int idx )
const {
return vals_[idx]; }
103 inline FT*
values() {
return vals_.arr(); }
104 inline const FT*
values()
const {
return vals_.arr(); }
106 inline FT
operator[](
int idx )
const {
return value( idx ); }
107 inline set_type&
valSet() {
return vals_; }
108 inline const set_type&
valSet()
const {
return vals_; }
109 inline operator FT*() {
return values(); }
110 inline operator const FT*()
const {
return values(); }
112 inline void setSize(size_type,
bool kpvals=
false);
113 inline void setVals(
const FT*);
114 inline void set(int,FT);
115 inline void set(
const IPT& ipt ) { IPT::operator=( ipt ); }
117 inline bool isUdf(
bool allvalsudf=
true)
const;
126 template <
class IPT,
class FT>
inline 129 IPT::operator=( ipvs );
134 template <
class IPT,
class FT>
inline 137 if ( !equalPos( oth ) )
142 const FT valdiff = val_ - oth.
val_;
147 template <
class IPT,
class FT>
inline 152 if ( sz != size() || !equalPos( oth ) )
157 const FT myval = value(idx);
158 const FT othval = oth.
value(idx);
163 const FT valdiff = myval - othval;
172 template <
class IPT,
class FT>
inline 186 vals_ += idx<orgsz ? tmp[idx] :
mUdf(
float);
190 template <
class IPT,
class FT>
inline 195 vals_[idx] = newvals ? newvals[idx] :
mUdf(
float);
199 template <
class IPT,
class FT>
inline 207 template <
class IPT,
class FT>
inline 216 const FT val = vals_[idx];
217 const bool isudf =
mIsUdf(val);
218 if ( isudf && anyvaludf )
220 else if ( !isudf && !anyvaludf )
#define mExpClass(module)
Definition: commondefs.h:157
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:285
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
bool operator==(const IdxPairValues &) const
Definition: posidxpairvalue.h:148
TypeSet< FT >::size_type size_type
Definition: posidxpairvalue.h:81
bool equalPos(const IPT &ip) const
Definition: posidxpairvalue.h:96
#define mIsZero(x, eps)
Definition: commondefs.h:55
IdxPair with a value.
Definition: posidxpairvalue.h:27
const set_type & valSet() const
Definition: posidxpairvalue.h:108
IPT pos_type
Definition: posidxpairvalue.h:31
IdxPairValues(int i1, int i2, int nrvals)
Definition: posidxpairvalue.h:84
IdxPair with 0-N values.
Definition: posidxpairvalue.h:21
bool validIdx(int i) const
Definition: posidxpairvalue.h:99
size_type size() const
Definition: posidxpairvalue.h:100
set_type & valSet()
Definition: posidxpairvalue.h:107
FT * values()
Definition: posidxpairvalue.h:103
FT & value(int idx)
Definition: posidxpairvalue.h:101
ValueIdxPair(const IPT &b, FT v=Values::Undef< FT >::val())
Definition: posidxpairvalue.h:36
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:270
IdxPairValues()
Definition: posidxpairvalue.h:83
void setSize(size_type, bool kpvals=false)
Definition: posidxpairvalue.h:173
Position.
Definition: commontypes.h:38
bool isUdf() const
Definition: posidxpairvalue.h:57
TypeSet< FT > vals_
Definition: posidxpairvalue.h:121
FT operator[](int idx) const
Definition: posidxpairvalue.h:106
bool operator!=(const IdxPairValues &ipvs) const
Definition: posidxpairvalue.h:94
FT & operator[](int idx)
Definition: posidxpairvalue.h:105
ValueIdxPair(int f=0, int s=0, FT v=Values::Undef< FT >::val())
Definition: posidxpairvalue.h:34
void set(int, FT)
Definition: posidxpairvalue.h:200
#define mDefEps
Definition: commondefs.h:60
IdxPairValues(const IdxPairValues &oth)
Definition: posidxpairvalue.h:88
size_type size() const
Definition: typeset.h:263
FT value_type
Definition: posidxpairvalue.h:79
FT val_
Definition: posidxpairvalue.h:62
FT value(int idx) const
Definition: posidxpairvalue.h:102
bool operator==(const ValueIdxPair &) const
Definition: posidxpairvalue.h:135
bool operator!=(const ValueIdxPair &vip) const
Definition: posidxpairvalue.h:42
FT val() const
Definition: posidxpairvalue.h:48
IPT pos_type
Definition: posidxpairvalue.h:78
TypeSet< FT > set_type
Definition: posidxpairvalue.h:80
void setVals(const FT *)
Definition: posidxpairvalue.h:191
IdxPairValues(const ValueIdxPair< IPT, FT > &vip)
Definition: posidxpairvalue.h:90
bool isUdf(bool allvalsudf=true) const
Definition: posidxpairvalue.h:208
#define mClass(module)
Definition: commondefs.h:161
void set(FT f)
Definition: posidxpairvalue.h:52
bool isUdf(const T &t)
Definition: undefval.h:241
bool equalPos(const IPT &ip) const
Definition: posidxpairvalue.h:44
ValueIdxPair(const IdxPairValues< IPT, FT > &ipvs, int idx=0)
Definition: posidxpairvalue.h:38
FT & val()
Definition: posidxpairvalue.h:47
FT value_type
Definition: posidxpairvalue.h:32
IdxPairValues(const IPT &p, int nrvals)
Definition: posidxpairvalue.h:86
const FT * values() const
Definition: posidxpairvalue.h:104