/*!
 * \param[in,out] m         Mapping structure to free.
 *
 * All the memory allocated for the mapping structure is freed, and
 * the pointers set to NULL.
 * The pointer \p m is not freed.
 */
void
gmx_ana_indexmap_deinit(gmx_ana_indexmap_t *m)
{
    sfree(m->refid);
    if (m->mapid != m->orgid)
    {
        sfree(m->mapid);
    }
    if (m->mapb.nalloc_index > 0)
    {
        sfree(m->mapb.index);
    }
    if (m->mapb.nalloc_a > 0)
    {
        sfree(m->mapb.a);
    }
    sfree(m->orgid);
    if (m->b.nalloc_index > 0)
    {
        sfree(m->b.index);
    }
    if (m->b.nalloc_a > 0)
    {
        sfree(m->b.a);
    }
    gmx_ana_indexmap_clear(m);
}
Esempio n. 2
0
gmx_ana_pos_t::gmx_ana_pos_t()
{
    x = NULL;
    v = NULL;
    f = NULL;
    gmx_ana_indexmap_clear(&m);
    nalloc_x = 0;
}
Esempio n. 3
0
/*!
 * \param[in,out] m         Mapping structure to free.
 *
 * All the memory allocated for the mapping structure is freed, and
 * the pointers set to NULL.
 * The pointer \p m is not freed.
 */
void
gmx_ana_indexmap_deinit(gmx_ana_indexmap_t *m)
{
    sfree(m->refid);
    sfree(m->mapid);
    sfree(m->mapb.index);
    sfree(m->orgid);
    sfree(m->b.index);
    sfree(m->b.a);
    gmx_ana_indexmap_clear(m);
}
Esempio n. 4
0
/*!
 * \param[out] pos      Output structure.
 *
 * Any contents of \p pos are discarded without freeing.
 */
void
gmx_ana_pos_clear(gmx_ana_pos_t *pos)
{
    pos->nr = 0;
    pos->x  = NULL;
    pos->v  = NULL;
    pos->f  = NULL;
    gmx_ana_indexmap_clear(&pos->m);
    pos->g  = NULL;
    pos->nalloc_x = 0;
}