Generated by Cython 0.12.1 on Mon Jun 7 02:00:51 2010

Raw output: _home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0.c

 1: 
 2: include "interrupt.pxi"  # ctrl-c interrupt block support
 3: include "stdsage.pxi"  # ctrl-c interrupt block support
 4: 
 5: include "cdefs.pxi"
 6: import numpy as np
    __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 7: cimport numpy as np
 8: cdef double min
 9: cdef double max
 10: cdef int nd
 11: min=-2.5
    __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_min = (-2.5);
 12: max=2.5
    __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_max = 2.5;
 13: nd=100
    __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_nd = 100;
 14: 
 15: def deltabin():
static PyObject *__pyx_pf_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_deltabin(PyObject *__pyx_self, PyObject *unused); /*proto*/
static char __pyx_doc_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_deltabin[] = "File: _home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0.pyx (starting at line 15)";
static PyObject *__pyx_pf_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_deltabin(PyObject *__pyx_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("deltabin");
  __pyx_self = __pyx_self;
 16:     return 100/(max-min)
    __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_max - __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_min);
  if (unlikely(__pyx_t_1 == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyFloat_FromDouble((100 / __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0.deltabin");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 17: 
 18: def indice(double x):
static PyObject *__pyx_pf_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_indice(PyObject *__pyx_self, PyObject *__pyx_arg_x); /*proto*/
static char __pyx_doc_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_indice[] = "File: _home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0.pyx (starting at line 18)";
static PyObject *__pyx_pf_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_indice(PyObject *__pyx_self, PyObject *__pyx_arg_x) {
  double __pyx_v_x;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("indice");
  __pyx_self = __pyx_self;
  assert(__pyx_arg_x); {
    __pyx_v_x = __pyx_PyFloat_AsDouble(__pyx_arg_x); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0.indice");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
 19:     #'Toma los límites y número de canales para histogramar'
 20:     #'y un cierto valor x retornando la posición que ocupará'
 21:     #'ese valor en el array del histograma'
 22:     if x >= max:
    __pyx_t_1 = (__pyx_v_x >= __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_max);
  if (__pyx_t_1) {
 23:         return -1
        __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;
    goto __pyx_L5;
  }
 24:     elif x <= min:
    __pyx_t_1 = (__pyx_v_x <= __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_min);
  if (__pyx_t_1) {
 25:         return 0
        __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {
 26:     else:
 27:         return int(0.5+nd*(x-min)/(max-min))
        __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = (__pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_nd * (__pyx_v_x - __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_min));
    __pyx_t_3 = (__pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_max - __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_min);
    if (unlikely(__pyx_t_3 == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyFloat_FromDouble((0.5 + (__pyx_t_2 / __pyx_t_3))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0.indice");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 28: 
 29: def histograma(np.ndarray[double, ndim=2] atomos):
static PyObject *__pyx_pf_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_histograma(PyObject *__pyx_self, PyObject *__pyx_v_atomos); /*proto*/
static char __pyx_doc_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_histograma[] = "File: _home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0.pyx (starting at line 29)";
static PyObject *__pyx_pf_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_histograma(PyObject *__pyx_self, PyObject *__pyx_v_atomos) {
  PyObject *__pyx_v_h;
  PyObject *__pyx_v_d;
  PyObject *__pyx_v_j;
  Py_buffer __pyx_bstruct_atomos;
  Py_ssize_t __pyx_bstride_0_atomos = 0;
  Py_ssize_t __pyx_bstride_1_atomos = 0;
  Py_ssize_t __pyx_bshape_0_atomos = 0;
  Py_ssize_t __pyx_bshape_1_atomos = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("histograma");
  __pyx_self = __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_v_atomos);
  __pyx_v_h = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_d = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_j = Py_None; __Pyx_INCREF(Py_None);
  __pyx_bstruct_atomos.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_atomos), __pyx_ptype_5numpy_ndarray, 1, "atomos", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_atomos, (PyObject*)__pyx_v_atomos, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_atomos = __pyx_bstruct_atomos.strides[0]; __pyx_bstride_1_atomos = __pyx_bstruct_atomos.strides[1];
  __pyx_bshape_0_atomos = __pyx_bstruct_atomos.shape[0]; __pyx_bshape_1_atomos = __pyx_bstruct_atomos.shape[1];
 30:     #'Toma el array con las velocidades de los átomos'
 31:     #'Retorna histogramados el módulo de la velocidad'
 32:     #'y la componente x'
 33:     h=np.zeros((nd+1,3))
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromLong((__pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_nd + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_h);
  __pyx_v_h = __pyx_t_3;
  __pyx_t_3 = 0;
 34:     d=(max-min)/nd
    __pyx_t_4 = (__pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_max - __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_min);
  if (unlikely(__pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_nd == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyFloat_FromDouble((__pyx_t_4 / __pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_nd)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_d);
  __pyx_v_d = __pyx_t_3;
  __pyx_t_3 = 0;
 35:     j=0
    __Pyx_INCREF(__pyx_int_0);
  __Pyx_DECREF(__pyx_v_j);
  __pyx_v_j = __pyx_int_0;
 36:     while j <= nd:
    while (1) {
    __pyx_t_3 = PyInt_FromLong(__pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_nd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_j, __pyx_t_3, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_5) break;
 37:         h[j][0]=min+j*d
        __pyx_t_1 = PyFloat_FromDouble(__pyx_v_82_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_j, __pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetItem(__pyx_v_h, __pyx_v_j); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 38:         j+=1
        __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_j);
    __pyx_v_j = __pyx_t_2;
    __pyx_t_2 = 0;
  }
 39:     j=0
    __Pyx_INCREF(__pyx_int_0);
  __Pyx_DECREF(__pyx_v_j);
  __pyx_v_j = __pyx_int_0;
 40:     while j < len(atomos):
    while (1) {
    __pyx_t_6 = PyObject_Length(__pyx_v_atomos); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_j, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_5) break;
 41:         h[indice(sqrt(atomos[j][0]**2+atomos[j][1]**2))][1]+=1
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__indice); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetItem(__pyx_v_atomos, __pyx_v_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetItem(__pyx_v_atomos, __pyx_v_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyFloat_FromDouble(sqrt(__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetItem(__pyx_v_h, __pyx_t_7); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_SetItemInt(__pyx_t_1, 1, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 42:         h[indice(atomos[j][0])][2]+=1
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__indice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetItem(__pyx_v_atomos, __pyx_v_j); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetItem(__pyx_v_h, __pyx_t_7); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_SetItemInt(__pyx_t_3, 2, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 43:         j+=1
        __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_j, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_j);
    __pyx_v_j = __pyx_t_3;
    __pyx_t_3 = 0;
  }
 44:     return h
    __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_h);
  __pyx_r = __pyx_v_h;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_atomos);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("_home_sage_sagenb_sage_notebook_standalone_sagenb_home_pablogc_1_code_sage5_spyx_0.histograma");
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_atomos);
  __pyx_L2:;
  __Pyx_DECREF(__pyx_v_h);
  __Pyx_DECREF(__pyx_v_d);
  __Pyx_DECREF(__pyx_v_j);
  __Pyx_DECREF((PyObject *)__pyx_v_atomos);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}