15 #ifndef BORNAGAIN_CORE_PARAMETRIZATION_INODE_H
16 #define BORNAGAIN_CORE_PARAMETRIZATION_INODE_H
24 const double INF = std::numeric_limits<double>::infinity();
52 INode(
const NodeMeta& meta,
const std::vector<double>& PValues);
65 virtual std::vector<const INode*>
getChildren()
const;
87 std::vector<double>
m_P;
91 std::vector<const INode*>&
operator<<(std::vector<const INode*>& v_node,
92 const std::unique_ptr<T>& node)
95 v_node.push_back(node.get());
100 std::vector<const INode*>&
operator<<(std::vector<const INode*>&& v_node,
101 const std::unique_ptr<T>& node)
104 v_node.push_back(node.get());
108 inline std::vector<const INode*>&
operator<<(std::vector<const INode*>& v_node,
const INode* node)
110 v_node.push_back(node);
114 inline std::vector<const INode*>&
operator<<(std::vector<const INode*>&& v_node,
const INode* node)
116 v_node.push_back(node);
120 inline std::vector<const INode*>&
operator<<(std::vector<const INode*>& v_node,
121 const std::vector<const INode*>& other)
123 v_node.insert(v_node.end(), other.begin(), other.end());
127 inline std::vector<const INode*>&
operator<<(std::vector<const INode*>&& v_node,
128 const std::vector<const INode*>& other)
130 v_node.insert(v_node.end(), other.begin(), other.end());
Defines interface class INodeVisitor.
NodeMeta nodeMetaUnion(const std::vector< ParaMeta > &base, const NodeMeta &other)
Defines class IParameterized.
std::ostream & operator<<(std::ostream &os, const BasicVector3D< T > &a)
Output to stream.
Visitor interface to visit ISample objects.
Base class for tree-like structures containing parameterized objects.
virtual std::string treeToString() const
Returns multiline string representing tree structure below the node.
std::string displayName() const
Returns display name, composed from the name of node and it's copy number.
virtual void setParent(const INode *newParent)
const INode * parent() const
virtual std::vector< const INode * > getChildren() const
Returns a vector of children (const).
ParameterPool * createParameterTree() const
Creates new parameter pool, with all local parameters and those of its children.
virtual void accept(INodeVisitor *visitor) const =0
Calls the INodeVisitor's visit method.
std::vector< double > m_P
void registerChild(INode *node)
int copyNumber(const INode *node) const
Returns copyNumber of child, which takes into account existence of children with same name.
Manages a local parameter pool, and a tree of child pools.
Container with parameters for IParameterized object.