Gromacs
2022.2
|
#include "gmxpre.h"
#include <cctype>
#include <cstring>
#include <regex>
#include <string>
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
#include "keywords.h"
#include "parsetree.h"
#include "position.h"
#include "scanner.h"
#include "selelem.h"
#include "selmethod.h"
Implements internal selection methods for numeric and string keyword evaluation.
Classes | |
struct | t_methoddata_kwint |
Data structure for integer keyword expression evaluation. More... | |
struct | t_methoddata_kwreal |
Data structure for real keyword expression evaluation. More... | |
class | anonymous_namespace{sm_keywords.cpp}::StringKeywordMatchItem |
Single item in the list of strings/regular expressions to match. More... | |
struct | anonymous_namespace{sm_keywords.cpp}::t_methoddata_kwstr |
Data structure for string keyword expression evaluation. More... | |
struct | t_methoddata_kweval |
Data structure for keyword evaluation in arbitrary groups. More... | |
Typedefs | |
typedef struct t_methoddata_kwint | t_methoddata_kwint |
Data structure for integer keyword expression evaluation. More... | |
typedef struct t_methoddata_kwreal | t_methoddata_kwreal |
Data structure for real keyword expression evaluation. More... | |
Functions | |
static void * | init_data_kwint (int npar, gmx_ana_selparam_t *param) |
Allocates data for integer keyword evaluation. More... | |
static void * | init_data_kwreal (int npar, gmx_ana_selparam_t *param) |
Allocates data for real keyword evaluation. More... | |
static void * | init_data_kwstr (int npar, gmx_ana_selparam_t *param) |
Allocates data for string keyword evaluation. More... | |
static void | init_kwint (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
/brief Initializes data for integer keyword evaluation. More... | |
static void | init_kwreal (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Initializes data for real keyword evaluation. More... | |
static void | init_kwstr (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Initializes data for string keyword evaluation. More... | |
static void | free_data_kwstr (void *data) |
Frees the memory allocated for string keyword evaluation. More... | |
static void | evaluate_keyword_int (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates integer selection keywords. More... | |
static void | evaluate_keyword_real (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates real selection keywords. More... | |
static void | evaluate_keyword_str (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates string selection keywords. More... | |
static void | init_kweval (const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data) |
Initializes keyword evaluation for an arbitrary group. More... | |
static void | init_output_kweval (const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data) |
Initializes output for keyword evaluation in an arbitrary group. More... | |
static void | free_data_kweval (void *data) |
Frees the data allocated for keyword evaluation in an arbitrary group. More... | |
static void | init_frame_kweval (const gmx::SelMethodEvalContext &context, void *data) |
Initializes frame evaluation for keyword evaluation in an arbitrary group. More... | |
static void | evaluate_kweval (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates keywords in an arbitrary group. More... | |
static void | evaluate_kweval_pos (const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data) |
Evaluates keywords in an arbitrary set of positions. More... | |
void | _gmx_selelem_set_kwstr_match_type (const gmx::SelectionTreeElementPointer &sel, gmx::SelectionStringMatchType matchType) |
Sets the string match type for string keyword evaluation. More... | |
static gmx::SelectionTreeElementPointer | init_evaluator_group (gmx_ana_selmethod_t *method, const gmx::SelectionParserParameterList ¶ms, void *scanner) |
Initializes a selection element for evaluating a keyword in a given group. More... | |
static gmx::SelectionTreeElementPointer | init_evaluator_pos (gmx_ana_selmethod_t *method, const gmx::SelectionParserParameterList ¶ms, void *scanner) |
Initializes a selection element for evaluating a keyword in given positions. More... | |
gmx::SelectionTreeElementPointer | _gmx_sel_init_keyword_evaluator (gmx_ana_selmethod_t *method, const gmx::SelectionTreeElementPointer &child, void *scanner) |
Initializes a selection element for evaluating a keyword in a given group. More... | |
Variables | |
static gmx_ana_selparam_t | smparams_keyword_int [] |
Parameters for integer keyword evaluation. More... | |
static gmx_ana_selparam_t | smparams_keyword_real [] |
Parameters for real keyword evaluation. More... | |
static gmx_ana_selparam_t | smparams_keyword_str [] |
Parameters for string keyword evaluation. More... | |
gmx_ana_selmethod_t | sm_keyword_int |
Selection method data for integer keyword evaluation. More... | |
gmx_ana_selmethod_t | sm_keyword_real |
Selection method data for real keyword evaluation. More... | |
gmx_ana_selmethod_t | sm_keyword_str |
Selection method data for string keyword evaluation. More... | |
static gmx_ana_selparam_t | smparams_kweval_group [] |
Parameters for keyword evaluation in an arbitrary group. More... | |
static gmx_ana_selparam_t | smparams_kweval_pos [] |
Parameters for keyword evaluation from positions. More... | |
typedef struct t_methoddata_kwint t_methoddata_kwint |
Data structure for integer keyword expression evaluation.
typedef struct t_methoddata_kwreal t_methoddata_kwreal |
Data structure for real keyword expression evaluation.
gmx::SelectionTreeElementPointer _gmx_sel_init_keyword_evaluator | ( | struct gmx_ana_selmethod_t * | method, |
const gmx::SelectionTreeElementPointer & | child, | ||
void * | scanner | ||
) |
Initializes a selection element for evaluating a keyword in a given group.
[in] | method | Keyword selection method to evaluate. |
[in] | child | The group/positions to evaluate method in. |
[in] | scanner | Scanner data structure. |
Creates a SEL_EXPRESSION selection element that evaluates the keyword method given by method
in the group/positions given by child
.
child
should be a selection tree that evaluates to GROUP_VALUE or POS_VALUE.
void _gmx_selelem_set_kwstr_match_type | ( | const gmx::SelectionTreeElementPointer & | sel, |
gmx::SelectionStringMatchType | matchType | ||
) |
Sets the string match type for string keyword evaluation.
[in,out] | sel | Selection element to initialize. |
[in] | matchType | Method to use to match string values. |
Sets the string matching method for string keyword matching.
|
static |
Evaluates integer selection keywords.
See sel_updatefunc() for description of the parameters. data
should point to a t_methoddata_kwint
.
Does a binary search to find which atoms match the ranges in the t_methoddata_kwint
structure for this selection. Matching atoms are stored in out->u.g
.
|
static |
Evaluates real selection keywords.
See sel_updatefunc() for description of the parameters. data
should point to a t_methoddata_kwreal
.
Does a binary search to find which atoms match the ranges in the t_methoddata_kwreal
structure for this selection. Matching atoms are stored in out->u.g
.
|
static |
Evaluates string selection keywords.
See sel_updatefunc() for description of the parameters. data
should point to a t_methoddata_kwstr
.
Does a linear search to find which atoms match the strings in the t_methoddata_kwstr
structure for this selection. Wildcards are allowed in the strings. Matching atoms are stored in out->u.g
.
|
static |
Evaluates keywords in an arbitrary group.
See sel_updatefunc() for description of the parameters. data
should point to a t_methoddata_kweval
.
Calls the evaluation function of the wrapped keyword with the given parameters, with the exception of using t_methoddata_kweval::g
for the evaluation group.
|
static |
Evaluates keywords in an arbitrary set of positions.
See sel_updatefunc() for description of the parameters. data
should point to a t_methoddata_kweval
.
Calls the evaluation function of the wrapped keyword with the given parameters, with the exception of using t_methoddata_kweval::p
for the evaluation positions.
|
static |
Frees the data allocated for keyword evaluation in an arbitrary group.
data | Data to free (should point to a t_methoddata_kweval ). |
Frees the memory allocated for all the members of t_methoddata_kweval
.
|
static |
Frees the memory allocated for string keyword evaluation.
data | Data to free (should point to a t_methoddata_kwstr). |
|
static |
Allocates data for integer keyword evaluation.
[in] | npar | Not used. |
param | Not used. |
Allocates memory for a t_methoddata_kwint structure.
|
static |
Allocates data for real keyword evaluation.
[in] | npar | Not used. |
param | Not used. |
Allocates memory for a t_methoddata_kwreal structure.
|
static |
Allocates data for string keyword evaluation.
[in] | npar | Not used. |
param | Not used. |
Allocates memory for a t_methoddata_kwstr structure.
|
static |
Initializes a selection element for evaluating a keyword in a given group.
[in] | method | Keyword selection method to evaluate. |
[in] | params | Parameters to pass to initialization (the child group). |
[in] | scanner | Scanner data structure. |
Implements _gmx_sel_init_keyword_evaluator() for GROUP_VALUE input selections.
|
static |
Initializes a selection element for evaluating a keyword in given positions.
[in] | method | Keyword selection method to evaluate. |
[in] | params | Parameters to pass to initialization (the child positions). |
[in] | scanner | Scanner data structure. |
Implements _gmx_sel_init_keyword_evaluator() for POS_VALUE input selections.
|
static |
Initializes frame evaluation for keyword evaluation in an arbitrary group.
[in] | context | Evaluation context. |
data | Should point to a t_methoddata_kweval. |
|
static |
Initializes keyword evaluation for an arbitrary group.
[in] | top | Not used. |
[in] | npar | Not used. |
[in] | param | Not used. |
[in] | data | Should point to t_methoddata_kweval. |
Calls the initialization method of the wrapped keyword.
|
static |
/brief Initializes data for integer keyword evaluation.
[in] | top | Not used. |
[in] | npar | Not used (should be 2). |
[in] | param | Method parameters (should point to smparams_keyword_int). |
[in] | data | Should point to t_methoddata_kwint. |
|
static |
Initializes data for real keyword evaluation.
[in] | top | Not used. |
[in] | npar | Not used (should be 2). |
[in] | param | Method parameters (should point to smparams_keyword_real). |
[in] | data | Should point to t_methoddata_kwreal. |
|
static |
Initializes data for string keyword evaluation.
[in] | top | Not used. |
[in] | npar | Not used (should be 2). |
[in] | param | Method parameters (should point to smparams_keyword_str). |
[in] | data | Should point to t_methoddata_kwstr. |
|
static |
Initializes output for keyword evaluation in an arbitrary group.
[in] | top | Not used. |
[in,out] | out | Pointer to output data structure. |
[in,out] | data | Should point to t_methoddata_kweval . |
gmx_ana_selmethod_t sm_keyword_int |
Selection method data for integer keyword evaluation.
gmx_ana_selmethod_t sm_keyword_real |
Selection method data for real keyword evaluation.
gmx_ana_selmethod_t sm_keyword_str |
Selection method data for string keyword evaluation.
|
static |
|
static |
Parameters for real keyword evaluation.
|
static |
|
static |
Parameters for keyword evaluation in an arbitrary group.
|
static |