xboa
Functions | Variables
Bunchcore.c File Reference
#include <Python.h>
#include <structmember.h>
#include <string.h>
#include "Bunchcore.h"
Include dependency graph for Bunchcore.c:

Go to the source code of this file.

Functions

static int Bunchcore_init_python (Bunchcore *self, PyObject *args, PyObject *kwds)
 
static BunchcoreBunchcore_shallow_copy (Bunchcore *self)
 
static Bunchcorebc_realloc (Bunchcore *self, int new_length)
 
static int Bunchcore_init (Bunchcore *self, int len)
 
static void Bunchcore_dealloc (Bunchcore *self)
 
static void set_item_bc_hit (Bunchcore *self, PyObject *a_hit, Hitcore *a_hitcore, int pos, int *ierr)
 
static PyObject * length_python (PyObject *self, PyObject *args)
 
static Py_ssize_t len_python (PyObject *self)
 
static PyObject * set_item_python (PyObject *self, PyObject *args)
 
static PyObject * get_item_python (PyObject *self, PyObject *args)
 
static double get_moment_char (Bunchcore *self, const char **axes, double *means, int n_axes, int *ierr)
 
static void covariance_matrix_char (Bunchcore *self, const char *axes[], double *means, int n_axes, double *target, int *ierr)
 
static void make_array_from_char_list (PyObject *py_list, const char ***string_list, int *list_size)
 
static void make_array_from_float_list (PyObject *py_list, double **double_list, int *list_size)
 
static PyObject * make_lists_from_double_array (double values[], int list_size)
 
static PyObject * get_moment_python (PyObject *self, PyObject *args)
 
static PyObject * covariance_matrix_python (PyObject *self, PyObject *args)
 
static PyObject * _cut_double_python (PyObject *self, PyObject *args)
 
static int _cut_double (Bunchcore *self, const char *get_variable, PyObject *comp, const double cut_value, const int is_local)
 
PyMODINIT_FUNC initBunchcore (void)
 
void import_hitcore (void)
 
void no_warn (void)
 

Variables

static PyMemberDef Bunchcore_members []
 
static PyMethodDef Bunchcore_methods []
 
static PySequenceMethods Bunchcore_as_seq
 
static PyTypeObject BunchcoreType
 

Function Documentation

static int Bunchcore_init_python ( Bunchcore self,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 26 of file Bunchcore.c.

References Bunchcore_init().

static Bunchcore* Bunchcore_shallow_copy ( Bunchcore self)
static

Definition at line 35 of file Bunchcore.c.

References Bunchcore_hit::hit, Bunchcore_hit::hitcore, Bunchcore::vec, vector_alloc, and vector_el.

Referenced by no_warn().

static Bunchcore* bc_realloc ( Bunchcore self,
int  new_length 
)
static

Definition at line 57 of file Bunchcore.c.

References Bunchcore_hit::hit, Bunchcore_hit::hitcore, length(), vector_el, and vector_realloc.

Referenced by set_item_bc_hit().

static int Bunchcore_init ( Bunchcore self,
int  len 
)
static

Definition at line 70 of file Bunchcore.c.

References vector_alloc.

Referenced by Bunchcore_init_python().

static void Bunchcore_dealloc ( Bunchcore self)
static

Definition at line 79 of file Bunchcore.c.

References Bunchcore_hit::hit, Bunchcore_hit::hitcore, vector_el, vector_free, and vector_size.

static void set_item_bc_hit ( Bunchcore self,
PyObject *  a_hit,
Hitcore a_hitcore,
int  pos,
int *  ierr 
)
static

Definition at line 107 of file Bunchcore.c.

References bc_realloc(), length(), and vector_el_bc.

Referenced by set_item_python().

static PyObject* length_python ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 123 of file Bunchcore.c.

References vector::data_length, vector::object_size, and Bunchcore::vec.

static Py_ssize_t len_python ( PyObject *  self)
static

Definition at line 132 of file Bunchcore.c.

References vector::data_length, vector::object_size, and Bunchcore::vec.

static PyObject* set_item_python ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 142 of file Bunchcore.c.

References length(), and set_item_bc_hit().

static PyObject* get_item_python ( PyObject *  self,
PyObject *  args 
)
static
static double get_moment_char ( Bunchcore self,
const char **  axes,
double *  means,
int  n_axes,
int *  ierr 
)
static

Definition at line 185 of file Bunchcore.c.

References hc_get_dbl_function_by_string, hc_get_total_weight(), length(), and vector_el.

Referenced by get_moment_python().

static void covariance_matrix_char ( Bunchcore self,
const char *  axes[],
double *  means,
int  n_axes,
double *  target,
int *  ierr 
)
static
static void make_array_from_char_list ( PyObject *  py_list,
const char ***  string_list,
int *  list_size 
)
static

Definition at line 249 of file Bunchcore.c.

Referenced by covariance_matrix_python(), and get_moment_python().

static void make_array_from_float_list ( PyObject *  py_list,
double **  double_list,
int *  list_size 
)
static

Definition at line 281 of file Bunchcore.c.

Referenced by covariance_matrix_python(), and get_moment_python().

static PyObject* make_lists_from_double_array ( double  values[],
int  list_size 
)
static

Definition at line 315 of file Bunchcore.c.

Referenced by covariance_matrix_python().

static PyObject* get_moment_python ( PyObject *  self,
PyObject *  args 
)
static
static PyObject* covariance_matrix_python ( PyObject *  self,
PyObject *  args 
)
static
static PyObject* _cut_double_python ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 398 of file Bunchcore.c.

References _cut_double().

static int _cut_double ( Bunchcore self,
const char *  get_variable,
PyObject *  comp,
const double  cut_value,
const int  is_local 
)
static
PyMODINIT_FUNC initBunchcore ( void  )

Definition at line 523 of file Bunchcore.c.

References import_hitcore().

void import_hitcore ( void  )
void no_warn ( void  )

Definition at line 564 of file Bunchcore.c.

Variable Documentation

PyMemberDef Bunchcore_members[]
static
Initial value:
= {
{NULL},
}

Definition at line 456 of file Bunchcore.c.

PyMethodDef Bunchcore_methods[]
static
Initial value:
= {
{"set_item", (PyCFunction)set_item_python, METH_VARARGS, "Set i^th item"},
{"get_item", (PyCFunction)get_item_python, METH_VARARGS, "Get i^th item"},
{"length", (PyCFunction)length_python, METH_VARARGS, "Report the length of the Bunchcore"},
{"moment", (PyCFunction)get_moment_python, METH_VARARGS, "Get moment from a list of strings"},
{"covariance_matrix", (PyCFunction)covariance_matrix_python, METH_VARARGS, "Get covariance matrix from a list of strings"},
{"_cut_double", (PyCFunction)_cut_double_python, METH_VARARGS, "Apply cut inner loop. Returns NULL on error or if get_variable is an int"},
{NULL}
}

Definition at line 460 of file Bunchcore.c.

PySequenceMethods Bunchcore_as_seq
static
Initial value:
= {
(lenfunc)len_python,
0,
0,
0,
0,
0,
0,
0,
}

Definition at line 470 of file Bunchcore.c.

PyTypeObject BunchcoreType
static

Definition at line 481 of file Bunchcore.c.