assert((inID!=gk_IODefaultIndex)&&(inID<nbInputs())&&"Input index out of bound.");
assert((inID!=gk_IODefaultIndex)&&(inID<nbInputs())&&"Input index out of bound.");
...
@@ -232,7 +253,8 @@ public:
...
@@ -232,7 +253,8 @@ public:
* @brief Get the lowest index in the InputData Parent list equal to the
* @brief Get the lowest index in the InputData Parent list equal to the
* nullptr (i.e. the ID of the first free data input).
* nullptr (i.e. the ID of the first free data input).
* Data inputs exclude inputs expecting parameters (weights or bias).
* Data inputs exclude inputs expecting parameters (weights or bias).
* @return std::size_t
* if there is no free input, will return gk_IODefaultIndex (max of uint16)
* @return IOIndex_t: the index of the first free (parentless) data input.
*/
*/
inlineIOIndex_tgetFirstFreeDataInput()const{
inlineIOIndex_tgetFirstFreeDataInput()const{
IOIndex_ti=0;
IOIndex_ti=0;
...
@@ -250,30 +272,29 @@ public:
...
@@ -250,30 +272,29 @@ public:
* @brief Returns the number of free data inputs of the Node
* @brief Returns the number of free data inputs of the Node
* (i.e. data inputs that are not linked to an other node)
* (i.e. data inputs that are not linked to an other node)
* @warning Node cannot run until all of its mandatory inputs are filled
* @warning Node cannot run until all of its mandatory inputs are filled
* @return IOIndex_t
* @return IOIndex_t: the number of free (parentless) data inputs
*/
*/
IOIndex_tgetNbFreeDataInputs()const;
IOIndex_tgetNbFreeDataInputs()const;
/**
/**
* @brief Lists children of the Node and the ID of the child's input linked to the current Node.
* @brief Returns the outputs of the Node.
* @details The parent vector size matches the number of outputs of the node.
* @details The parent vector size matches the number of outputs of the node.
* Each sub-vector size will match the number of children connected to the n-th output (i.e. if 3 nodes are connected to the 3rd output parent_vec[3].size() == 3).
* Each sub-vector size will match the number of children connected to the n-th output (i.e. if 3 nodes are connected to the 3rd output parent_vec[3].size() == 3).
* @return std::vector<std::vector<std::pair<std::shared_ptr<Node>, IOIndex_t>>>: Vector of vectors of children of the Node and the ID of the child's input linked to the current Node.
* @return std::vector<std::pair<std::shared_ptr<Node>, IOIndex_t>> vector of children of the Node's outId's output and the ID of the child's input linked to the current Node.
* @brief Clone the current Node. The Operator attribute of the new Node is not copied but shared with the current Node. The new node has no connection.
* @brief Clone the current Node. The Operator attribute of the new Node is not copied but shared with the current Node. The new node has no connection.
* @return NodePtr
* @return NodePtr Pointer to the cloned Node
*/
*/
NodePtrcloneSharedOperators()const;
NodePtrcloneSharedOperators()const;
/**
/**
* @brief Clone the Node. Every attribute is copied, even Operator pointer except for Producers for which it is shared. The new Node has no connection.
* @brief Clone the Node. Every attribute is copied, even Operator pointer except for Producers for which it is shared. The new Node has no connection.
* @return NodePtr
* @return NodePtr Pointer to the cloned Node
*/
*/
NodePtrcloneSharedProducers()const;
NodePtrcloneSharedProducers()const;
/**
/**
* @brief Clone the Node and its Operator. The new Node has no connection.
* @brief Clone the Node and its Operator. The new Node has no connection.
* @return NodePtr
* @return NodePtr Pointer to the cloned Node
*/
*/
NodePtrclone()const;
NodePtrclone()const;
/**
/**
* @brief Callback function to clone the Node keeping the same Operator object instance. The new Node has no connection.
* @brief Callback function to clone the Node keeping the same Operator object instance. The new Node has no connection.
* @param node Node to clone.
* @param node Node: to clone.
* @return NodePtr
* @return NodePtr Pointer to the cloned Node
*/
*/
staticNodePtrcloneSharedOperators(NodePtrnode){
staticNodePtrcloneSharedOperators(NodePtrnode){
returnnode->cloneSharedOperators();
returnnode->cloneSharedOperators();
...
@@ -482,8 +510,8 @@ public:
...
@@ -482,8 +510,8 @@ public:
/**
/**
* @brief Callback function to clone the Node. Every attribute is copied, even Operator pointer except for Producers for which it is shared. The new Node has no connection.
* @brief Callback function to clone the Node. Every attribute is copied, even Operator pointer except for Producers for which it is shared. The new Node has no connection.
* @param node Node to clone.
* @param node Node: to clone.
* @return NodePtr
* @return NodePtr Pointer to the cloned Node
*/
*/
staticNodePtrcloneSharedProducers(NodePtrnode){
staticNodePtrcloneSharedProducers(NodePtrnode){
returnnode->cloneSharedProducers();
returnnode->cloneSharedProducers();
...
@@ -491,8 +519,8 @@ public:
...
@@ -491,8 +519,8 @@ public:
/**
/**
* @brief Callback function to clone the Node and its Operator. The new Node has no connection.
* @brief Callback function to clone the Node and its Operator. The new Node has no connection.
* @param node Node to clone.
* @param node Node: to clone.
* @return NodePtr
* @return NodePtr Pointer to the cloned Node
*/
*/
staticNodePtrclone(NodePtrnode){
staticNodePtrclone(NodePtrnode){
returnnode->clone();
returnnode->clone();
...
@@ -501,12 +529,13 @@ public:
...
@@ -501,12 +529,13 @@ public:
/**
/**
* @brief Get the set of pointers to connected node at a distance of a delta.
* @brief Get the set of pointers to connected node at a distance of a delta.
* @details positive value are toward children, negative toward parents (ex: -2 would give grandparents)
* @details positive value are toward children, negative toward parents
* Return a nullptr is nothing found.
* (ex: -2 would give grandparents, +1 gives direct children)
* @param int delta Input delta.
* @param int delta: Input delta.
* @param std::set<Aidge::NodePtr> nodeSee is used in the recursion to avoid looping on the same nodes,
* @param std::set<Aidge::NodePtr> nodeSee: is used in the recursion to avoid looping on the same nodes,
* should be empty when calling the method
* should be empty when calling the method
* @return std::set<Aidge::NodePtr> set of nodes within expected distance from the original node
* @return std::set<Aidge::NodePtr> set of nodes within expected distance from the original node
* If no node is found at searched level, returns nullptr