示例#1
0
/*!
 * \param   top   Not used.
 * \param   npar  Not used (should be 2).
 * \param   param Method parameters (should point to one of the distance
 *   parameter arrays).
 * \param   data  Pointer to \c t_methoddata_distance to initialize.
 * \returns 0 on success, a non-zero error code on failure.
 *
 * Initializes the neighborhood search data structure
 * (\c t_methoddata_distance::nb).
 * Also checks that the cutoff is valid.
 */
static void
init_common(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
{
    t_methoddata_distance *d = (t_methoddata_distance *)data;

    if ((param[0].flags & SPAR_SET) && d->cutoff <= 0)
    {
        GMX_THROW(gmx::InvalidInputError("Distance cutoff should be > 0"));
    }
    d->nb = gmx_ana_nbsearch_create(d->cutoff, d->p.nr);
}
示例#2
0
/*!
 * \param   top   Not used.
 * \param   npar  Not used (should be 2).
 * \param   param Method parameters (should point to one of the distance
 *   parameter arrays).
 * \param   data  Pointer to \c t_methoddata_distance to initialize.
 * \returns 0 on success, a non-zero error code on failure.
 *
 * Initializes the neighborhood search data structure
 * (\c t_methoddata_distance::nb).
 * Also checks that the cutoff is valid.
 */
static int
init_common(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
{
    t_methoddata_distance *d = (t_methoddata_distance *)data;

    if ((param[0].flags & SPAR_SET) && d->cutoff <= 0)
    {
        fprintf(stderr, "error: distance cutoff should be > 0");
        return -1;
    }
    return gmx_ana_nbsearch_create(&d->nb, d->cutoff, d->p.nr);
}