*
* If called more than once, memory is (re)allocated to ensure that the
* maximum of the \p isize values can be stored.
+ *
+ * Allocation of POS_VALUE selection elements is a special case, and is
+ * handled by alloc_selection_pos_data().
*/
static void
alloc_selection_data(const SelectionTreeElementPointer &sel,
{
int nalloc;
+ GMX_RELEASE_ASSERT(sel->v.type != POS_VALUE,
+ "Wrong allocation method called");
if (sel->mempool)
{
return;
}
else /* sel->flags should contain SEL_VARNUMVAL */
{
+ // TODO: Consider whether the bChildEval is any longer necessary.
if (!bChildEval)
{
return;
GMX_RELEASE_ASSERT(child,
"Subexpression elements should always have a child element");
}
- nalloc = (sel->v.type == POS_VALUE) ? child->v.u.p->nr : child->v.nr;
- }
- /* For positions, we actually want to allocate just a single structure
- * for nalloc positions. */
- if (sel->v.type == POS_VALUE)
- {
- isize = nalloc;
- nalloc = 1;
+ nalloc = child->v.nr;
}
/* Allocate memory for sel->v.u if needed */
if (sel->flags & SEL_ALLOCVAL)
{
_gmx_selvalue_reserve(&sel->v, nalloc);
}
- /* Reserve memory inside group and position structures if
- * SEL_ALLOCDATA is set. */
+ /* Reserve memory inside group structure if SEL_ALLOCDATA is set. */
+ if ((sel->flags & SEL_ALLOCDATA) && sel->v.type == GROUP_VALUE)
+ {
+ gmx_ana_index_reserve(sel->v.u.g, isize);
+ }
+}
+
+/*! \brief
+ * Allocates memory for storing the evaluated value of a selection element.
+ *
+ * \param sel Selection element to initialize.
+ *
+ * Allocation of POS_VALUE selection elements is a special case, and is
+ * handled by this function instead of by alloc_selection_data().
+ */
+static void
+alloc_selection_pos_data(const SelectionTreeElementPointer &sel)
+{
+ int nalloc, isize;
+
+ GMX_RELEASE_ASSERT(sel->v.type == POS_VALUE,
+ "Wrong allocation method called");
+ GMX_RELEASE_ASSERT(!(sel->flags & SEL_ATOMVAL),
+ "Per-atom evaluated positions not implemented");
+ if (sel->mempool)
+ {
+ return;
+ }
+
+ SelectionTreeElementPointer child = sel;
+ if (sel->type == SEL_SUBEXPRREF)
+ {
+ GMX_RELEASE_ASSERT(sel->child && sel->child->type == SEL_SUBEXPR,
+ "Subexpression expected for subexpression reference");
+ child = sel->child->child;
+ GMX_RELEASE_ASSERT(child,
+ "Subexpression elements should always have a child element");
+ }
+ nalloc = child->v.u.p->nr;
+ isize = child->v.u.p->m.b.nra;
+
+ /* For positions, we want to allocate just a single structure
+ * for nalloc positions. */
+ if (sel->flags & SEL_ALLOCVAL)
+ {
+ _gmx_selvalue_reserve(&sel->v, 1);
+ }
+ sel->v.nr = 1;
+ /* Reserve memory inside position structure if SEL_ALLOCDATA is set. */
if (sel->flags & SEL_ALLOCDATA)
{
- if (sel->v.type == GROUP_VALUE)
- {
- gmx_ana_index_reserve(sel->v.u.g, isize);
- }
- else if (sel->v.type == POS_VALUE)
- {
- gmx_ana_pos_reserve(sel->v.u.p, isize, 0);
- }
+ gmx_ana_pos_reserve(sel->v.u.p, nalloc, isize);
}
}
* \param[in,out] sc Selection collection data.
*
* The evaluation group of each \ref SEL_ROOT element corresponding to a
- * selection in \p sc is set to \p gall. The same is done for \ref SEL_ROOT
- * elements corresponding to subexpressions that need full evaluation.
+ * selection in \p sc is set to NULL. The evaluation grop for \ref SEL_ROOT
+ * elements corresponding to subexpressions that need full evaluation is set
+ * to \c sc->gall.
*/
static void
initialize_evalgrps(gmx_ana_selcollection_t *sc)
GMX_RELEASE_ASSERT(root->child,
"Root elements should always have a child");
if (root->child->type != SEL_SUBEXPR
- || (root->child->cdata->flags & SEL_CDATA_FULLEVAL))
+ || (root->child->v.type != GROUP_VALUE && !(root->flags & SEL_ATOMVAL)))
+ {
+ gmx_ana_index_set(&root->u.cgrp, -1, 0, root->u.cgrp.name, 0);
+ }
+ else if (root->child->cdata->flags & SEL_CDATA_FULLEVAL)
{
gmx_ana_index_set(&root->u.cgrp, sc->gall.isize, sc->gall.index,
root->u.cgrp.name, 0);
if (sel->u.expr.method->outinit)
{
sel->u.expr.method->outinit(top, &sel->v, sel->u.expr.mdata);
- if (sel->v.type != POS_VALUE && sel->v.type != GROUP_VALUE)
+ if (sel->v.type != POS_VALUE && sel->v.type != GROUP_VALUE
+ && !(sel->flags & SEL_VARNUMVAL))
{
alloc_selection_data(sel, isize, true);
}
}
else
{
+ GMX_RELEASE_ASSERT(sel->v.type != POS_VALUE,
+ "Output initialization must be provided for "
+ "position-valued selection methods");
+ GMX_RELEASE_ASSERT(!(sel->flags & SEL_VARNUMVAL),
+ "Output initialization must be provided for "
+ "SMETH_VARNUMVAL selection methods");
alloc_selection_data(sel, isize, true);
if ((sel->flags & SEL_DYNAMIC)
&& sel->v.type != GROUP_VALUE && sel->v.type != POS_VALUE)
case SEL_EXPRESSION:
case SEL_MODIFIER:
- GMX_ASSERT(g, "group cannot be null");
_gmx_sel_evaluate_method_params(data, sel, g);
- init_method(sel, data->top, g->isize);
+ init_method(sel, data->top, g ? g->isize : 0);
if (!(sel->flags & SEL_DYNAMIC))
{
sel->cdata->evaluate(data, sel, g);
{
sel->cdata->evaluate(data, sel, g);
}
- if (bDoMinMax)
+ if (bDoMinMax && g)
{
gmx_ana_index_copy(sel->cdata->gmax, g, true);
}
/* The subexpression should have been evaluated if g is NULL
* (i.e., this is a method parameter or a direct value of a
* selection). */
- alloc_selection_data(sel, sel->child->cdata->gmax->isize, true);
+ if (sel->v.type == POS_VALUE)
+ {
+ alloc_selection_pos_data(sel);
+ }
+ else
+ {
+ alloc_selection_data(sel, sel->child->cdata->gmax->isize, true);
+ }
}
sel->cdata->evaluate(data, sel, g);
if ((sel->cdata->flags & SEL_CDATA_SIMPLESUBEXPR)
{
sel->child->evaluate(data, sel->child, g);
sel->v.nr = sel->child->v.nr;
- gmx_ana_index_set(&sel->u.cgrp, g->isize, g->index, sel->u.cgrp.name, 0);
+ if (!g)
+ {
+ sel->u.cgrp.isize = -1;
+ }
+ else
+ {
+ gmx_ana_index_set(&sel->u.cgrp, g->isize, g->index, sel->u.cgrp.name, 0);
+ }
}
}
{
gmissreserver.reserve(&gmiss, g->isize);
gmx_ana_index_difference(&gmiss, g, &sel->u.cgrp);
+ gmiss.name = NULL;
}
if (gmiss.isize > 0)
{
{
if (i < 0 || (j >= 0 && sel->u.cgrp.index[i] < gmiss.index[j]))
{
- sel->v.u.i[k] = sel->v.u.i[j--];
+ sel->v.u.i[k] = sel->child->v.u.i[j--];
}
else
{
- sel->v.u.i[k] = sel->child->v.u.i[i--];
+ sel->v.u.i[k] = sel->v.u.i[i--];
}
}
break;
{
if (i < 0 || (j >= 0 && sel->u.cgrp.index[i] < gmiss.index[j]))
{
- sel->v.u.r[k] = sel->v.u.r[j--];
+ sel->v.u.r[k] = sel->child->v.u.r[j--];
}
else
{
- sel->v.u.r[k] = sel->child->v.u.r[i--];
+ sel->v.u.r[k] = sel->v.u.r[i--];
}
}
break;
case STR_VALUE:
+ // Note: with the currently allowed syntax, this case is never
+ // reached.
for (k = sel->u.cgrp.isize + gmiss.isize - 1; k >= 0; k--)
{
if (i < 0 || (j >= 0 && sel->u.cgrp.index[i] < gmiss.index[j]))
{
- sel->v.u.s[k] = sel->v.u.s[j--];
+ sel->v.u.s[k] = sel->child->v.u.s[j--];
}
else
{
- sel->v.u.s[k] = sel->child->v.u.s[i--];
+ sel->v.u.s[k] = sel->v.u.s[i--];
}
}
break;
SelectionCollection::Impl::~Impl()
{
clearSymbolTable();
- sc_.sel.clear();
+ // The tree must be freed before the SelectionData objects, since the
+ // tree may hold references to the position data in SelectionData.
sc_.root.reset();
+ sc_.sel.clear();
for (int i = 0; i < sc_.nvars; ++i)
{
sfree(sc_.varstrs[i]);
{
fprintf(fp, "0");
}
+ if (sel.flags & SEL_ALLOCVAL)
+ {
+ fprintf(fp, "Av");
+ }
+ if (sel.flags & SEL_ALLOCDATA)
+ {
+ fprintf(fp, "Ad");
+ }
if (sel.mempool)
{
fprintf(fp, "P");
}
if (!(sel.flags & SEL_ALLOCVAL))
{
- fprintf(fp, " (ext. output)");
+ fprintf(fp, " (ext)");
}
fprintf(fp, "\n");
report_error(fp, method->name, "error: outinit should be provided because the method has POS_VALUE");
bOk = false;
}
+ /* Check presence of outinit for variable output count methods */
+ if ((method->flags & SMETH_VARNUMVAL) && !method->outinit)
+ {
+ report_error(fp, method->name, "error: outinit should be provided because the method has SMETH_VARNUMVAL");
+ bOk = false;
+ }
/* Warn of dynamic callbacks in static methods */
if (!(method->flags & SMETH_MODIFIER))
{
GMX_THROW(gmx::InternalError("Invalid comparison type"));
}
/* Convert the values to the same type */
+ /* TODO: Currently, there are no dynamic integer-valued selection methods,
+ * which means that only the branches with convert_int_real() will ever be
+ * taken. It should be considered whether it is necessary to support these
+ * other cases at all.
+ */
if ((d->left.flags & CMP_REALVAL) && !(d->right.flags & CMP_REALVAL))
{
if (d->left.flags & d->right.flags & CMP_DYNAMICVAL)
t_methoddata_kweval *d = (t_methoddata_kweval *)data;
out->nr = d->g.isize;
+ _gmx_selvalue_reserve(out, out->nr);
}
/*!
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <ParsedSelections Name="Parsed">
+ <ParsedVariable Name="Variable1">
+ <String Name="Input">value = x + y</String>
+ </ParsedVariable>
+ <ParsedSelection Name="Selection1">
+ <String Name="Input">resname RA and value <= 4</String>
+ <String Name="Name">resname RA and value <= 4</String>
+ <String Name="Text">resname RA and value <= 4</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection2">
+ <String Name="Input">resname RA RB and x < 3 and value <= 4</String>
+ <String Name="Name">resname RA RB and x < 3 and value <= 4</String>
+ <String Name="Text">resname RA RB and x < 3 and value <= 4</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ <ParsedVariable Name="Variable2">
+ <String Name="Input">index = atomnr</String>
+ </ParsedVariable>
+ <ParsedSelection Name="Selection3">
+ <String Name="Input">resname RA and index < 3</String>
+ <String Name="Name">resname RA and index < 3</String>
+ <String Name="Text">resname RA and index < 3</String>
+ <Bool Name="Dynamic">false</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection4">
+ <String Name="Input">resname RB and y < 3 and index < 6</String>
+ <String Name="Name">resname RB and y < 3 and index < 6</String>
+ <String Name="Text">resname RB and y < 3 and index < 6</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ </ParsedSelections>
+ <CompiledSelections Name="Compiled">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">9</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection3">
+ <Sequence Name="Atoms">
+ <Int Name="Length">2</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection4">
+ <Sequence Name="Atoms">
+ <Int Name="Length">2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ </Sequence>
+ </Selection>
+ </CompiledSelections>
+ <EvaluatedSelections Name="Frame1">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">4</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>8</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">4</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">5</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">5</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection3">
+ <Sequence Name="Atoms">
+ <Int Name="Length">2</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">2</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection4">
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>4</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">1</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ </EvaluatedSelections>
+</ReferenceData>
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <ParsedSelections Name="Parsed">
+ <ParsedVariable Name="Variable1">
+ <String Name="Input">constpos = [1.0, 2.5, 0.5]</String>
+ </ParsedVariable>
+ <ParsedSelection Name="Selection1">
+ <String Name="Input">constpos</String>
+ <String Name="Name">constpos</String>
+ <String Name="Text">constpos</String>
+ <Bool Name="Dynamic">false</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection2">
+ <String Name="Input">within 2 of constpos</String>
+ <String Name="Name">within 2 of constpos</String>
+ <String Name="Text">within 2 of constpos</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ </ParsedSelections>
+ <CompiledSelections Name="Compiled">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">0</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">1</Int>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">0</Int>
+ </Sequence>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">15</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">15</Int>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>0</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>1</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>2</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>3</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>4</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>5</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>6</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>7</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>8</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>9</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>10</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>11</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>12</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>13</Int>
+ </Sequence>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>14</Int>
+ </Sequence>
+ </Position>
+ </Sequence>
+ </Selection>
+ </CompiledSelections>
+ <EvaluatedSelections Name="Frame1">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">0</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">1</Int>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">0</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.500000</Real>
+ <Real Name="Z">0.500000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">8</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">8</Int>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>0</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>1</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>2</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>3</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>4</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>5</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>6</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Sequence Name="Atoms">
+ <Int Name="Length">1</Int>
+ <Int>7</Int>
+ </Sequence>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ </EvaluatedSelections>
+</ReferenceData>
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <ParsedSelections Name="Parsed">
+ <ParsedSelection Name="Selection1">
+ <String Name="Input">x > 2</String>
+ <String Name="Name">x > 2</String>
+ <String Name="Text">x > 2</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection2">
+ <String Name="Input">2 < x</String>
+ <String Name="Name">2 < x</String>
+ <String Name="Text">2 < x</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection3">
+ <String Name="Input">y > resnr</String>
+ <String Name="Name">y > resnr</String>
+ <String Name="Text">y > resnr</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection4">
+ <String Name="Input">resnr < 2.5</String>
+ <String Name="Name">resnr < 2.5</String>
+ <String Name="Text">resnr < 2.5</String>
+ <Bool Name="Dynamic">false</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection5">
+ <String Name="Input">2.5 > resnr</String>
+ <String Name="Name">2.5 > resnr</String>
+ <String Name="Text">2.5 > resnr</String>
+ <Bool Name="Dynamic">false</Bool>
+ </ParsedSelection>
+ </ParsedSelections>
+ <CompiledSelections Name="Compiled">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">15</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">15</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection3">
+ <Sequence Name="Atoms">
+ <Int Name="Length">15</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection4">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection5">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ </Sequence>
+ </Selection>
+ </CompiledSelections>
+ <EvaluatedSelections Name="Frame1">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">7</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">4.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">4.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">4.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">7</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">4.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">4.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">4.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection3">
+ <Sequence Name="Atoms">
+ <Int Name="Length">4</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>7</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">4</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection4">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">6</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection5">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">6</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ </EvaluatedSelections>
+</ReferenceData>
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <ParsedSelections Name="Parsed">
+ <ParsedVariable Name="Variable1">
+ <String Name="Input">constint = 4</String>
+ </ParsedVariable>
+ <ParsedVariable Name="Variable2">
+ <String Name="Input">constreal1 = 0.5</String>
+ </ParsedVariable>
+ <ParsedVariable Name="Variable3">
+ <String Name="Input">constreal2 = 2.7</String>
+ </ParsedVariable>
+ <ParsedSelection Name="Selection1">
+ <String Name="Input">resnr < constint</String>
+ <String Name="Name">resnr < constint</String>
+ <String Name="Text">resnr < constint</String>
+ <Bool Name="Dynamic">false</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection2">
+ <String Name="Input">x + constreal1 < constreal2</String>
+ <String Name="Name">x + constreal1 < constreal2</String>
+ <String Name="Text">x + constreal1 < constreal2</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ </ParsedSelections>
+ <CompiledSelections Name="Compiled">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">9</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">15</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ </Selection>
+ </CompiledSelections>
+ <EvaluatedSelections Name="Frame1">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">9</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">9</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">8</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">8</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">4.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ </EvaluatedSelections>
+</ReferenceData>
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <ParsedSelections Name="Parsed">
+ <ParsedVariable Name="Variable1">
+ <String Name="Input">foo = res_cog of resname RA</String>
+ </ParsedVariable>
+ <ParsedSelection Name="Selection1">
+ <String Name="Input">foo</String>
+ <String Name="Name">foo</String>
+ <String Name="Text">foo</String>
+ <Bool Name="Dynamic">false</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection2">
+ <String Name="Input">within 1 of foo</String>
+ <String Name="Name">within 1 of foo</String>
+ <String Name="Text">within 1 of foo</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ <ParsedVariable Name="Variable2">
+ <String Name="Input">bar = cog of resname RA</String>
+ </ParsedVariable>
+ <ParsedSelection Name="Selection3">
+ <String Name="Input">bar</String>
+ <String Name="Name">bar</String>
+ <String Name="Text">bar</String>
+ <Bool Name="Dynamic">false</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection4">
+ <String Name="Input">within 1 of bar</String>
+ <String Name="Name">within 1 of bar</String>
+ <String Name="Text">within 1 of bar</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ </ParsedSelections>
+ <CompiledSelections Name="Compiled">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">15</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection3">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection4">
+ <Sequence Name="Atoms">
+ <Int Name="Length">15</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ <Int>11</Int>
+ <Int>12</Int>
+ <Int>13</Int>
+ <Int>14</Int>
+ </Sequence>
+ </Selection>
+ </CompiledSelections>
+ <EvaluatedSelections Name="Frame1">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">2</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.333333</Real>
+ <Real Name="Y">2.666667</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">7</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>9</Int>
+ <Int>10</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">7</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">1.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">3.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection3">
+ <Sequence Name="Atoms">
+ <Int Name="Length">6</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ <Int>8</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">1</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.666667</Real>
+ <Real Name="Y">2.333333</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection4">
+ <Sequence Name="Atoms">
+ <Int Name="Length">4</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ </Sequence>
+ <Sequence Name="Positions">
+ <Int Name="Length">4</Int>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">1.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">2.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ <Position>
+ <Vector Name="Coordinates">
+ <Real Name="X">2.000000</Real>
+ <Real Name="Y">3.000000</Real>
+ <Real Name="Z">0.000000</Real>
+ </Vector>
+ </Position>
+ </Sequence>
+ </Selection>
+ </EvaluatedSelections>
+</ReferenceData>
}
+TEST_F(SelectionCollectionDataTest, HandlesNumericComparisons)
+{
+ static const char * const selections[] = {
+ "x > 2",
+ "2 < x",
+ "y > resnr",
+ "resnr < 2.5",
+ "2.5 > resnr",
+ NULL
+ };
+ setFlags(TestFlags() | efTestEvaluation | efTestPositionCoordinates);
+ runTest("simple.gro", selections);
+}
+
+
TEST_F(SelectionCollectionDataTest, HandlesArithmeticExpressions)
{
static const char * const selections[] = {
}
+TEST_F(SelectionCollectionDataTest, HandlesComplexNumericVariables)
+{
+ static const char * const selections[] = {
+ "value = x + y",
+ "resname RA and value <= 4",
+ "resname RA RB and x < 3 and value <= 4",
+ "index = atomnr",
+ "resname RA and index < 3",
+ "resname RB and y < 3 and index < 6",
+ NULL
+ };
+ setFlags(TestFlags() | efTestEvaluation | efTestPositionCoordinates);
+ runTest("simple.gro", selections);
+}
+
+
+TEST_F(SelectionCollectionDataTest, HandlesPositionVariables)
+{
+ static const char * const selections[] = {
+ "foo = res_cog of resname RA",
+ "foo",
+ "within 1 of foo",
+ "bar = cog of resname RA",
+ "bar",
+ "within 1 of bar",
+ NULL
+ };
+ setFlags(TestFlags() | efTestEvaluation | efTestPositionCoordinates);
+ runTest("simple.gro", selections);
+}
+
+
+TEST_F(SelectionCollectionDataTest, HandlesConstantPositionInVariable)
+{
+ static const char * const selections[] = {
+ "constpos = [1.0, 2.5, 0.5]",
+ "constpos",
+ "within 2 of constpos",
+ NULL
+ };
+ setFlags(TestFlags() | efTestEvaluation | efTestPositionCoordinates
+ | efTestPositionAtoms);
+ runTest("simple.gro", selections);
+}
+
+
+TEST_F(SelectionCollectionDataTest, HandlesNumericConstantsInVariables)
+{
+ static const char * const selections[] = {
+ "constint = 4",
+ "constreal1 = 0.5",
+ "constreal2 = 2.7",
+ "resnr < constint",
+ "x + constreal1 < constreal2",
+ NULL
+ };
+ setFlags(TestFlags() | efTestEvaluation | efTestPositionCoordinates);
+ runTest("simple.gro", selections);
+}
+
+
/********************************************************************
* Tests for complex boolean syntax
*/