Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::pack_daemon::DynamicAggregateFunction Class Reference

#include <DynamicAggregateFunction.hh>

Inheritance diagram for protocols::pack_daemon::DynamicAggregateFunction:
Inheritance graph
[legend]

Public Types

typedef MultistateAggregateFunction parent
 
typedef
protocols::genetic_algorithm::Entity 
Entity
 
typedef
numeric::expression_parser::Expression 
Expression
 
typedef
numeric::expression_parser::ExpressionOP 
ExpressionOP
 
typedef
numeric::expression_parser::ExpressionCOP 
ExpressionCOP
 
typedef
numeric::expression_parser::VariableExpression 
VariableExpression
 
typedef
numeric::expression_parser::VariableExpressionOP 
VariableExpressionOP
 
typedef
numeric::expression_parser::VariableExpressionCOP 
VariableExpressionCOP
 
typedef
numeric::expression_parser::ArithmeticASTExpressionOP 
ArithmeticASTExpressionOP
 
typedef utility::vector1
< core::Real
ExpressionValues
 
typedef core::Size Size
 
- Public Types inherited from protocols::pack_daemon::MultistateAggregateFunction
typedef utility::VirtualBase parent
 
typedef utility::vector1
< core::Real
StateEnergies
 
typedef utility::vector1
< core::Size
StateIndices
 
typedef
protocols::genetic_algorithm::Entity 
Entity
 

Public Member Functions

 DynamicAggregateFunction ()
 
 ~DynamicAggregateFunction () override
 
void set_num_entity_elements (core::Size setting)
 
void set_score_function (core::scoring::ScoreFunction const &sfxn)
 
core::Size num_states () const
 
core::Size num_npd_properties () const
 
core::Size num_npd_properties_for_state (core::Size state_id) const
 
core::Real evaluate (StateEnergies const &, StateEnergies const &npd_properties, Entity const &) override
 
StateIndices select_relevant_states (StateEnergies const &en, StateEnergies const &npd, Entity const &) override
 
ExpressionCOP variable_expression (numeric::expression_parser::ArithmeticASTValue const &) const
 
ExpressionCOP function_expression (numeric::expression_parser::FunctionTokenCOP function, utility::vector1< ExpressionCOP > const &args) const
 
void add_file_contents (std::string const &fname, std::string const &contents)
 Pair a file name with a string – instead of opening a file when asked to read this file, the DAF will use the contents of the file as provided. Useful for testing purposes. More...
 
std::string state_name (core::Size state_index) const
 
StructureFileNames const & file_inputs_for_job (int job_index) const
 
void read_all_variables_from_input_file (std::istream &input)
 Initialize from an input stream without trying to communicate with remote nodes. More...
 
std::list< std::pair
< core::Size, std::string >
>::const_iterator 
npd_variable_indices_for_state_begin (core::Size state_id) const
 
std::list< std::pair
< core::Size, std::string >
>::const_iterator 
npd_variable_indices_for_state_end (core::Size state_id) const
 
- Public Member Functions inherited from protocols::pack_daemon::MultistateAggregateFunction
 MultistateAggregateFunction ()
 
 ~MultistateAggregateFunction () override
 

Protected Member Functions

void count_file_reads ()
 
std::string get_file_contents (std::string const &filename)
 

Private Member Functions

void initialize_scanner ()
 
void process_STATE_line (std::string const &line, core::Size line_number, std::istream &input_line)
 
void process_STATE_VECTOR_line (std::string const &line, core::Size line_number, std::istream &input_line, utility::vector1< std::pair< std::string, std::string > > &strucvec_filenames)
 
void process_POSE_ENERGY_line (std::string const &line, core::Size line_number, std::istream &input_line)
 
void process_POSE_ENERGY_VECTOR_line (std::string const &line, core::Size line_number, std::istream &input_line)
 
void process_NPD_PROPERTY_line (std::string const &line, core::Size line_number, std::istream &input_line)
 
