Example #1
0
static void
init_output_permute(t_topology * /* top */, gmx_ana_selvalue_t *out, void *data)
{
    t_methoddata_permute *d = (t_methoddata_permute *)data;
    int                   i, j, b;

    out->u.p->m.type = d->p.m.type;
    gmx_ana_pos_reserve_for_append(out->u.p, d->p.count(), d->p.m.b.nra,
                                   d->p.v != NULL, d->p.f != NULL);
    gmx_ana_pos_empty_init(out->u.p);
    for (i = 0; i < d->p.count(); i += d->n)
    {
        for (j = 0; j < d->n; ++j)
        {
            b = i + d->rperm[j];
            gmx_ana_pos_append_init(out->u.p, &d->p, b);
        }
    }
}
Example #2
0
/*! \brief
 * Does common initialization to all merging modifiers.
 *
 * \param[in]     top   Topology data structure.
 * \param[in,out] out   Pointer to output data structure.
 * \param[in,out] data  Should point to \c t_methoddata_merge.
 */
static void
init_output_common(t_topology *top, gmx_ana_selvalue_t *out, void *data)
{
    t_methoddata_merge *d = (t_methoddata_merge *)data;

    GMX_UNUSED_VALUE(top);
    if (d->p1.m.type != d->p2.m.type)
    {
        /* TODO: Maybe we could pick something else here? */
        out->u.p->m.type = INDEX_UNKNOWN;
    }
    else
    {
        out->u.p->m.type = d->p1.m.type;
    }
    gmx_ana_pos_reserve_for_append(out->u.p, d->p1.count() + d->p2.count(),
                                   d->p1.m.b.nra + d->p2.m.b.nra,
                                   d->p1.v != NULL, d->p1.f != NULL);
    gmx_ana_pos_empty_init(out->u.p);
}