EMAN2
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
EMAN::Interp Class Reference

Interp defines the interpolation function used to generate a e^-x^4 function in real space. More...

#include <interp.h>

Static Public Member Functions

static float get_hyperg (int i)
 
static float hyperg (float v)
 
static float * get_gimx ()
 

Static Private Member Functions

static void init_gimx ()
 

Static Private Attributes

static float HYPERGEOM []
 
static float * gimx = 0
 

Detailed Description

Interp defines the interpolation function used to generate a e^-x^4 function in real space.

Used for Fourier interpolation

Definition at line 43 of file interp.h.

Member Function Documentation

◆ get_gimx()

static float * EMAN::Interp::get_gimx ( )
inlinestatic

Definition at line 62 of file interp.h.

63 {
64 if (!gimx) {
65 init_gimx();
66 }
67 return gimx;
68 }
static float * gimx
Definition: interp.h:75
static void init_gimx()
Definition: interp.cpp:1711

References gimx, and init_gimx().

Referenced by EMAN::GaussFFTProjector::interp_ft_3d().

◆ get_hyperg()

static float EMAN::Interp::get_hyperg ( int  i)
inlinestatic

Definition at line 46 of file interp.h.

47 {
48 return HYPERGEOM[i];
49 }
static float HYPERGEOM[]
Definition: interp.h:74

References HYPERGEOM.

◆ hyperg()

static float EMAN::Interp::hyperg ( float  v)
inlinestatic

Definition at line 51 of file interp.h.

52 {
53 if (v < 0 || v > 4.998f) {
54 return 0;
55 }
56 float r = v / 0.001f;
57 int a = (int) floor(r);
58 r -= a;
59 return (float)(-(HYPERGEOM[a] * (1.0 - r) + HYPERGEOM[a + 1] * r));
60 }

References HYPERGEOM.

Referenced by EMAN::GaussFFTProjector::interp_ft_3d().

◆ init_gimx()

void Interp::init_gimx ( )
staticprivate

Definition at line 1711 of file interp.cpp.

1712{
1713 const int size = 100;
1714 gimx = new float[size * size * size];
1715 const float g = (float) (10.4 / (M_PI * M_PI)); // magic number here
1716
1717 for (int k = 0; k < size; k++) {
1718 for (int j = 0; j < size; j++) {
1719 for (int i = 0; i < size; i++) {
1720 float r = Util::hypot3(i / 39.0f, j / 39.0f, k / 39.0f);
1721 gimx[i + j * size + k * size * size] = exp(-r / g);
1722 }
1723 }
1724 }
1725}
static float hypot3(int x, int y, int z)
Euclidean distance function in 3D: f(x,y,z) = sqrt(x*x + y*y + z*z);.
Definition: util.h:827

References gimx, and EMAN::Util::hypot3().

Referenced by get_gimx().

Member Data Documentation

◆ gimx

float * Interp::gimx = 0
staticprivate

Definition at line 75 of file interp.h.

Referenced by get_gimx(), and init_gimx().

◆ HYPERGEOM

float Interp::HYPERGEOM
staticprivate

Definition at line 74 of file interp.h.

Referenced by get_hyperg(), and hyperg().


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