void process_VECTOR_VARIABLE_line (std::string const &line, core::Size line_number, std::istream &input_line, std::map< std::string, std::list< std::string > > &vector_variables)
 
void process_SCALAR_EXPRESSION_line (std::string const &line, core::Size line_number, std::istream &input_line, std::map< std::string, ArithmeticASTExpressionOP > &scalar_expression_asts)
 
void process_VECTOR_EXPRESSION_line (std::string const &line, core::Size line_number, std::istream &input_line, std::map< std::string, std::pair< std::map< std::string, std::string >, ArithmeticASTExpressionOP > > &vector_expression_list)
 
void process_ENTITY_FUNCTION_line (std::string const &line, core::Size line_number, std::istream &input_line)
 
void process_FITNESS_line (std::string const &line, core::Size line_number, std::istream &input_line, ArithmeticASTExpressionOP &fitness_expression_ast)
 
void save_scalar_variable (std::string const &varname, core::Size line_number)
 
void save_vector_variable (std::string const &varname, core::Size line_number)
 
void read_state_vector_file (std::string const &vec_varname, std::string const &fname, core::Size &n_vector_states)
 
void create_state_variable_expressions (core::Size &count_state, core::Size &count_npd_index, core::Size &count_variable_index)
 
void create_variable_vector_expressions (core::Size &count_state, core::Size &count_npd_index, core::Size &count_variable_index)
 
void create_scalar_and_vector_expression_variable_expressions (std::map< std::string, ArithmeticASTExpressionOP > const &scalar_expression_asts, std::map< std::string, std::list< std::string > > const &vector_variables, core::Size &count_state)
 
void turn_expression_ASTs_into_expressions (std::map< std::string, ArithmeticASTExpressionOP > const &scalar_expression_asts, std::map< std::string, std::pair< std::map< std::string, std::string >, ArithmeticASTExpressionOP > > const &vector_expression_asts, ArithmeticASTExpressionOP fitness_expression_ast)
 
utility::vector1
< VectorExpressionCOP
verify_vector_arguments (std::string const &fname, utility::vector1< ExpressionCOP > const &args, core::Size expected_nargs) const
 
void verify_variable_name_or_throw (std::string const &vname, std::string const &command_name, std::string const &line, core::Size line_number)
 
void assign_state_energies_to_variables_and_subexpressions (StateEnergies const &state_energies, StateEnergies const &npd_properties, Entity const &entity, bool verbose=false)
 
core::Size count_num_npd_properties () const
 used to determine the number of requested NPD properties that will be calculated; used to size the variable_expressions_for_npd_properties_ array. More...
 

Private Attributes

core::Size num_entity_elements_
 
core::scoring::ScoreFunctionOP sfxn_
 
ExpressionCOP fitness_exp_
 
utility::vector1
< VariableExpressionOP
variable_expressions_for_states_
 
utility::vector1< std::list
< std::pair< core::Size,
std::string > > > 
npd_variable_indices_for_states_
 
utility::vector1
< VariableExpressionOP
variable_expressions_for_npd_properties_
 
utility::vector1
< VariableExpressionOP
variable_expressions_
 
numeric::expression_parser::ArithmeticScannerOP scanner_
 
std::list< VectorFunctionOPvfuncs_
 
std::list< std::pair
< core::Size, std::string > > 
expression_evaluation_order_by_name_
 
utility::vector1< std::pair
< core::Size, ExpressionCOP > > 
scalar_expressions_
 
std::map< core::Size,
SurrogateVariableExpressionOP
surrogate_expression_map_
 
std::map< std::string,
VariableExpressionCOP
scalar_expression_map_
 
std::map< std::string,
VectorExpressionCOP
vector_expression_map_
 
std::set< std::string > state_variable_names_
 
std::set< std::string > state_vector_variable_names_
 
std::map< std::string,
ExpressionCOP
named_state_expression_map_
 
std::map< std::string,
VariableVectorExpressionOP
state_vector_variables_
 
