nodelist_bn* NewNodeList2_bn ( int  length,   const net_bn*  net )

Creates and returns a new node list with length entries, each filled with NULL.

You can then fill the entries using SetNthNode_bn. A safer way to build node lists is to call this function with length = 0, and then add nodes to the end of the list by calling AddNodeToList_bn with an index of LAST_ENTRY.

For net, pass the net which contains the nodes that will later be placed in this list. Nodes from other nets will not be allowed.

Use DeleteNodeList_bn to free the list when you are done with it (do not try to use the Standard C/ C++ 'free' or 'delete').


Prior to version 3.15, this function was called NewNodeList_bn and took an env parameter instead of net.

See also:

DeleteNodeList_bn    (reverse operation) Free the new list made
DupNodeList_bn    Make a copy of an existing list
AddNodeToList_bn    Increases a list's length by adding a node