OpendTect-6_4  6.4
Namespaces | Enumerations | Functions
simpnumer.h File Reference
Include dependency graph for simpnumer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Interpolate
 
 Taper
 Taper an indexable array from 1 to taperfactor. If lowpos is less than highpos, the samples array[0] to array[lowpos] will be set to zero. If lowpos is more than highpos, the samples array[lowpos] to array[sz-1] will be set to zero. The taper can be either cosine or linear.
 

Enumerations

enum  Taper::Type { Taper::Cosine, Taper::Linear }
 

Functions

int Interpolate::getArrIdxPosition (const float farridx, const int arrsz, float &relpos, const float eps=1e-4)
 
template<class T >
greatestCommonDivisor (T val0, T val1)
 
template<class T >
StepInterval< T > getCommonStepInterval (const StepInterval< T > &a, const StepInterval< T > &b)
 
template<class iT >
iT exactPower (iT val, iT base)
 
template<class iT >
iT nextPower (iT val, iT base)
 
template<class iT >
iT getPow2Sz (iT actsz, const bool above=true, iT minsz=1, iT maxsz=0)
 
template<class iT >
iT nextPower2 (iT nr, iT minnr, iT maxnr)
 
template<class iT >
iT nrBlocks (iT totalsamples, iT basesize, iT overlapsize)
 
template<class T >
bool taperArray (T *array, int sz, int lowpos, int highpos, Taper::Type type)
 
template<class T >
sampledGradient (T ym2, T ym1, T y0_, T y1_, T y2)
 
template<class X , class Y , class RT >
void getGradient (const X &x, const Y &y, int sz, int firstx, int firsty, RT *gradptr=0, RT *interceptptr=0)
 
template<class X >
float variance (const X &x, int sz)
 
int solve3DPoly (double a, double b, double c, double &root0, double &root1, double &root2)
 
template<class T >
bool holdsClassValue (const T val, const unsigned int maxclss=50)
 
template<class T >
bool holdsClassValues (const T *vals, od_int64 sz, const unsigned int maxclss=50, const unsigned int samplesz=100)
 
template<class T >
bool isSigned8BitesValue (const T val)
 
template<class T >
bool is8BitesData (const T *vals, od_int64 sz, const unsigned int samplesz=100)
 

Function Documentation

template<class iT >
iT exactPower ( iT  val,
iT  base 
)
inline

exactPower determines whether a value is a power of a base, i.e. if

val=base^pow. If that is the case, exactPower returns pow, if not, it returns zero.

template<class T >
StepInterval<T> getCommonStepInterval ( const StepInterval< T > &  a,
const StepInterval< T > &  b 
)
inline

Computes a StepInterval where all samples of both input StepInterval's

are present.

template<class X , class Y , class RT >
void getGradient ( const X &  x,
const Y &  y,
int  sz,
int  firstx,
int  firsty,
RT *  gradptr = 0,
RT *  interceptptr = 0 
)
inline
template<class iT >
iT getPow2Sz ( iT  actsz,
const bool  above = true,
iT  minsz = 1,
iT  maxsz = 0 
)
inline
template<class T >
T greatestCommonDivisor ( val0,
val1 
)
inline

Computes the greatest common divisor from two intigers. Uses the algorithm published by Josef Stein.

template<class T >
bool holdsClassValue ( const T  val,
const unsigned int  maxclss = 50 
)
inline
template<class T >
bool holdsClassValues ( const T *  vals,
od_int64  sz,
const unsigned int  maxclss = 50,
const unsigned int  samplesz = 100 
)
inline
template<class T >
bool is8BitesData ( const T *  vals,
od_int64  sz,
const unsigned int  samplesz = 100 
)
inline
template<class T >
bool isSigned8BitesValue ( const T  val)
inline
template<class iT >
iT nextPower ( iT  val,
iT  base 
)
inline
template<class iT >
iT nextPower2 ( iT  nr,
iT  minnr,
iT  maxnr 
)
inline
template<class iT >
iT nrBlocks ( iT  totalsamples,
iT  basesize,
iT  overlapsize 
)
inline

Find number of blocks when given total number of samples, the base size for each block and the number of samples overlaped between two blocks.

template<class T >
T sampledGradient ( ym2,
ym1,
y0_,
y1_,
y2 
)
inline

Gradient from a series of 4 points, sampled like: x: -2 -1 0 1 2 y: ym2 ym1 y0 y1 y2 The gradient estimation is done at x=0. y0 is generally not needed, but it will be used if there are one or more undefineds. The function will return mUdf(T) if there are too many missing values.

int solve3DPoly ( double  a,
double  b,
double  c,
double &  root0,
double &  root1,
double &  root2 
)
inline

solve3DPoly - finds the roots of the equation

z^3+a*z^2+b*z+c = 0

solve3DPoly returns the number of real roots found.

Algorithms taken from NR, page 185.

The complex roots can be calculated as follows: const double sqrt3_through_2 = Math::Sqrt(3)/2;

root1 = complex_double( 0.5*(A+B)+minus_a_through_3, sqrt3_through_2*(A-B));

root2 = complex_double( 0.5*(A+B)+minus_a_through_3, -sqrt3_through_2*(A-B));

template<class T >
bool taperArray ( T *  array,
int  sz,
int  lowpos,
int  highpos,
Taper::Type  type 
)
template<class X >
float variance ( const X &  x,
int  sz 
)
inline

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