std::map< std::string,
std::list< std::pair
< std::string, std::string > > > 
npd_properties_for_state_variables_
 
std::map< std::string,
ExpressionCOP
npd_property_expression_map_
 
std::map< std::string,
VariableVectorExpressionOP
npd_property_vector_expression_map_
 
std::set< std::string > function_names_
 Function names may not be used as variable names. More...
 
std::set< std::string > illegal_variable_names_
 
std::map< std::string, core::Sizevariable_names_dec_line_
 
std::map< std::string, core::Sizescalar_variable_names_dec_line_
 
std::map< std::string, core::Sizevector_variable_names_dec_line_
 
std::map< std::string,
std::pair< EntityFuncOP,
VariableExpressionOP > > 
entity_funcs_
 
std::map< std::string, core::Sizeentity_funcs_dec_line_
 
std::map< std::string, core::Sizevariable_name_2_variable_exp_index_
 Keep track for each varible name (or scalar expression name) its index in the ?? vector. More...
 
std::map< std::string, core::Sizestate_variable_name_2_state_index_
 Keep track for each state-variable name its state's index. More...
 
std::map< std::string,
StructureFileNames
named_state_data_file_names_
 
std::map< std::string,
utility::vector1
< StructureFileNames > > 
state_vector_data_file_names_
 
utility::vector1
< StructureFileNames
files_for_state_
 
std::map< std::string,
utility::vector1< core::Size > > 
state_indices_for_state_vector_
 
IterativeVectorExpressionOP focused_iterative_vector_expression_
 
utility::io::FileContentsMapOP file_contents_
 

Member Typedef Documentation

typedef numeric::expression_parser::ArithmeticASTExpressionOP protocols::pack_daemon::DynamicAggregateFunction::ArithmeticASTExpressionOP
typedef numeric::expression_parser::Expression protocols::pack_daemon::DynamicAggregateFunction::Expression
typedef numeric::expression_parser::ExpressionCOP protocols::pack_daemon::DynamicAggregateFunction::ExpressionCOP
typedef numeric::expression_parser::ExpressionOP protocols::pack_daemon::DynamicAggregateFunction::ExpressionOP
typedef numeric::expression_parser::VariableExpression protocols::pack_daemon::DynamicAggregateFunction::VariableExpression
typedef numeric::expression_parser::VariableExpressionCOP protocols::pack_daemon::DynamicAggregateFunction::VariableExpressionCOP
typedef numeric::expression_parser::VariableExpressionOP protocols::pack_daemon::DynamicAggregateFunction::VariableExpressionOP

Constructor & Destructor Documentation

protocols::pack_daemon::DynamicAggregateFunction::DynamicAggregateFunction ( )
protocols::pack_daemon::DynamicAggregateFunction::~DynamicAggregateFunction ( )
overridedefault

Member Function Documentation

void protocols::pack_daemon::DynamicAggregateFunction::add_file_contents ( std::string const &  fname,
std::string const &  contents 
)

Pair a file name with a string – instead of opening a file when asked to read this file, the DAF will use the contents of the file as provided. Useful for testing purposes.

References file_contents_.

void protocols::pack_daemon::DynamicAggregateFunction::assign_state_energies_to_variables_and_subexpressions ( StateEnergies const &  state_energies,
StateEnergies const &  npd_properties,
Entity const &  entity,
bool  verbose = false 
)
private
void protocols::pack_daemon::DynamicAggregateFunction::count_file_reads ( )
protected
core::Size protocols::pack_daemon::DynamicAggregateFunction::count_num_npd_properties ( ) const
private

used to determine the number of requested NPD properties that will be calculated; used to size the variable_expressions_for_npd_properties_ array.

References named_state_data_file_names_, npd_properties_for_state_variables_, and state_vector_data_file_names_.

Referenced by read_all_variables_from_input_file().

void protocols::pack_daemon::DynamicAggregateFunction::create_scalar_and_vector_expression_variable_expressions ( std::map< std::string, ArithmeticASTExpressionOP > const &  scalar_expression_asts,
std::map< std::string, std::list< std::string > > const &  vector_variables,
core::Size count_variable_index 
)
private

