/* Implementation of slice2 */ static PyObject *__pyx_f_6slice2_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6slice2_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_obj1 = 0; PyObject *__pyx_v_obj2 = 0; PyObject *__pyx_v_obj3 = 0; PyObject *__pyx_v_obj4 = 0; PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_ssize_t __pyx_2; Py_ssize_t __pyx_3; static char *__pyx_argnames[] = {"obj1","obj2","obj3","obj4",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_obj1, &__pyx_v_obj2, &__pyx_v_obj3, &__pyx_v_obj4)) return 0; Py_INCREF(__pyx_v_obj1); Py_INCREF(__pyx_v_obj2); Py_INCREF(__pyx_v_obj3); Py_INCREF(__pyx_v_obj4); /* "/Local/Projects/D/Pyrex/Source/Tests/2/slice2.pyx":2 */ __pyx_1 = PySequence_GetSlice(__pyx_v_obj2, 0, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;} Py_DECREF(__pyx_v_obj1); __pyx_v_obj1 = __pyx_1; __pyx_1 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/2/slice2.pyx":3 */ __pyx_2 = PyInt_AsSsize_t(__pyx_v_obj3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;} __pyx_1 = PySequence_GetSlice(__pyx_v_obj2, __pyx_2, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;} Py_DECREF(__pyx_v_obj1); __pyx_v_obj1 = __pyx_1; __pyx_1 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/2/slice2.pyx":4 */ __pyx_2 = PyInt_AsSsize_t(__pyx_v_obj4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;} __pyx_1 = PySequence_GetSlice(__pyx_v_obj2, 0, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;} Py_DECREF(__pyx_v_obj1); __pyx_v_obj1 = __pyx_1; __pyx_1 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/2/slice2.pyx":5 */ __pyx_2 = PyInt_AsSsize_t(__pyx_v_obj3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;} __pyx_3 = PyInt_AsSsize_t(__pyx_v_obj4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;} __pyx_1 = PySequence_GetSlice(__pyx_v_obj2, __pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;} Py_DECREF(__pyx_v_obj1); __pyx_v_obj1 = __pyx_1; __pyx_1 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("slice2.f"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_obj1); Py_DECREF(__pyx_v_obj2); Py_DECREF(__pyx_v_obj3); Py_DECREF(__pyx_v_obj4); return __pyx_r; }
static PyObject * pyg_add_emission_hook(PyGObject *self, PyObject *args) { PyObject *first, *callback, *extra_args, *data; gchar *name; gulong hook_id; guint sigid; Py_ssize_t len; GQuark detail = 0; GType gtype; PyObject *pygtype; len = PyTuple_Size(args); if (len < 3) { PyErr_SetString(PyExc_TypeError, "gobject.add_emission_hook requires at least 3 arguments"); return NULL; } first = PySequence_GetSlice(args, 0, 3); if (!PyArg_ParseTuple(first, "OsO:add_emission_hook", &pygtype, &name, &callback)) { Py_DECREF(first); return NULL; } Py_DECREF(first); if ((gtype = pyg_type_from_object(pygtype)) == 0) { return NULL; } if (!PyCallable_Check(callback)) { PyErr_SetString(PyExc_TypeError, "third argument must be callable"); return NULL; } if (!g_signal_parse_name(name, gtype, &sigid, &detail, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", PyString_AsString(PyObject_Repr((PyObject*)self)), name); return NULL; } extra_args = PySequence_GetSlice(args, 3, len); if (extra_args == NULL) return NULL; data = Py_BuildValue("(ON)", callback, extra_args); if (data == NULL) return NULL; hook_id = g_signal_add_emission_hook(sigid, detail, marshal_emission_hook, data, (GDestroyNotify)pyg_destroy_notify); return PyLong_FromUnsignedLong(hook_id); }
static PyObject* th_brk_(PyObject *self, PyObject *args) { PyObject *result = NULL; Py_UNICODE *s1; int s1_len; if (!PyArg_ParseTuple(args, "u#", &s1, &s1_len)) { PyErr_SetString(PyExc_TypeError, "parameter must be unicode"); return NULL; } if(s1_len == 0) { PyErr_SetString(PyExc_ValueError, "parameter must not be empty string"); return NULL; } PyObject *txt_cp874 = PyUnicode_Encode(s1, s1_len, "CP874", NULL); if(txt_cp874 == NULL) { return NULL; } Py_ssize_t len = PyString_Size(txt_cp874); char *c_txt_cp874 = PyString_AsString(txt_cp874); int *pos = (int *)malloc(sizeof(int) * (s1_len + 1)); int n = th_brk((unsigned char *)c_txt_cp874, pos, len); int i, s = 0; char *buffer; result = PyList_New(0); for(i = 0; i < n; i++) { PyObject *tok; PyObject *tok_cp874 = PySequence_GetSlice(txt_cp874, s, pos[i]); Py_ssize_t tok_len; PyString_AsStringAndSize(tok_cp874, &buffer, &tok_len); tok = PyUnicode_Decode(buffer, tok_len, "CP874", NULL); s = pos[i]; PyList_Append(result, tok); Py_XDECREF(tok_cp874); Py_XDECREF(tok); } if(s < len) { PyObject *tok_cp874 = PySequence_GetSlice(txt_cp874, s, len); Py_ssize_t tok_len; PyObject *tok; PyString_AsStringAndSize(tok_cp874, &buffer, &tok_len); tok = PyUnicode_Decode(buffer, tok_len, "CP874", NULL); PyList_Append(result, tok); Py_XDECREF(tok_cp874); Py_XDECREF(tok); } Py_XDECREF(txt_cp874); free(pos); return result; }
static int FSRequest_tp_init(FSRequest *self, PyObject *args, PyObject *kwargs) { int r; Loop *loop; PyObject *callback, *tmp, *loopargs; UNUSED_ARG(kwargs); if (!PyArg_ParseTuple(args, "O!O:__init__", &LoopType, &loop, &callback)) { return -1; } loopargs = PySequence_GetSlice(args, 0, 1); if (!loopargs) { return -1; } r = RequestType.tp_init((PyObject *)self, loopargs, kwargs); if (r < 0) { Py_DECREF(loopargs); return r; } tmp = (PyObject *)self->callback; Py_INCREF(callback); self->callback = callback; Py_XDECREF(tmp); Py_DECREF(loopargs); return 0; }
static foreign_t python_slice(term_t parent, term_t indx, term_t tobj) { PyObject *pF, *pI; PyObject *p; // get Scope ... pI = term_to_python(indx, true); // got Scope.Exp // get Scope ... p = term_to_python(parent, true); // Exp if (!pI || !p) { { return false; } } else if ((pF = PySequence_GetSlice(p, 0, 0)) == NULL) { PyErr_Print(); { return false; } } Py_DecRef(pI); Py_DecRef(p); { foreign_t rc; rc = address_to_term(pF, tobj); return rc; } }
static PyObject * proxy_slice(PyWeakReference *proxy, int i, int j) { if (!proxy_checkref(proxy)) return NULL; return PySequence_GetSlice(PyWeakref_GET_OBJECT(proxy), i, j); }
static PyObject * channel_send_exception(PyObject *myself, PyObject *args) { STACKLESS_GETARG(); PyObject *retval = NULL; PyObject *klass = PySequence_GetItem(args, 0); if (klass == NULL) VALUE_ERROR("channel.send_exception(e, v...)", NULL); args = PySequence_GetSlice(args, 1, PySequence_Size(args)); if (!args) { goto err_exit; } STACKLESS_PROMOTE_ALL(); retval = impl_channel_send_exception((PyChannelObject*)myself, klass, args); STACKLESS_ASSERT(); if (retval == NULL || STACKLESS_UNWINDING(retval)) { goto err_exit; } Py_INCREF(Py_None); retval = Py_None; err_exit: Py_DECREF(klass); Py_XDECREF(args); return retval; }
static int base_init(base *self, PyObject *args, PyObject *kwds) { // call tp_init of PyGObject int args_len = PyTuple_Size(args); PyObject *reduced_args = PySequence_GetSlice(args, 2, args_len); if (PyGObject_Type->tp_init((PyObject *)self, reduced_args, kwds) < 0) return -1; Py_DECREF(reduced_args); // parse arguments if (!PyArg_ParseTuple(args, "O!O!", PyGObject_Type, &(self->spectrum_element), PyGObject_Type, &(self->pipeline))) return -1; // listen for spectrum messages GstBus *gstbus = gst_pipeline_get_bus(GST_PIPELINE(self->pipeline->obj)); g_assert(gstbus != NULL); gst_bus_add_signal_watch(gstbus); Py_INCREF(self); g_signal_connect(G_OBJECT(gstbus), "message::element", G_CALLBACK(on_message), self); gst_object_unref(gstbus); // get clock of pipeline self->sync_clock = gst_pipeline_get_clock(GST_PIPELINE(self->pipeline->obj)); g_assert(self->sync_clock != NULL); return 0; }
static PyObject * wrap_slice(PyObject *self, Py_ssize_t start, Py_ssize_t end) { PyObject *obj = Proxy_GET_OBJECT(self); if (PyList_Check(obj)) { return PyList_GetSlice(obj, start, end); } else if (PyTuple_Check(obj)) { return PyTuple_GetSlice(obj, start, end); } else { return PySequence_GetSlice(obj, start, end); } }
static PyObject *t_sequence_seq_getslice(t_sequence *self, Py_ssize_t low, Py_ssize_t high) { PyObject *slice = PySequence_GetSlice(self->sequence, low, high); if (!slice || self->itemvalue.flags & V_PURE) return slice; if (_restoreValues(self, slice) < 0) { Py_DECREF(slice); return NULL; } return slice; }
/* Implementation of rowe_1 */ static PyObject *__pyx_f_6rowe_1_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6rowe_1_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_a; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_ssize_t __pyx_4; Py_ssize_t __pyx_5; static char *__pyx_argnames[] = {"data",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_data)) return 0; Py_INCREF(__pyx_v_data); __pyx_v_a = Py_None; Py_INCREF(Py_None); /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/other/rowe_1.pyx":7 */ __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;} __pyx_2 = PyNumber_Multiply(__pyx_1, __pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; blarg(__pyx_3); /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/other/rowe_1.pyx":8 */ __pyx_4 = PyInt_AsSsize_t(__pyx_v_a); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;} __pyx_2 = PyNumber_Add(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_5 = PyInt_AsSsize_t(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_1 = PySequence_GetSlice(__pyx_v_data, __pyx_4, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("rowe_1.function"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_data); return __pyx_r; }
static PyObject * tasklet_raise_exception(PyObject *myself, PyObject *args) { STACKLESS_GETARG(); PyObject *result = NULL; PyObject *klass = PySequence_GetItem(args, 0); if (klass == NULL) VALUE_ERROR("tasklet.raise_exception(e, v...)", NULL); args = PySequence_GetSlice(args, 1, PySequence_Size(args)); if (!args) goto err_exit; STACKLESS_PROMOTE_ALL(); result = impl_tasklet_raise_exception( (PyTaskletObject*)myself, klass, args); STACKLESS_ASSERT(); err_exit: Py_DECREF(klass); Py_XDECREF(args); return result; }
/* Split lists and tuples slices o[start:end] */ static void pyobject_slice(lua_State *L) { lua_Object lobj = lua_getparam(L, 1); if (is_object_container(L, lobj)) { int start = luaL_check_int(L, 2); int end = luaL_check_int(L, 3); PyObject *object = get_pobject(L, lobj); PyObject *obj = PySequence_GetSlice(object, start, end); if (!obj) { const char *name = object->ob_type->tp_name; char *format = "object \"%s\" does not support slices"; const char *str = name ? name : "?"; char buff[buffsize_calc(2, format, str)]; sprintf(buff, format, str); lua_new_error(L, &buff[0]); } push_pyobject_container(L, obj, 1); } else { lua_error(L, "#1 is not a container for python object!"); } }
static int one_pass(PyObject* ngram_list, PyObject* string, int n) { PyObject *ngram; Py_ssize_t len, i; if((len = PySequence_Length(string)) == -1) { return -1; } for(i=0; i + n <= len; i++) { ngram = PySequence_GetSlice(string, i, i+n); if(!ngram) { return -1; } if(PyList_Append(ngram_list, ngram) == -1) { return -1; } Py_DECREF(ngram); } return 0; }
static int WorkRequest_tp_init(WorkRequest *self, PyObject *args, PyObject *kwargs) { int r; Loop *loop; PyObject *work_cb, *done_cb, *tmp, *loopargs; UNUSED_ARG(kwargs); if (!PyArg_ParseTuple(args, "O!OO:__init__", &LoopType, &loop, &work_cb, &done_cb)) { return -1; } loopargs = PySequence_GetSlice(args, 0, 1); if (!loopargs) { return -1; } r = RequestType.tp_init((PyObject *)self, loopargs, kwargs); if (r < 0) { Py_DECREF(loopargs); return r; } tmp = (PyObject *)self->work_cb; Py_INCREF(work_cb); self->work_cb = work_cb; Py_XDECREF(tmp); tmp = (PyObject *)self->done_cb; Py_INCREF(done_cb); self->done_cb = done_cb; Py_XDECREF(tmp); Py_DECREF(loopargs); return 0; }
Sequence Sequence::getSlice(int start, int stop) const { return Sequence(NewReference(PySequence_GetSlice(mPtr, start, stop))); }
static int splitUnicodeString(Splitter *self,PyUnicodeObject *doc) { PyObject *word,*synword; PyUnicodeObject * doc1; Py_UNICODE *s; int len = doc->length; int inside_word=0; int i=0; int start=0; doc1 = prepareString(self,doc); if (doc1 == NULL) return -1; s=doc1->str; self->list = PyList_New(0); for (i = 0; i < len; s++, i++) { register Py_UNICODE ch; ch = *s; if (!inside_word) { if (self->index_numbers) { if (Py_UNICODE_ISALNUM(ch)) { inside_word=1; start = i; } } else { if (Py_UNICODE_ISALPHA(ch)) { inside_word=1; start = i; } } } else { if (!(Py_UNICODE_ISALNUM(ch) || ch=='/' || ch=='_' || ch=='-')) { inside_word = 0; word = PySequence_GetSlice((PyObject *)doc1,start, min(i, start + self->max_len)); if (word==NULL) goto err; synword = checkSynword(self,word); if (synword != Py_None) { PyList_Append(self->list,synword); } start = 0; #ifdef DEBUG PyObject_Print(word,stdout,0); fflush(stdout); #endif Py_DECREF(word); } } } if (inside_word) { word = PySequence_GetSlice((PyObject *)doc1,start, min(len, start + self->max_len)); if (word==NULL) goto err; synword = checkSynword(self,word); if (synword != Py_None) { PyList_Append(self->list,synword); } Py_DECREF(word); } #ifdef DEBUG PyObject_Print(self->list,stdout,0); fflush(stdout); #endif Py_DECREF(doc1); return 1; err: Py_DECREF(doc1); return -1; }
static int __pyx_f_11inplace_lhs_f(void) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_k; float __pyx_v_x; float __pyx_v_y; float __pyx_v_z; PyObject *__pyx_v_a; PyObject *__pyx_v_b; PyObject *__pyx_v_c; PyObject *__pyx_v_d; int __pyx_v_m[3]; struct __pyx_t_11inplace_lhs_S __pyx_v_s; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_b = Py_None; Py_INCREF(Py_None); __pyx_v_c = Py_None; Py_INCREF(Py_None); __pyx_v_d = Py_None; Py_INCREF(Py_None); /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":11 */ __pyx_v_i += (__pyx_v_j + __pyx_v_k); /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":12 */ __pyx_v_x += (__pyx_v_y + __pyx_v_z); /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":13 */ __pyx_v_x += __pyx_v_i; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":14 */ __pyx_1 = PyNumber_Add(__pyx_v_b, __pyx_v_c); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;} __pyx_2 = PyNumber_InPlaceAdd(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_2; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":15 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_g); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;} __pyx_2 = PyNumber_InPlaceAdd(__pyx_1, __pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_g, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":16 */ (__pyx_v_m[__pyx_v_i]) += __pyx_v_j; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":17 */ __pyx_1 = PyNumber_Add(__pyx_v_b, __pyx_v_c); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} __pyx_3 = PyObject_GetItem(__pyx_v_a, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} __pyx_3 = PyNumber_InPlaceAdd(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetItem(__pyx_v_a, __pyx_2, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":18 */ __pyx_2 = PyNumber_Add(__pyx_v_b, __pyx_v_c); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} __pyx_1 = PyObject_GetItem(__pyx_v_a, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} __pyx_3 = PyNumber_InPlaceAdd(__pyx_1, __pyx_v_d); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetItem(__pyx_v_a, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":19 */ __pyx_1 = PyNumber_Add(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;} __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_v_c); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;} __pyx_2 = PyNumber_InPlaceAdd(__pyx_3, __pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyObject_SetItem(__pyx_1, __pyx_v_c, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":20 */ __pyx_3 = PySequence_GetSlice(__pyx_v_a, __pyx_v_i, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} __pyx_2 = PyNumber_InPlaceAdd(__pyx_3, __pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (PySequence_SetSlice(__pyx_v_a, __pyx_v_i, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":21 */ __pyx_1 = PyNumber_Add(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} __pyx_3 = PySequence_GetSlice(__pyx_1, __pyx_v_i, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} __pyx_2 = PyNumber_InPlaceAdd(__pyx_3, __pyx_v_c); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (PySequence_SetSlice(__pyx_1, __pyx_v_i, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":22 */ __pyx_3 = PyNumber_Add(__pyx_v_c, __pyx_v_d); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_a, __pyx_n_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} __pyx_1 = PyNumber_InPlaceAdd(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyObject_SetAttr(__pyx_v_a, __pyx_n_b, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":23 */ __pyx_2 = PyNumber_Add(__pyx_v_a, __pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_c); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} __pyx_1 = PyNumber_InPlaceAdd(__pyx_3, __pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyObject_SetAttr(__pyx_2, __pyx_n_c, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":24 */ __pyx_v_s.q += __pyx_v_i; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("inplace_lhs.f"); __pyx_r = (-1); __pyx_L0:; Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_b); Py_DECREF(__pyx_v_c); Py_DECREF(__pyx_v_d); return __pyx_r; }
static PyObject * wrap_slice(PyObject *self, Py_ssize_t start, Py_ssize_t end) { return PySequence_GetSlice(Proxy_GET_OBJECT(self), start, end); }
static int cnter_init(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *newargs; PyObject *newdefault = NULL; if (args == NULL || !PyTuple_Check(args)) newargs = PyTuple_New(0); else { Py_ssize_t n = PyTuple_GET_SIZE(args); if (n == 1) { newdefault = PyTuple_GET_ITEM(args, 0); if (!(PyInt_Check(newdefault) || PyFloat_Check(newdefault) || PyLong_Check(newdefault))) { newdefault = NULL; newargs = args; Py_INCREF(newargs); } else { newargs = PyTuple_New(0); } } else if (n == 2) { newdefault = PyTuple_GET_ITEM(args, 1); if (!(PyInt_Check(newdefault) || PyFloat_Check(newdefault) || PyLong_Check(newdefault))) { PyErr_SetString(PyExc_TypeError, "second argument must be float"); return -1; } else { newargs = PySequence_GetSlice(args, 0, 1); } } else if (n == 0) { newargs = args; Py_INCREF(newargs); } else { PyErr_SetString(PyExc_TypeError, "counter takes at most 2 arguments"); return -1; } } if (newargs == NULL) return -1; if (kwds == NULL || !PyDict_Check(kwds)) kwds = PyDict_New(); else Py_INCREF(kwds); int result = PyDict_Type.tp_init(self, newargs, kwds); Py_DECREF(newargs); Py_DECREF(kwds); if (newdefault) ((cnterobject*)self)->default_value = PyFloat_AsDouble(newdefault); else ((cnterobject*)self)->default_value = 0.0; ((cnterobject*)self)->frozen = false; return result; }
static PyObject *__pyx_f_11closestpair_closest_pair(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyListObject *__pyx_v_points = 0; float __pyx_v_min_d; PyObject *__pyx_v_min_p1; PyObject *__pyx_v_min_p2; PyObject *__pyx_v_i; PyObject *__pyx_v_point; PyObject *__pyx_v_point2; PyObject *__pyx_v_d; PyObject *__pyx_v_split; PyObject *__pyx_v_d1; PyObject *__pyx_v_p11; PyObject *__pyx_v_p12; PyObject *__pyx_v_d2; PyObject *__pyx_v_p21; PyObject *__pyx_v_p22; PyObject *__pyx_v_points_in_strip; PyObject *__pyx_v_split_at; PyObject *__pyx_v_max_i; PyObject *__pyx_v_sd; PyObject *__pyx_r; Py_ssize_t __pyx_1; int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; PyObject *__pyx_6 = 0; PyObject *__pyx_7 = 0; PyObject *__pyx_8 = 0; PyObject *__pyx_9 = 0; PyObject *__pyx_10 = 0; float __pyx_11; int __pyx_12; Py_ssize_t __pyx_13; static char *__pyx_argnames[] = {"points",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_points)) return 0; Py_INCREF(__pyx_v_points); __pyx_v_min_p1 = Py_None; Py_INCREF(Py_None); __pyx_v_min_p2 = Py_None; Py_INCREF(Py_None); __pyx_v_i = Py_None; Py_INCREF(Py_None); __pyx_v_point = Py_None; Py_INCREF(Py_None); __pyx_v_point2 = Py_None; Py_INCREF(Py_None); __pyx_v_d = Py_None; Py_INCREF(Py_None); __pyx_v_split = Py_None; Py_INCREF(Py_None); __pyx_v_d1 = Py_None; Py_INCREF(Py_None); __pyx_v_p11 = Py_None; Py_INCREF(Py_None); __pyx_v_p12 = Py_None; Py_INCREF(Py_None); __pyx_v_d2 = Py_None; Py_INCREF(Py_None); __pyx_v_p21 = Py_None; Py_INCREF(Py_None); __pyx_v_p22 = Py_None; Py_INCREF(Py_None); __pyx_v_points_in_strip = Py_None; Py_INCREF(Py_None); __pyx_v_split_at = Py_None; Py_INCREF(Py_None); __pyx_v_max_i = Py_None; Py_INCREF(Py_None); __pyx_v_sd = Py_None; Py_INCREF(Py_None); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_points), (&PyList_Type), 1, "points")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;} /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":15 */ __pyx_1 = PyObject_Length(((PyObject *)__pyx_v_points)); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;} __pyx_2 = (__pyx_1 < 2); if (__pyx_2) { __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} Py_INCREF(__pyx_k1p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k1p); __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} goto __pyx_L2; } __pyx_1 = PyObject_Length(((PyObject *)__pyx_v_points)); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} __pyx_2 = 2 <= __pyx_1; if (__pyx_2) { __pyx_2 = __pyx_1 <= 6; } if (__pyx_2) { /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":18 */ __pyx_v_min_d = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":19 */ Py_INCREF(Py_None); Py_DECREF(__pyx_v_min_p1); __pyx_v_min_p1 = Py_None; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":20 */ Py_INCREF(Py_None); Py_DECREF(__pyx_v_min_p2); __pyx_v_min_p2 = Py_None; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":21 */ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_points)); PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_points)); __pyx_4 = PyObject_CallObject(((PyObject *)(&PyEnum_Type)), __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_3 = PyObject_GetIter(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; for (;;) { __pyx_4 = PyIter_Next(__pyx_3); if (!__pyx_4) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} break; } __pyx_5 = PyObject_GetIter(__pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_4; __pyx_4 = 0; __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_v_point); __pyx_v_point = __pyx_4; __pyx_4 = 0; if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} __pyx_5 = PyNumber_Add(__pyx_v_i, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_1 = PyInt_AsSsize_t(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; __pyx_4 = PySequence_GetSlice(((PyObject *)__pyx_v_points), __pyx_1, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} __pyx_5 = PyObject_GetIter(__pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; for (;;) { __pyx_4 = PyIter_Next(__pyx_5); if (!__pyx_4) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} break; } Py_DECREF(__pyx_v_point2); __pyx_v_point2 = __pyx_4; __pyx_4 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":23 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_distance); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} __pyx_6 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} __pyx_7 = PySequence_GetItem(__pyx_v_point, 1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} __pyx_8 = PySequence_GetItem(__pyx_v_point2, 0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} __pyx_9 = PySequence_GetItem(__pyx_v_point2, 1); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} __pyx_10 = PyTuple_New(4); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_10, 0, __pyx_6); PyTuple_SET_ITEM(__pyx_10, 1, __pyx_7); PyTuple_SET_ITEM(__pyx_10, 2, __pyx_8); PyTuple_SET_ITEM(__pyx_10, 3, __pyx_9); __pyx_6 = 0; __pyx_7 = 0; __pyx_8 = 0; __pyx_9 = 0; __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_10); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_10); __pyx_10 = 0; Py_DECREF(__pyx_v_d); __pyx_v_d = __pyx_6; __pyx_6 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":24 */ __pyx_2 = (__pyx_v_min_d == 0); if (!__pyx_2) { __pyx_7 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;} if (PyObject_Cmp(__pyx_7, __pyx_v_d, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;} __pyx_2 = __pyx_2 > 0; Py_DECREF(__pyx_7); __pyx_7 = 0; } if (__pyx_2) { /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":25 */ __pyx_11 = PyFloat_AsDouble(__pyx_v_d); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;} __pyx_v_min_d = __pyx_11; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":26 */ Py_INCREF(__pyx_v_point); Py_DECREF(__pyx_v_min_p1); __pyx_v_min_p1 = __pyx_v_point; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":27 */ Py_INCREF(__pyx_v_point2); Py_DECREF(__pyx_v_min_p2); __pyx_v_min_p2 = __pyx_v_point2; goto __pyx_L7; } __pyx_L7:; } Py_DECREF(__pyx_5); __pyx_5 = 0; } Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":28 */ __pyx_8 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;} __pyx_9 = PyTuple_New(3); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_9, 0, __pyx_8); Py_INCREF(__pyx_v_min_p1); PyTuple_SET_ITEM(__pyx_9, 1, __pyx_v_min_p1); Py_INCREF(__pyx_v_min_p2); PyTuple_SET_ITEM(__pyx_9, 2, __pyx_v_min_p2); __pyx_8 = 0; __pyx_r = __pyx_9; __pyx_9 = 0; goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":30 */ __pyx_12 = PyList_Sort(((PyObject *)__pyx_v_points)); if (__pyx_12 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;} /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":32 */ __pyx_1 = PyObject_Length(((PyObject *)__pyx_v_points)); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;} __pyx_4 = PyInt_FromSsize_t((__pyx_1 / 2)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;} __pyx_10 = PyTuple_New(1); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_10, 0, __pyx_4); __pyx_4 = 0; __pyx_6 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_10); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;} Py_DECREF(__pyx_10); __pyx_10 = 0; Py_DECREF(__pyx_v_split); __pyx_v_split = __pyx_6; __pyx_6 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":33 */ __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n_closest_pair); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} __pyx_1 = PyInt_AsSsize_t(__pyx_v_split); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} __pyx_5 = PySequence_GetSlice(((PyObject *)__pyx_v_points), 0, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); __pyx_5 = 0; __pyx_8 = PyObject_CallObject(__pyx_7, __pyx_3); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_9 = PyObject_GetIter(__pyx_8); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} Py_DECREF(__pyx_8); __pyx_8 = 0; __pyx_4 = __Pyx_UnpackItem(__pyx_9); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} Py_DECREF(__pyx_v_d1); __pyx_v_d1 = __pyx_4; __pyx_4 = 0; __pyx_10 = __Pyx_UnpackItem(__pyx_9); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} Py_DECREF(__pyx_v_p11); __pyx_v_p11 = __pyx_10; __pyx_10 = 0; __pyx_6 = __Pyx_UnpackItem(__pyx_9); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} Py_DECREF(__pyx_v_p12); __pyx_v_p12 = __pyx_6; __pyx_6 = 0; if (__Pyx_EndUnpack(__pyx_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} Py_DECREF(__pyx_9); __pyx_9 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":34 */ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_closest_pair); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} __pyx_1 = PyInt_AsSsize_t(__pyx_v_split); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} __pyx_7 = PySequence_GetSlice(((PyObject *)__pyx_v_points), __pyx_1, PY_SSIZE_T_MAX); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_7); __pyx_7 = 0; __pyx_8 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_4 = PyObject_GetIter(__pyx_8); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} Py_DECREF(__pyx_8); __pyx_8 = 0; __pyx_10 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} Py_DECREF(__pyx_v_d2); __pyx_v_d2 = __pyx_10; __pyx_10 = 0; __pyx_6 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} Py_DECREF(__pyx_v_p21); __pyx_v_p21 = __pyx_6; __pyx_6 = 0; __pyx_9 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} Py_DECREF(__pyx_v_p22); __pyx_v_p22 = __pyx_9; __pyx_9 = 0; if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":35 */ __pyx_7 = __Pyx_GetName(__pyx_b, __pyx_n_min); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;} __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;} Py_INCREF(__pyx_v_d1); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_d1); Py_INCREF(__pyx_v_d2); PyTuple_SET_ITEM(__pyx_5, 1, __pyx_v_d2); __pyx_3 = PyObject_CallObject(__pyx_7, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_v_d); __pyx_v_d = __pyx_3; __pyx_3 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":37 */ __pyx_8 = PyList_New(0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;} Py_DECREF(__pyx_v_points_in_strip); __pyx_v_points_in_strip = __pyx_8; __pyx_8 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":38 */ __pyx_10 = PyInt_FromLong(1); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} __pyx_6 = PyNumber_Subtract(__pyx_v_split, __pyx_10); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} Py_DECREF(__pyx_10); __pyx_10 = 0; __pyx_9 = PyObject_GetItem(((PyObject *)__pyx_v_points), __pyx_6); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_4 = PySequence_GetItem(__pyx_9, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} Py_DECREF(__pyx_9); __pyx_9 = 0; __pyx_7 = PyObject_GetItem(((PyObject *)__pyx_v_points), __pyx_v_split); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} __pyx_5 = PySequence_GetItem(__pyx_7, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; __pyx_3 = PyNumber_Add(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; __pyx_8 = PyFloat_FromDouble(2.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} __pyx_10 = PyNumber_Divide(__pyx_3, __pyx_8); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_8); __pyx_8 = 0; Py_DECREF(__pyx_v_split_at); __pyx_v_split_at = __pyx_10; __pyx_10 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":39 */ __pyx_6 = PyObject_GetIter(((PyObject *)__pyx_v_points)); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;} for (;;) { __pyx_9 = PyIter_Next(__pyx_6); if (!__pyx_9) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;} break; } Py_DECREF(__pyx_v_point); __pyx_v_point = __pyx_9; __pyx_9 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":40 */ __pyx_7 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;} __pyx_4 = PyNumber_Subtract(__pyx_v_split_at, __pyx_v_d); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;} if (PyObject_Cmp(__pyx_7, __pyx_4, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;} __pyx_2 = __pyx_2 < 0; Py_DECREF(__pyx_7); __pyx_7 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_2) { goto __pyx_L8; goto __pyx_L10; } __pyx_5 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;} __pyx_3 = PyNumber_Add(__pyx_v_split_at, __pyx_v_d); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;} if (PyObject_Cmp(__pyx_5, __pyx_3, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;} __pyx_2 = __pyx_2 > 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_2) { goto __pyx_L9; goto __pyx_L10; } __pyx_L10:; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":44 */ __pyx_8 = PyObject_GetAttr(__pyx_v_points_in_strip, __pyx_n_append); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} __pyx_10 = PySequence_GetItem(__pyx_v_point, 1); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} __pyx_9 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} __pyx_7 = PySequence_GetItem(__pyx_v_point, 2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_10); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_9); PyTuple_SET_ITEM(__pyx_4, 2, __pyx_7); __pyx_10 = 0; __pyx_9 = 0; __pyx_7 = 0; __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4); __pyx_4 = 0; __pyx_3 = PyObject_CallObject(__pyx_8, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} Py_DECREF(__pyx_8); __pyx_8 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_L8:; } __pyx_L9:; Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":46 */ __pyx_10 = PyObject_GetAttr(__pyx_v_points_in_strip, __pyx_n_sort); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;} __pyx_9 = PyObject_CallObject(__pyx_10, 0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;} Py_DECREF(__pyx_10); __pyx_10 = 0; Py_DECREF(__pyx_9); __pyx_9 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":48 */ __pyx_v_min_d = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":49 */ Py_INCREF(Py_None); Py_DECREF(__pyx_v_min_p1); __pyx_v_min_p1 = Py_None; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":50 */ Py_INCREF(Py_None); Py_DECREF(__pyx_v_min_p2); __pyx_v_min_p2 = Py_None; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":51 */ __pyx_1 = PyObject_Length(__pyx_v_points_in_strip); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;} __pyx_7 = PyInt_FromSsize_t(__pyx_1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;} Py_DECREF(__pyx_v_max_i); __pyx_v_max_i = __pyx_7; __pyx_7 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":52 */ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;} Py_INCREF(__pyx_v_points_in_strip); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_points_in_strip); __pyx_8 = PyObject_CallObject(((PyObject *)(&PyEnum_Type)), __pyx_4); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_5 = PyObject_GetIter(__pyx_8); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;} Py_DECREF(__pyx_8); __pyx_8 = 0; for (;;) { __pyx_3 = PyIter_Next(__pyx_5); if (!__pyx_3) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;} break; } __pyx_6 = PyObject_GetIter(__pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_10 = __Pyx_UnpackItem(__pyx_6); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_10; __pyx_10 = 0; __pyx_9 = __Pyx_UnpackItem(__pyx_6); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;} Py_DECREF(__pyx_v_point); __pyx_v_point = __pyx_9; __pyx_9 = 0; if (__Pyx_EndUnpack(__pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_7 = PyInt_FromLong(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} __pyx_4 = PyNumber_Add(__pyx_v_i, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; __pyx_1 = PyInt_AsSsize_t(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_8 = __Pyx_GetName(__pyx_b, __pyx_n_min); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(7); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} __pyx_10 = PyNumber_Add(__pyx_v_i, __pyx_3); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_9 = PyTuple_New(2); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_INCREF(__pyx_v_max_i); PyTuple_SET_ITEM(__pyx_9, 0, __pyx_v_max_i); PyTuple_SET_ITEM(__pyx_9, 1, __pyx_10); __pyx_10 = 0; __pyx_6 = PyObject_CallObject(__pyx_8, __pyx_9); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_DECREF(__pyx_8); __pyx_8 = 0; Py_DECREF(__pyx_9); __pyx_9 = 0; __pyx_13 = PyInt_AsSsize_t(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_7 = PySequence_GetSlice(__pyx_v_points_in_strip, __pyx_1, __pyx_13); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} __pyx_4 = PyObject_GetIter(__pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; for (;;) { __pyx_3 = PyIter_Next(__pyx_4); if (!__pyx_3) { if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} break; } Py_DECREF(__pyx_v_point2); __pyx_v_point2 = __pyx_3; __pyx_3 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":54 */ __pyx_10 = __Pyx_GetName(__pyx_m, __pyx_n_distance); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} __pyx_8 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} __pyx_9 = PySequence_GetItem(__pyx_v_point, 1); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} __pyx_6 = PySequence_GetItem(__pyx_v_point2, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} __pyx_7 = PySequence_GetItem(__pyx_v_point2, 1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} __pyx_3 = PyTuple_New(4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_8); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_9); PyTuple_SET_ITEM(__pyx_3, 2, __pyx_6); PyTuple_SET_ITEM(__pyx_3, 3, __pyx_7); __pyx_8 = 0; __pyx_9 = 0; __pyx_6 = 0; __pyx_7 = 0; __pyx_8 = PyObject_CallObject(__pyx_10, __pyx_3); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} Py_DECREF(__pyx_10); __pyx_10 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_sd); __pyx_v_sd = __pyx_8; __pyx_8 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":55 */ __pyx_2 = (__pyx_v_min_d == 0); if (!__pyx_2) { __pyx_9 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;} if (PyObject_Cmp(__pyx_9, __pyx_v_sd, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;} __pyx_2 = __pyx_2 > 0; Py_DECREF(__pyx_9); __pyx_9 = 0; } if (__pyx_2) { /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":56 */ __pyx_11 = PyFloat_AsDouble(__pyx_v_sd); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; goto __pyx_L1;} __pyx_v_min_d = __pyx_11; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":57 */ __pyx_6 = PySequence_GetItem(__pyx_v_point, 1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} __pyx_7 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} __pyx_10 = PySequence_GetItem(__pyx_v_point, 2); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_6); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_7); PyTuple_SET_ITEM(__pyx_3, 2, __pyx_10); __pyx_6 = 0; __pyx_7 = 0; __pyx_10 = 0; Py_DECREF(__pyx_v_min_p1); __pyx_v_min_p1 = __pyx_3; __pyx_3 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":58 */ __pyx_8 = PySequence_GetItem(__pyx_v_point2, 1); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} __pyx_9 = PySequence_GetItem(__pyx_v_point2, 0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} __pyx_6 = PySequence_GetItem(__pyx_v_point2, 2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_7, 0, __pyx_8); PyTuple_SET_ITEM(__pyx_7, 1, __pyx_9); PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6); __pyx_8 = 0; __pyx_9 = 0; __pyx_6 = 0; Py_DECREF(__pyx_v_min_p2); __pyx_v_min_p2 = __pyx_7; __pyx_7 = 0; goto __pyx_L15; } __pyx_L15:; } Py_DECREF(__pyx_4); __pyx_4 = 0; } Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":59 */ __pyx_2 = (__pyx_v_min_d != 0); if (__pyx_2) { __pyx_10 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} if (PyObject_Cmp(__pyx_10, __pyx_v_d, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} __pyx_2 = __pyx_2 < 0; Py_DECREF(__pyx_10); __pyx_10 = 0; } if (__pyx_2) { __pyx_3 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} __pyx_8 = PyTuple_New(3); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_8, 0, __pyx_3); Py_INCREF(__pyx_v_min_p1); PyTuple_SET_ITEM(__pyx_8, 1, __pyx_v_min_p1); Py_INCREF(__pyx_v_min_p2); PyTuple_SET_ITEM(__pyx_8, 2, __pyx_v_min_p2); __pyx_3 = 0; __pyx_r = __pyx_8; __pyx_8 = 0; goto __pyx_L0; goto __pyx_L16; } if (PyObject_Cmp(__pyx_v_d1, __pyx_v_d2, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;} __pyx_2 = __pyx_2 < 0; if (__pyx_2) { __pyx_9 = PyTuple_New(3); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; goto __pyx_L1;} Py_INCREF(__pyx_v_d1); PyTuple_SET_ITEM(__pyx_9, 0, __pyx_v_d1); Py_INCREF(__pyx_v_p11); PyTuple_SET_ITEM(__pyx_9, 1, __pyx_v_p11); Py_INCREF(__pyx_v_p12); PyTuple_SET_ITEM(__pyx_9, 2, __pyx_v_p12); __pyx_r = __pyx_9; __pyx_9 = 0; goto __pyx_L0; goto __pyx_L16; } /*else*/ { __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} Py_INCREF(__pyx_v_d2); PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_d2); Py_INCREF(__pyx_v_p21); PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_p21); Py_INCREF(__pyx_v_p22); PyTuple_SET_ITEM(__pyx_6, 2, __pyx_v_p22); __pyx_r = __pyx_6; __pyx_6 = 0; goto __pyx_L0; } __pyx_L16:; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); Py_XDECREF(__pyx_6); Py_XDECREF(__pyx_7); Py_XDECREF(__pyx_8); Py_XDECREF(__pyx_9); Py_XDECREF(__pyx_10); __Pyx_AddTraceback("closestpair.closest_pair"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_min_p1); Py_DECREF(__pyx_v_min_p2); Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_point); Py_DECREF(__pyx_v_point2); Py_DECREF(__pyx_v_d); Py_DECREF(__pyx_v_split); Py_DECREF(__pyx_v_d1); Py_DECREF(__pyx_v_p11); Py_DECREF(__pyx_v_p12); Py_DECREF(__pyx_v_d2); Py_DECREF(__pyx_v_p21); Py_DECREF(__pyx_v_p22); Py_DECREF(__pyx_v_points_in_strip); Py_DECREF(__pyx_v_split_at); Py_DECREF(__pyx_v_max_i); Py_DECREF(__pyx_v_sd); Py_DECREF(__pyx_v_points); return __pyx_r; }