m->b.nalloc_index = 0;
m->b.nalloc_a = 0;
m->bStatic = true;
- m->bMapStatic = true;
}
/*!
m->mapb.nra = m->b.nra;
m->mapb.a = m->b.a;
std::memcpy(m->mapb.index, m->b.index, (m->nr+1)*sizeof(*(m->mapb.index)));
- m->bStatic = true;
- m->bMapStatic = true;
+ m->bStatic = true;
}
/*!
std::memcpy(dest->refid, src->refid, dest->nr*sizeof(*dest->refid));
std::memcpy(dest->mapid, src->mapid, dest->nr*sizeof(*dest->mapid));
std::memcpy(dest->mapb.index, src->mapb.index, (dest->mapb.nr+1)*sizeof(*dest->mapb.index));
- dest->bStatic = src->bStatic;
- dest->bMapStatic = src->bMapStatic;
+ dest->bStatic = src->bStatic;
}
/*! \brief
bool bMaskOnly)
{
int i, j, bi, bj;
- bool bStatic;
/* Process the simple cases first */
if (m->type == INDEX_UNKNOWN && m->b.nra == 0)
{
return;
}
- // TODO: This could also be optimized away under some bStatic conditions.
- if (bMaskOnly)
- {
- set_atoms(m, m->b.nra, m->b.a);
- }
- else
- {
- set_atoms(m, g->isize, g->index);
- }
if (m->type == INDEX_ALL)
{
+ set_atoms(m, g->isize, g->index);
if (m->b.nr > 0)
{
m->mapb.index[1] = g->isize;
return;
}
/* Reset the reference IDs and mapping if necessary */
- bStatic = (g->isize == m->b.nra && m->nr == m->b.nr);
- if (bStatic || bMaskOnly)
+ const bool bToFull = (g->isize == m->b.nra);
+ const bool bWasFull = (m->mapb.nra == m->b.nra);
+ if (bToFull || bMaskOnly)
{
if (!m->bStatic)
{
m->refid[bj] = bj;
}
}
- if (!m->bMapStatic)
+ if (!bWasFull)
{
for (bj = 0; bj < m->b.nr; ++bj)
{
{
m->mapb.index[bj] = m->b.index[bj];
}
- m->bMapStatic = true;
}
+ set_atoms(m, m->b.nra, m->b.a);
+ m->nr = m->mapb.nr = m->b.nr;
}
/* Exit immediately if the group is static */
- if (bStatic)
+ if (bToFull)
{
m->bStatic = true;
return;
}
else
{
+ set_atoms(m, g->isize, g->index);
for (i = j = bi = 0, bj = -1; i < g->isize; ++i)
{
/* Find the next atom in the block */
/* Update the number of blocks */
m->mapb.index[bi] = g->isize;
m->nr = bi;
- m->bMapStatic = false;
}
m->mapb.nr = m->nr;
m->bStatic = false;
pos->m.b.index[0] = 0;
/* This function should only be used to construct all the possible
* positions, so the result should always be static. */
- pos->m.bStatic = true;
- pos->m.bMapStatic = true;
+ pos->m.bStatic = true;
}
/*!
pos->m.mapb.nra = 0;
/* This should not really be necessary, but do it for safety... */
pos->m.mapb.index[0] = 0;
- /* We set the flags to true, although really in the empty state they
- * should be false. This makes it possible to update the flags in
+ /* We set the flag to true, although really in the empty state it
+ * should be false. This makes it possible to update the flag in
* gmx_ana_pos_append(), and just make a simple check in
* gmx_ana_pos_append_finish(). */
- pos->m.bStatic = true;
- pos->m.bMapStatic = true;
+ pos->m.bStatic = true;
}
/*!
{
if (refid != j)
{
- dest->m.bStatic = false;
- dest->m.bMapStatic = false;
+ dest->m.bStatic = false;
}
dest->m.refid[j] = refid;
/* Use the original IDs from the output structure to correctly
{
if (pos->m.nr != pos->m.b.nr)
{
- pos->m.bStatic = false;
- pos->m.bMapStatic = false;
+ pos->m.bStatic = false;
}
}