creates a variable expression for each sub-expression that will hold the intermediate result of a sub-expression. Increments the count_variable_index input parameter and places the VariableExpression into the variable_expressions_ array into position count_variable_index.

References scalar_expression_map_, surrogate_expression_map_, variable_expressions_, variable_name_2_variable_exp_index_, and vector_expression_map_.

Referenced by read_all_variables_from_input_file().

void protocols::pack_daemon::DynamicAggregateFunction::create_state_variable_expressions ( core::Size count_state,
core::Size count_npd_index,
core::Size count_variable_index 
)
private

For each element of the named_state_data_file_names_ data member, creates a VariableExpression (named with the variable name given in the STATE command from the DynamicAggregateFunction input file). This variable expression is put into three member variables: the variable_expressions_for_states_ vector, the variable_expressions_ vector, and the named_state_expression_map_. This method increments the count_states input parameter for each VariableExpression that it processes, pairing the value of the count_states variable with the index for this VariableExpression in both the variable_expressions_for_states_ vector and in the variable_expressions_ vector.

References files_for_state_, named_state_data_file_names_, named_state_expression_map_, npd_properties_for_state_variables_, npd_variable_indices_for_states_, scalar_expression_map_, state_variable_name_2_state_index_, variable_expressions_, variable_expressions_for_npd_properties_, variable_expressions_for_states_, and variable_name_2_variable_exp_index_.

Referenced by read_all_variables_from_input_file().

void protocols::pack_daemon::DynamicAggregateFunction::create_variable_vector_expressions ( core::Size count_state,
core::Size count_npd_index,
core::Size count_variable_index 
)
private

This method iterates across state_vector_data_file_names_ map, and creates a VariableVectorExpression for each entry. It adds this VariableVectorExpression to the state_vector_variables_ map. For each element in the state_vector_data_file_names_ map, and for each state-file-triple held in each particular element, it creates a VariableExpression and pairs the index in the input count_state vector. This VariableExpression is added to three member variables: the variable_expressions_for_states_ vector, the variable_expressions_ vector. Each VariableVectorExpression is given a vector of its set of VariableExpressions in its constructor. It will access these variables directly when it is queried for its vector_values. The indices of the state varaibles are inserted into the state_indices_for_state_vector_ map.

References files_for_state_, npd_properties_for_state_variables_, npd_variable_indices_for_states_, state_indices_for_state_vector_, state_variable_name_2_state_index_, state_vector_data_file_names_, state_vector_variables_, core::id::to_string(), variable_expressions_, variable_expressions_for_npd_properties_, variable_expressions_for_states_, variable_name_2_variable_exp_index_, and vector_expression_map_.

Referenced by read_all_variables_from_input_file().

core::Real protocols::pack_daemon::DynamicAggregateFunction::evaluate ( StateEnergies const &  state_energies,
StateEnergies const &  npd_properties,
Entity const &  entity 
)
overridevirtual
StructureFileNames const & protocols::pack_daemon::DynamicAggregateFunction::file_inputs_for_job ( int  job_index) const
ExpressionCOP protocols::pack_daemon::DynamicAggregateFunction::function_expression ( numeric::expression_parser::FunctionTokenCOP  function,
utility::vector1< ExpressionCOP > const &  args 
) const

Handles the functions that the ExpressionCreator base class does not. Ensures that the functions that are expecting vector arguments are actually given vector arguments. This is not guaranteed by the scanning or parsing of the input file.

References core::id::to_string(), and verify_vector_arguments().

Referenced by protocols::pack_daemon::VectorExpressionCreator::handle_function_expression().

std::string protocols::pack_daemon::DynamicAggregateFunction::get_file_contents ( std::string const &  filename)
protected
void protocols::pack_daemon::DynamicAggregateFunction::initialize_scanner ( )
private

References scanner_.

