QMCPACK
WFOptDriverInput Class Reference
+ Collaboration diagram for WFOptDriverInput:

Public Member Functions

 WFOptDriverInput ()
 
void readXML (xmlNodePtr xml_input)
 
int get_opt_crowd_size () const
 
int get_opt_num_crowds () const
 
const std::string & get_opt_method () const
 
xmlNodePtr get_opt_xml_node () const
 

Protected Attributes

int opt_crowd_size_ = 1
 
int opt_num_crowds_ = 0
 
std::string opt_method_
 
xmlNodePtr opt_xml_node_
 

Detailed Description

Definition at line 20 of file WFOptDriverInput.h.

Constructor & Destructor Documentation

◆ WFOptDriverInput()

WFOptDriverInput ( )
inline

Definition at line 23 of file WFOptDriverInput.h.

23 {}

Member Function Documentation

◆ get_opt_crowd_size()

int get_opt_crowd_size ( ) const
inline

Definition at line 35 of file WFOptDriverInput.h.

References WFOptDriverInput::opt_crowd_size_.

Referenced by qmcplusplus::TEST_CASE().

◆ get_opt_method()

const std::string& get_opt_method ( ) const
inline

Definition at line 38 of file WFOptDriverInput.h.

References WFOptDriverInput::opt_method_.

Referenced by qmcplusplus::TEST_CASE().

38 { return opt_method_; }

◆ get_opt_num_crowds()

int get_opt_num_crowds ( ) const
inline

Definition at line 36 of file WFOptDriverInput.h.

References WFOptDriverInput::opt_num_crowds_.

Referenced by qmcplusplus::TEST_CASE().

◆ get_opt_xml_node()

xmlNodePtr get_opt_xml_node ( ) const
inline

Definition at line 40 of file WFOptDriverInput.h.

References WFOptDriverInput::opt_xml_node_.

40 { return opt_xml_node_; }

◆ readXML()

void readXML ( xmlNodePtr  xml_input)

Definition at line 19 of file WFOptDriverInput.cpp.

References ParameterSet::add(), getXMLAttributeValue(), WFOptDriverInput::opt_crowd_size_, WFOptDriverInput::opt_method_, WFOptDriverInput::opt_num_crowds_, WFOptDriverInput::opt_xml_node_, and ParameterSet::put().

Referenced by qmcplusplus::TEST_CASE().

20 {
21  ParameterSet parameter_set;
22  parameter_set.add(opt_crowd_size_, "opt_crowd_size");
23  parameter_set.add(opt_num_crowds_, "opt_num_crowds");
24  parameter_set.put(xml_input);
25 
26  opt_xml_node_ = xml_input->children;
27 
28  xmlNodePtr cur = xml_input->children;
29  while (cur != NULL)
30  {
31  std::string cname((const char*)(cur->name));
32  if (cname.find("optimize") < cname.size())
33  {
34  const std::string att(getXMLAttributeValue(cur, "method"));
35  if (!att.empty())
36  opt_method_ = att;
37  opt_xml_node_ = cur;
38  }
39  cur = cur->next;
40  }
41 }
bool put(std::istream &is) override
read from std::istream
Definition: ParameterSet.h:42
class to handle a set of parameters
Definition: ParameterSet.h:27
std::string getXMLAttributeValue(const xmlNodePtr cur, const std::string_view name)
get the value string for attribute name if name is unfound in cur you get an empty string back this i...
void add(PDT &aparam, const std::string &aname_in, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new parameter corresponding to an xmlNode <parameter>

Member Data Documentation

◆ opt_crowd_size_

int opt_crowd_size_ = 1
protected

◆ opt_method_

std::string opt_method_
protected

◆ opt_num_crowds_

int opt_num_crowds_ = 0
protected

◆ opt_xml_node_

xmlNodePtr opt_xml_node_
protected

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