Beispiel #1
0
void peripheral_curves_as_needed(
    Triangulation *manifold)
{
    /*
     *  Add peripheral curves only to cusps for which all the
     *  tet->curve[][][][] fields are zero.
     */

    Cusp    *cusp;

    attach_extra(manifold);
    initialize_flags(manifold);

    for (cusp = manifold->cusp_list_begin.next;
         cusp != &manifold->cusp_list_end;
         cusp = cusp->next)

        if (cusp->is_finite == FALSE
         && cusp_has_curves(manifold, cusp) == FALSE)

            do_one_cusp(manifold, cusp);

    adjust_Klein_cusp_orientations(manifold);

    free_extra(manifold);
}
Beispiel #2
0
static void
code_dealloc(PyCodeObject *co)
{
    if (co->co_extra != NULL) {
        PyInterpreterState *interp = PyThreadState_Get()->interp;
        _PyCodeObjectExtra *co_extra = co->co_extra;

        for (Py_ssize_t i = 0; i < co_extra->ce_size; i++) {
            freefunc free_extra = interp->co_extra_freefuncs[i];

            if (free_extra != NULL) {
                free_extra(co_extra->ce_extras[i]);
            }
        }

        PyMem_Free(co_extra);
    }

    Py_XDECREF(co->co_code);
    Py_XDECREF(co->co_consts);
    Py_XDECREF(co->co_names);
    Py_XDECREF(co->co_varnames);
    Py_XDECREF(co->co_freevars);
    Py_XDECREF(co->co_cellvars);
    Py_XDECREF(co->co_filename);
    Py_XDECREF(co->co_name);
    Py_XDECREF(co->co_lnotab);
    if (co->co_cell2arg != NULL)
        PyMem_FREE(co->co_cell2arg);
    if (co->co_zombieframe != NULL)
        PyObject_GC_Del(co->co_zombieframe);
    if (co->co_weakreflist != NULL)
        PyObject_ClearWeakRefs((PyObject*)co);
    PyObject_DEL(co);
}
Beispiel #3
0
void peripheral_curves(
    Triangulation *manifold)
{
    Cusp    *cusp;

    zero_peripheral_curves(manifold);
    attach_extra(manifold);
    initialize_flags(manifold);

    for (cusp = manifold->cusp_list_begin.next;
         cusp != &manifold->cusp_list_end;
         cusp = cusp->next)

        if (cusp->is_finite == FALSE)   /* 97/2/4 Added to accomodate finite vertices. */

            do_one_cusp(manifold, cusp);

    adjust_Klein_cusp_orientations(manifold);

    free_extra(manifold);
}