Referenced by read_all_variables_from_input_file().

std::list< std::pair< core::Size, std::string > >::const_iterator protocols::pack_daemon::DynamicAggregateFunction::npd_variable_indices_for_state_begin ( core::Size  state_id) const
std::list< std::pair< core::Size, std::string > >::const_iterator protocols::pack_daemon::DynamicAggregateFunction::npd_variable_indices_for_state_end ( core::Size  state_id) const
core::Size protocols::pack_daemon::DynamicAggregateFunction::num_npd_properties ( ) const
core::Size protocols::pack_daemon::DynamicAggregateFunction::num_npd_properties_for_state ( core::Size  state_id) const
core::Size protocols::pack_daemon::DynamicAggregateFunction::num_states ( ) const
void protocols::pack_daemon::DynamicAggregateFunction::process_ENTITY_FUNCTION_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line 
)
private
void protocols::pack_daemon::DynamicAggregateFunction::process_FITNESS_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line,
ArithmeticASTExpressionOP fitness_expression_ast 
)
private

This method reads the line of the input file beginning with the command FITNESS. Each DynamicAggregateFunction input file should contain exactly one FITNESS command. The fitness line should be of the form: FITNESS <expression> where the expression must return a value (it should not be a vector expression) and may refer to functions and variables so long as those variables have been declared earlier in the file. The abstract syntax tree (ast) for the fitness expression is returned in the input parameter, fitness_expression_ast.

References scanner_, and core::id::to_string().

Referenced by read_all_variables_from_input_file().

void protocols::pack_daemon::DynamicAggregateFunction::process_NPD_PROPERTY_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line 
)
private
void protocols::pack_daemon::DynamicAggregateFunction::process_POSE_ENERGY_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line 
)
private
void protocols::pack_daemon::DynamicAggregateFunction::process_POSE_ENERGY_VECTOR_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line 
)
private
void protocols::pack_daemon::DynamicAggregateFunction::process_SCALAR_EXPRESSION_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line,
std::map< std::string, ArithmeticASTExpressionOP > &  scalar_expression_asts 
)
private

This methods reads the line beginning with the command SCALAR_EXPRESSION which should be in the following format ( items in <> are explained below) SCALAR_EXPRESSION <varname> = <expression>

  1. varname must be an as-of-yet unused varible name.
  2. The form of expression must return a value (it should not be a vector expression). It may contain functions and variables so long as those variables have been declared earlier in the file. After the expression has been tokenized, it's abstract syntax tree (ast) is created and appended to the input parameter scalar_expression_asts in tandem with the variable name. The variable name is appended to the variables_ and scanner_ member variables. No other member variables are modified in this function.

References expression_evaluation_order_by_name_, save_scalar_variable(), scanner_, core::id::to_string(), and verify_variable_name_or_throw().

Referenced by read_all_variables_from_input_file().

void protocols::pack_daemon::DynamicAggregateFunction::process_STATE_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line 
)
private

Reads the contents of the line which should include four things:

  1. an as-of-yet unused variable name to identify this state,
  2. a pdb name giving the file containing the state to be redesigned
  3. a correspondence file name which describes the connection between residues in the state from 2. which should correspond to particular residues that are being designed.
  4. a secondary resfile that describes how other residues in 2. should be repacked or redesigned. The variable name in 1. is checked against the variable_names_dec_line_ member variable, and, if it is absent, be added to both variable_names_dec_line_ and scanner_. This method then adds the file names from 2, 3, and 4 to the named_state_data_file_names_ map.

References protocols::pack_daemon::StructureFileNames::correspondence_file_name_, named_state_data_file_names_, protocols::pack_daemon::StructureFileNames::pdb_name_, protocols::pack_daemon::StructureFileNames::resfile_name_, save_scalar_variable(), state_name(), state_variable_names_, core::id::to_string(), and verify_variable_name_or_throw().

Referenced by read_all_variables_from_input_file().

