MsPASS C++ API  2.4.1.dev4+g92330b7a
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
mspass::algorithms::deconvolution::ThreeCSpike Class Reference

Sparse three-component spike used by iterative deconvolution. More...

#include <ThreeCSpike.h>

Public Member Functions

 ThreeCSpike (mspass::utility::dmatrix &d, int k)
 
 ThreeCSpike (int k, const double u0, const double u1, const double u2)
 
 ThreeCSpike (const ThreeCSpike &parent)
 
ThreeCSpikeoperator= (const ThreeCSpike &parent)
 

Public Attributes

int col
 
double u [3]
 
double amp
 

Detailed Description

Sparse three-component spike used by iterative deconvolution.

Constructor & Destructor Documentation

◆ ThreeCSpike() [1/3]

mspass::algorithms::deconvolution::ThreeCSpike::ThreeCSpike ( mspass::utility::dmatrix d,
int  k 
)

Construct a spike from the vector sample at column k.

7 {
8 try {
9 int i;
10 for (i = 0; i < 3; ++i)
11 u[i] = d(i, k);
12 col = k;
13 for (i = 0, amp = 0.0; i < 3; ++i)
14 amp += u[i] * u[i];
15 amp = sqrt(amp);
16 } catch (...) {
17 throw;
18 };
19}
double amp
Definition ThreeCSpike.h:23
double u[3]
Definition ThreeCSpike.h:21
int col
Definition ThreeCSpike.h:19

References amp, col, and u.

◆ ThreeCSpike() [2/3]

mspass::algorithms::deconvolution::ThreeCSpike::ThreeCSpike ( int  k,
const double  u0,
const double  u1,
const double  u2 
)

Construct a spike from explicit three-component amplitudes.

21 {
22 col = k;
23 u[0] = u0;
24 u[1] = u1;
25 u[2] = u2;
26 amp = sqrt(u0 * u0 + u1 * u1 + u2 * u2);
27}

References amp, col, and u.

◆ ThreeCSpike() [3/3]

mspass::algorithms::deconvolution::ThreeCSpike::ThreeCSpike ( const ThreeCSpike parent)

Copy constructor.

28 {
29 col = parent.col;
30 amp = parent.amp;
31 for (int k = 0; k < 3; ++k)
32 u[k] = parent.u[k];
33}

References amp, col, and u.

Member Function Documentation

◆ operator=()

ThreeCSpike & mspass::algorithms::deconvolution::ThreeCSpike::operator= ( const ThreeCSpike parent)

Assignment operator required for STL containers.

34 {
35 if (this != (&parent)) {
36 col = parent.col;
37 amp = parent.amp;
38 for (int k = 0; k < 3; ++k)
39 u[k] = parent.u[k];
40 }
41 return *this;
42}

References amp, col, and u.

Member Data Documentation

◆ amp

double mspass::algorithms::deconvolution::ThreeCSpike::amp

Cached L2 norm of u.

◆ col

int mspass::algorithms::deconvolution::ThreeCSpike::col

Column index where this spike is placed in a three-component matrix.

◆ u

double mspass::algorithms::deconvolution::ThreeCSpike::u[3]

Three-component spike amplitude.


The documentation for this class was generated from the following files: