EMAN2
Functions
pointarray.cpp File Reference
#include "pointarray.h"
#include "util.h"
#include "vec3.h"
#include <vector>
#include <cstring>
#include <boost/random.hpp>
Include dependency graph for pointarray.cpp:

Go to the source code of this file.

Functions

int cmp_axis_x (const void *a, const void *b)
 
int cmp_axis_y (const void *a, const void *b)
 
int cmp_axis_z (const void *a, const void *b)
 
int cmp_val (const void *a, const void *b)
 
int cmp_float (const void *a, const void *b)
 

Function Documentation

◆ cmp_axis_x()

int cmp_axis_x ( const void *  a,
const void *  b 
)

Definition at line 50 of file pointarray.cpp.

51{
52 double diff = ((double *) a)[0] - ((double *) b)[0];
53 if (diff < 0.0)
54 return -1;
55 else if (diff > 0.0)
56 return 1;
57 else
58 return 0;
59}

Referenced by EMAN::PointArray::sort_by_axis().

◆ cmp_axis_y()

int cmp_axis_y ( const void *  a,
const void *  b 
)

Definition at line 60 of file pointarray.cpp.

61{
62 double diff = ((double *) a)[1] - ((double *) b)[1];
63 if (diff < 0.0)
64 return -1;
65 else if (diff > 0.0)
66 return 1;
67 else
68 return 0;
69}

Referenced by EMAN::PointArray::sort_by_axis().

◆ cmp_axis_z()

int cmp_axis_z ( const void *  a,
const void *  b 
)

Definition at line 70 of file pointarray.cpp.

71{
72 double diff = ((double *) a)[2] - ((double *) b)[2];
73 if (diff < 0.0)
74 return -1;
75 else if (diff > 0.0)
76 return 1;
77 else
78 return 0;
79}

Referenced by EMAN::PointArray::sort_by_axis().

◆ cmp_float()

int cmp_float ( const void *  a,
const void *  b 
)

Definition at line 91 of file pointarray.cpp.

92{
93 double diff = *((float *) a) - *((float *) b);
94 if (diff < 0.0)
95 return 1;
96 else if (diff > 0.0)
97 return -1;
98 else
99 return 0;
100}

Referenced by EMAN::PointArray::distmx().

◆ cmp_val()

int cmp_val ( const void *  a,
const void *  b 
)

Definition at line 80 of file pointarray.cpp.

81{
82 double diff = ((double *) a)[3] - ((double *) b)[3];
83 if (diff < 0.0)
84 return -1;
85 else if (diff > 0.0)
86 return 1;
87 else
88 return 0;
89}

Referenced by EMAN::PointArray::sort_by_axis().