void protocols::pack_daemon::DynamicAggregateFunction::process_STATE_VECTOR_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line,
utility::vector1< std::pair< std::string, std::string > > &  strucvec_filenames 
)
private

This method reads a line beginning with the command STATE_VECTOR looking for two things on this line:

  1. an as-of-yet unused variable name identifying the vector
  2. a file name which contains a list of states. If the variable name is absent from the variables_ set, then this method appends the name to the variables_ set and to the scanner_, and appends the pair (1,2) to the input strucvec_filenames parameter. No other member variables are modified.

References save_vector_variable(), state_vector_variable_names_, core::id::to_string(), and verify_variable_name_or_throw().

Referenced by read_all_variables_from_input_file().

void protocols::pack_daemon::DynamicAggregateFunction::process_VECTOR_EXPRESSION_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line,
std::map< std::string, std::pair< std::map< std::string, std::string >, ArithmeticASTExpressionOP > > &  vector_expression_list 
)
private
void protocols::pack_daemon::DynamicAggregateFunction::process_VECTOR_VARIABLE_line ( std::string const &  line,
core::Size  line_number,
std::istream &  input_line,
std::map< std::string, std::list< std::string > > &  vector_variables 
)
private
void protocols::pack_daemon::DynamicAggregateFunction::read_all_variables_from_input_file ( std::istream &  input)
void protocols::pack_daemon::DynamicAggregateFunction::read_state_vector_file ( std::string const &  vec_varname,
std::string const &  fname,
core::Size n_vector_states 
)
private

This function reads the contents of a state-vector file. The input parameter vec_varname refers to the variable name associated with the file named by the second input parameter – this pairing occurred somewhere in the DynamicAggregateFunction input file in a STATE_VECTOR command. The format of the state vector should be a series of lines each with three strings. String 1: the name of the pdb file containing a state that should be repacked. String 2: the name of the correspondence file mapping residues in the input pdb to the shared residues. String 3: the name of the secondary resfile describing how the packer should treat residues other than the correspondence residues in the protein. Lines beginning with "#" are ignored. The triples read from this file are appended to the state_vector_data_file_names_ member variable. The method increments the input variable n_vector_states for each triple that it reads from the state-vector file.

References protocols::pack_daemon::StructureFileNames::correspondence_file_name_, file_contents_, protocols::pack_daemon::StructureFileNames::pdb_name_, protocols::pack_daemon::StructureFileNames::resfile_name_, state_vector_data_file_names_, core::id::to_string(), and variable_names_dec_line_.

Referenced by read_all_variables_from_input_file().

void protocols::pack_daemon::DynamicAggregateFunction::save_scalar_variable ( std::string const &  varname,
core::Size  line_number 
)
private
void protocols::pack_daemon::DynamicAggregateFunction::save_vector_variable ( std::string const &  varname,
core::Size  line_number 
)
private
DynamicAggregateFunction::StateIndices protocols::pack_daemon::DynamicAggregateFunction::select_relevant_states ( StateEnergies const &  state_energies,
StateEnergies const &  npd_properties,
Entity const &  entity 
)
overridevirtual

Relies on the Expression "active_variables" method to determine which variables are selected and contribute to the fitness function

Implements protocols::pack_daemon::MultistateAggregateFunction.

References assign_state_energies_to_variables_and_subexpressions(), fitness_exp_, and state_variable_name_2_state_index_.

void protocols::pack_daemon::DynamicAggregateFunction::set_num_entity_elements ( core::Size  setting)

References num_entity_elements_.

void protocols::pack_daemon::DynamicAggregateFunction::set_score_function ( core::scoring::ScoreFunction const &  sfxn)

Required for processing the POSE_ENERGY and POSE_ENERGY_VECTOR commands

References core::scoring::ScoreFunction::clone(), and sfxn_.

