OpendTect  6.6
linear.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.H.Bril
8  Date: Jan 2005
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 
15 #include "algomod.h"
16 #include "mathfunc.h"
17 namespace Geom { template <class T> class Point2D; }
18 
19 
24 template <class T>
26 {
27 public:
28  LineParameters( T i0=0, T i1=0 )
29  : a0(i0), ax(i1) {}
30 
31  inline T getValue( T x ) const
32  { return a0 + ax * x; }
33  inline T getXValue( T y ) const
34  { return ax ? (y - a0) / ax : 0; }
35  inline T getProjectedX( T x, T y ) const
36  { return (x + ax * (y - a0)) / (1 + ax * ax); }
37  inline T getValue( const T* x ) const
38  { return getValue(*x); }
39 
40  T a0, ax;
41 };
42 
44 
45 
50 template <class T>
52 {
53 public:
54  PlaneParameters( T i0=0, T i1=0, T i2=0 )
55  : a0(i0), ax(i1), ay(i2) {}
56 
57  inline T getValue( T x, T y ) const
58  { return a0 + ax * x + ay * y; }
59  inline T getValue( const T* x ) const
60  { return getValue(x[0],x[1]); }
61 
62  T a0, ax, ay;
63 
64 };
65 
67 
68 
74 {
75 public:
76  LinStats2D() : corrcoeff(0) {}
77 
80  float corrcoeff;
81 
82  void use(const float*,const float*,int nrpts);
83  void use(const Geom::Point2D<float>*,int nrpts);
84 };
85 
86 
92 {
93 public:
94  LinStats3D() : corrcoeff(0) {}
95 
98  float corrcoeff;
99 
100 };
101 
102 
LinStats3D::LinStats3D
LinStats3D()
Definition: linear.h:94
LineParameters::LineParameters
LineParameters(T i0=0, T i1=0)
Definition: linear.h:28
LinStats2D::sd
LinePars sd
Standard deviations in parameters.
Definition: linear.h:79
LinStats2D::use
void use(const Geom::Point2D< float > *, int nrpts)
LineParameters::getValue
T getValue(T x) const
Definition: linear.h:31
MathXYFunction< T, T >
LinStats2D
linear stats in 2D.
Definition: linear.h:74
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
LineParameters::getProjectedX
T getProjectedX(T x, T y) const
Definition: linear.h:35
LinStats3D::corrcoeff
float corrcoeff
Correlation coefficient.
Definition: linear.h:98
LinStats2D::corrcoeff
float corrcoeff
Correlation coefficient.
Definition: linear.h:80
PlaneParameters::getValue
T getValue(const T *x) const
Definition: linear.h:59
MathFunction< T, T >
LinStats3D::pp
PlanePars pp
Parameters.
Definition: linear.h:96
PlanePars
PlaneParameters< float > PlanePars
Definition: linear.h:66
LineParameters::getValue
T getValue(const T *x) const
Definition: linear.h:37
LinePars
LineParameters< float > LinePars
Definition: linear.h:43
mClass
#define mClass(module)
Definition: commondefs.h:181
PlaneParameters
Steepnesses and intercept.
Definition: linear.h:52
LinStats2D::lp
LinePars lp
Parameters.
Definition: linear.h:78
PlaneParameters::PlaneParameters
PlaneParameters(T i0=0, T i1=0, T i2=0)
Definition: linear.h:54
LineParameters::getXValue
T getXValue(T y) const
Definition: linear.h:33
LineParameters
Steepness and intercept.
Definition: linear.h:26
LinStats3D
linear stats in 3D.
Definition: linear.h:92
mathfunc.h
LineParameters::ax
T ax
Definition: linear.h:40
Geom
Definition: geometry.h:19
Geom::Point2D< float >
LinStats2D::LinStats2D
LinStats2D()
Definition: linear.h:76
PlaneParameters::getValue
T getValue(T x, T y) const
Definition: linear.h:57
LinStats3D::sd
PlanePars sd
Standard deviations in parameters.
Definition: linear.h:97
PlaneParameters::ay
T ay
Definition: linear.h:62
LinStats2D::use
void use(const float *, const float *, int nrpts)

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