OpendTect  6.3
variogrammodels.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: A. Huck & H.Huck
8  Date: 27-09-2011
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include <math.h>
15 
16 
17 inline void getVariogramModel( const char* typestr, float nugget, float sill,
18  float range, int size, float* in, float* out )
19 {
20  const FixedString type( typestr );
21  if ( type=="exponential" )
22  {
23  for ( int idx=0; idx<size; idx++ )
24  out[idx] = (sill-nugget)*(1-exp(-3*in[idx]/range))+nugget;
25  }
26  else if ( type=="gaussian" )
27  {
28  for ( int idx=0; idx<size; idx++ )
29  {
30  out[idx] = (sill-nugget)*
31  (1-exp(-3*((in[idx]*in[idx])/(range*range))))+
32  nugget;
33  }
34  }
35  else if ( type=="spherical" )
36  {
37  for ( int idx=0; idx<size; idx++ )
38  {
39  if ( in[idx] < range )
40  {
41  out[idx] = (sill-nugget)*(((3*in[idx])/(2*range))-
42  ((in[idx]*in[idx]*in[idx])/(2*range*range*range)))
43  +nugget;
44  }
45  else
46  out[idx] = sill;
47  }
48  }
49 }
OD::String that holds an existing text string.
Definition: fixedstring.h:27
void getVariogramModel(const char *typestr, float nugget, float sill, float range, int size, float *in, float *out)
Definition: variogrammodels.h:17

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