std::string protocols::pack_daemon::DynamicAggregateFunction::state_name ( core::Size  state_index) const
void protocols::pack_daemon::DynamicAggregateFunction::turn_expression_ASTs_into_expressions ( std::map< std::string, ArithmeticASTExpressionOP > const &  scalar_expression_asts,
std::map< std::string, std::pair< std::map< std::string, std::string >, ArithmeticASTExpressionOP > > const &  vector_expression_asts,
ArithmeticASTExpressionOP  fitness_expression_ast 
)
private

Turns expression abstract-syntax trees into Expression objects. The VectorExpressionCreator keeps a reference to me so that it can pass control of flow to me when processing variable- and function-construction events. The scalar_expressions_ array is updated to hold the ExpressionOPs for these sub-expressions as pairs each Expression with the corresponding index of its VariableExpression so that I can later update that VariableExpression (held in the variable_expressions_ array) when evaluating that sub-expression. The fitness_exp_ is assigned to the Expression coming from the fitness_expression_ast.

References expression_evaluation_order_by_name_, fitness_exp_, focused_iterative_vector_expression_, scalar_expressions_, surrogate_expression_map_, variable_name_2_variable_exp_index_, and vector_expression_map_.

Referenced by read_all_variables_from_input_file().

ExpressionCOP protocols::pack_daemon::DynamicAggregateFunction::variable_expression ( numeric::expression_parser::ArithmeticASTValue const &  ) const

returns a VariableExpressionOP or VectorVariableExpressionOP given a particular variable. Throws an exception if a variable is requested that is not a member of any of the following maps: named_state_expression_map_, state_vector_variables_, or sub_expression_map_.

References entity_funcs_, focused_iterative_vector_expression_, named_state_expression_map_, scalar_expression_map_, state_vector_variables_, core::id::to_string(), and vector_expression_map_.

Referenced by protocols::pack_daemon::VectorExpressionCreator::handle_variable_expression().

void protocols::pack_daemon::DynamicAggregateFunction::verify_variable_name_or_throw ( std::string const &  vname,
std::string const &  command_name,
std::string const &  line,
core::Size  line_number 
)
private
utility::vector1< VectorExpressionCOP > protocols::pack_daemon::DynamicAggregateFunction::verify_vector_arguments ( std::string const &  fname,
utility::vector1< ExpressionCOP > const &  args,
core::Size  expected_nargs 
) const
private

Verifies that the args array for a vector function has size 1, and that the sole element is a VectorExpression. Returns an owning-pointer to the downcasted VectorExpression, or throws an exception if the downcast fails.

References core::id::to_string().

Referenced by function_expression().

Member Data Documentation

std::map< std::string, std::pair< EntityFuncOP, VariableExpressionOP > > protocols::pack_daemon::DynamicAggregateFunction::entity_funcs_
private
std::map< std::string, core::Size > protocols::pack_daemon::DynamicAggregateFunction::entity_funcs_dec_line_
private
std::list< std::pair< core::Size, std::string > > protocols::pack_daemon::DynamicAggregateFunction::expression_evaluation_order_by_name_
private
utility::io::FileContentsMapOP protocols::pack_daemon::DynamicAggregateFunction::file_contents_
private
utility::vector1< StructureFileNames > protocols::pack_daemon::DynamicAggregateFunction::files_for_state_
private
ExpressionCOP protocols::pack_daemon::DynamicAggregateFunction::fitness_exp_
private
IterativeVectorExpressionOP protocols::pack_daemon::DynamicAggregateFunction::focused_iterative_vector_expression_
private
std::set< std::string > protocols::pack_daemon::DynamicAggregateFunction::function_names_
private

Function names may not be used as variable names.

Referenced by read_all_variables_from_input_file(), and verify_variable_name_or_throw().

std::set< std::string > protocols::pack_daemon::DynamicAggregateFunction::illegal_variable_names_
private

This set represents strings that may not be used as variable names but which are not funciton names

Referenced by read_all_variables_from_input_file(), and verify_variable_name_or_throw().

