OpendTect-6_4  6.4
linear.h
Go to the documentation of this file.
1 #ifndef linear_h
2 #define linear_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H.Bril
9  Date: Jan 2005
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 
16 #include "algomod.h"
17 #include "mathfunc.h"
18 namespace Geom { template <class T> class Point2D; }
19 
20 
25 template <class T>
26 mClass(Algo) LineParameters : public MathFunction<T,T>
27 {
28 public:
29  LineParameters( T i0=0, T i1=0 )
30  : a0(i0), ax(i1) {}
31 
32  inline T getValue( T x ) const
33  { return a0 + ax * x; }
34  inline T getXValue( T y ) const
35  { return ax ? (y - a0) / ax : 0; }
36  inline T getProjectedX( T x, T y ) const
37  { return (x + ax * (y - a0)) / (1 + ax * ax); }
38  inline T getValue( const T* x ) const
39  { return getValue(*x); }
40 
41  T a0, ax;
42 };
43 
45 
46 
51 template <class T>
53 {
54 public:
55  PlaneParameters( T i0=0, T i1=0, T i2=0 )
56  : a0(i0), ax(i1), ay(i2) {}
57 
58  inline T getValue( T x, T y ) const
59  { return a0 + ax * x + ay * y; }
60  inline T getValue( const T* x ) const
61  { return getValue(x[0],x[1]); }
62 
63  T a0, ax, ay;
64 
65 };
66 
68 
69 
75 {
76 public:
77  LinStats2D() : corrcoeff(0) {}
78 
81  float corrcoeff;
82 
83  void use(const float*,const float*,int nrpts);
84  void use(const Geom::Point2D<float>*,int nrpts);
85 };
86 
87 
93 {
94 public:
95  LinStats3D() : corrcoeff(0) {}
96 
99  float corrcoeff;
100 
101 };
102 
103 
104 #endif
LineParameters< float > LinePars
Definition: linear.h:44
#define mExpClass(module)
Definition: commondefs.h:160
T getXValue(T y) const
Definition: linear.h:34
Steepness and intercept.
Definition: linear.h:26
LinePars lp
Parameters.
Definition: linear.h:79
PlanePars sd
Standard deviations in parameters.
Definition: linear.h:98
T ay
Definition: linear.h:63
LineParameters(T i0=0, T i1=0)
Definition: linear.h:29
Mathematical function.
Definition: mathfunc.h:61
linear stats in 2D.
Definition: linear.h:74
LinStats2D()
Definition: linear.h:77
T ax
Definition: linear.h:41
T getValue(T x) const
Definition: linear.h:32
PlaneParameters< float > PlanePars
Definition: linear.h:67
T getValue(const T *x) const
Definition: linear.h:38
T getValue(const T *x) const
Definition: linear.h:60
Steepnesses and intercept.
Definition: linear.h:52
A Math Function as in F(x,y).
Definition: mathfunc.h:105
T getValue(T x, T y) const
Definition: linear.h:58
LinePars sd
Standard deviations in parameters.
Definition: linear.h:80
LinStats3D()
Definition: linear.h:95
linear stats in 3D.
Definition: linear.h:92
T getProjectedX(T x, T y) const
Definition: linear.h:36
PlanePars pp
Parameters.
Definition: linear.h:97
Definition: geometry.h:19
PlaneParameters(T i0=0, T i1=0, T i2=0)
Definition: linear.h:55
#define mClass(module)
Definition: commondefs.h:164
float corrcoeff
Correlation coefficient.
Definition: linear.h:99
float corrcoeff
Correlation coefficient.
Definition: linear.h:81

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