Example #1
0
void modena_model_destroy(modena_model_t *m)
{
    size_t j;
    for(j = 0; j < m->substituteModels_size; j++)
    {
        Py_DECREF(m->substituteModels[j].model);
        modena_inputs_destroy(m->substituteModels[j].inputs);
        modena_outputs_destroy(m->substituteModels[j].outputs);
        free(m->substituteModels[j].map_inputs);
        free(m->substituteModels[j].map_outputs);
    }
    free(m->substituteModels);

    free(m->parameters);
    free(m->inputs_min);
    free(m->inputs_max);

    free(m->argPos_used);

    modena_function_destroy(m->mf);

    Py_DECREF(m->pModel);

    m->ob_type->tp_free((PyObject*)m);
}
Example #2
0
static void modena_function_t_dealloc(modena_function_t* self)
{
    modena_function_destroy(self);
}