std::map< std::string, StructureFileNames > protocols::pack_daemon::DynamicAggregateFunction::named_state_data_file_names_
private
std::map< std::string, ExpressionCOP > protocols::pack_daemon::DynamicAggregateFunction::named_state_expression_map_
private
std::map< std::string, std::list< std::pair< std::string, std::string > > > protocols::pack_daemon::DynamicAggregateFunction::npd_properties_for_state_variables_
private
std::map< std::string, ExpressionCOP > protocols::pack_daemon::DynamicAggregateFunction::npd_property_expression_map_
private
std::map< std::string, VariableVectorExpressionOP > protocols::pack_daemon::DynamicAggregateFunction::npd_property_vector_expression_map_
private
utility::vector1< std::list< std::pair< core::Size, std::string > > > protocols::pack_daemon::DynamicAggregateFunction::npd_variable_indices_for_states_
private
core::Size protocols::pack_daemon::DynamicAggregateFunction::num_entity_elements_
private
std::map< std::string, VariableExpressionCOP > protocols::pack_daemon::DynamicAggregateFunction::scalar_expression_map_
private
utility::vector1< std::pair< core::Size, ExpressionCOP > > protocols::pack_daemon::DynamicAggregateFunction::scalar_expressions_
private
std::map< std::string, core::Size > protocols::pack_daemon::DynamicAggregateFunction::scalar_variable_names_dec_line_
private
numeric::expression_parser::ArithmeticScannerOP protocols::pack_daemon::DynamicAggregateFunction::scanner_
private
core::scoring::ScoreFunctionOP protocols::pack_daemon::DynamicAggregateFunction::sfxn_
private

Referenced by set_score_function().

std::map< std::string, utility::vector1< core::Size > > protocols::pack_daemon::DynamicAggregateFunction::state_indices_for_state_vector_
private
std::map< std::string, core::Size > protocols::pack_daemon::DynamicAggregateFunction::state_variable_name_2_state_index_
private

Keep track for each state-variable name its state's index.

Referenced by create_state_variable_expressions(), create_variable_vector_expressions(), and select_relevant_states().

std::set< std::string > protocols::pack_daemon::DynamicAggregateFunction::state_variable_names_
private
std::map< std::string, utility::vector1< StructureFileNames > > protocols::pack_daemon::DynamicAggregateFunction::state_vector_data_file_names_
private
std::set< std::string > protocols::pack_daemon::DynamicAggregateFunction::state_vector_variable_names_
private
std::map< std::string, VariableVectorExpressionOP > protocols::pack_daemon::DynamicAggregateFunction::state_vector_variables_
private
std::map< core::Size, SurrogateVariableExpressionOP > protocols::pack_daemon::DynamicAggregateFunction::surrogate_expression_map_
private
utility::vector1< VariableExpressionOP > protocols::pack_daemon::DynamicAggregateFunction::variable_expressions_
private
utility::vector1< VariableExpressionOP > protocols::pack_daemon::DynamicAggregateFunction::variable_expressions_for_npd_properties_
private
utility::vector1< VariableExpressionOP > protocols::pack_daemon::DynamicAggregateFunction::variable_expressions_for_states_
private
std::map< std::string, core::Size > protocols::pack_daemon::DynamicAggregateFunction::variable_name_2_variable_exp_index_
private

Keep track for each varible name (or scalar expression name) its index in the ?? vector.

Referenced by create_scalar_and_vector_expression_variable_expressions(), create_state_variable_expressions(), create_variable_vector_expressions(), and turn_expression_ASTs_into_expressions().

std::map< std::string, core::Size > protocols::pack_daemon::DynamicAggregateFunction::variable_names_dec_line_
private
std::map< std::string, VectorExpressionCOP > protocols::pack_daemon::DynamicAggregateFunction::vector_expression_map_
private
std::map< std::string, core::Size > protocols::pack_daemon::DynamicAggregateFunction::vector_variable_names_dec_line_
private
std::list< VectorFunctionOP > protocols::pack_daemon::DynamicAggregateFunction::vfuncs_
private

The documentation for this class was generated from the following files: