EMAN2
Functions
pointarray.cpp File Reference
#include "pointarray.h"
#include "util.h"
#include "vec3.h"
#include <vector>
#include <cstring>
#include <boost/random.hpp>
#include <boost/random/normal_distribution.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

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

Definition at line 55 of file pointarray.cpp.

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

{
        double diff = ((double *) a)[0] - ((double *) b)[0];
        if (diff < 0.0)
                return -1;
        else if (diff > 0.0)
                return 1;
        else
                return 0;
}
int cmp_axis_y ( const void *  a,
const void *  b 
)

Definition at line 65 of file pointarray.cpp.

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

{
        double diff = ((double *) a)[1] - ((double *) b)[1];
        if (diff < 0.0)
                return -1;
        else if (diff > 0.0)
                return 1;
        else
                return 0;
}
int cmp_axis_z ( const void *  a,
const void *  b 
)

Definition at line 75 of file pointarray.cpp.

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

{
        double diff = ((double *) a)[2] - ((double *) b)[2];
        if (diff < 0.0)
                return -1;
        else if (diff > 0.0)
                return 1;
        else
                return 0;
}
int cmp_float ( const void *  a,
const void *  b 
)

Definition at line 96 of file pointarray.cpp.

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

{
        double diff = *((float *) a) - *((float *) b);
        if (diff < 0.0)
                return 1;
        else if (diff > 0.0)
                return -1;
        else
                return 0;
}
int cmp_val ( const void *  a,
const void *  b 
)

Definition at line 85 of file pointarray.cpp.

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

{
        double diff = ((double *) a)[3] - ((double *) b)[3];
        if (diff < 0.0)
                return -1;
        else if (diff > 0.0)
                return 1;
        else
                return 0;
}