Lines Matching refs:NId
127 void connectTo(Graph &G, EdgeId ThisEdgeId, NodeId NId) { in connectTo() argument
128 if (NId == NIds[0]) in connectTo()
131 assert(NId == NIds[1] && "Edge does not connect NId."); in connectTo()
141 void setAdjEdgeIdx(NodeId NId, typename NodeEntry::AdjEdgeIdx NewIdx) { in setAdjEdgeIdx() argument
142 if (NId == NIds[0]) in setAdjEdgeIdx()
145 assert(NId == NIds[1] && "Edge not connected to NId"); in setAdjEdgeIdx()
158 void disconnectFrom(Graph &G, NodeId NId) { in disconnectFrom() argument
159 if (NId == NIds[0]) in disconnectFrom()
162 assert(NId == NIds[1] && "Edge does not connect NId"); in disconnectFrom()
194 NodeEntry &getNode(NodeId NId) { in getNode() argument
195 assert(NId < Nodes.size() && "Out of bound NodeId"); in getNode()
196 return Nodes[NId]; in getNode()
198 const NodeEntry &getNode(NodeId NId) const { in getNode() argument
199 assert(NId < Nodes.size() && "Out of bound NodeId"); in getNode()
200 return Nodes[NId]; in getNode()
207 NodeId NId = 0; in addConstructedNode() local
209 NId = FreeNodeIds.back(); in addConstructedNode()
211 Nodes[NId] = std::move(N); in addConstructedNode()
213 NId = Nodes.size(); in addConstructedNode()
216 return NId; in addConstructedNode()
265 NodeId findNextInUse(NodeId NId) const { in findNextInUse() argument
266 while (NId < EndNId && in findNextInUse()
267 std::find(FreeNodeIds.begin(), FreeNodeIds.end(), NId) != in findNextInUse()
269 ++NId; in findNextInUse()
271 return NId; in findNextInUse()
366 for (auto NId : nodeIds()) in setSolver() local
367 Solver->handleAddNode(NId); in setSolver()
385 NodeId NId = addConstructedNode(NodeEntry(AllocatedCosts)); in addNode() local
387 Solver->handleAddNode(NId); in addNode()
388 return NId; in addNode()
404 NodeId NId = addConstructedNode(NodeEntry(Costs)); in addNodeBypassingCostAllocator() local
406 Solver->handleAddNode(NId); in addNodeBypassingCostAllocator()
407 return NId; in addNodeBypassingCostAllocator()
459 AdjEdgeIdSet adjEdgeIds(NodeId NId) { return AdjEdgeIdSet(getNode(NId)); } in adjEdgeIds() argument
473 void setNodeCosts(NodeId NId, OtherVectorT Costs) { in setNodeCosts() argument
476 Solver->handleSetNodeCosts(NId, *AllocatedCosts); in setNodeCosts()
477 getNode(NId).Costs = AllocatedCosts; in setNodeCosts()
488 const VectorPtr& getNodeCostsPtr(NodeId NId) const { in getNodeCostsPtr() argument
489 return getNode(NId).Costs; in getNodeCostsPtr()
495 const Vector& getNodeCosts(NodeId NId) const { in getNodeCosts() argument
496 return *getNodeCostsPtr(NId); in getNodeCosts()
499 NodeMetadata& getNodeMetadata(NodeId NId) { in getNodeMetadata() argument
500 return getNode(NId).Metadata; in getNodeMetadata()
503 const NodeMetadata& getNodeMetadata(NodeId NId) const { in getNodeMetadata() argument
504 return getNode(NId).Metadata; in getNodeMetadata()
507 typename NodeEntry::AdjEdgeList::size_type getNodeDegree(NodeId NId) const { in getNodeDegree() argument
508 return getNode(NId).getAdjEdgeIds().size(); in getNodeDegree()
567 NodeId getEdgeOtherNodeId(EdgeId EId, NodeId NId) { in getEdgeOtherNodeId() argument
569 if (E.getN1Id() == NId) { in getEdgeOtherNodeId()
592 void removeNode(NodeId NId) { in removeNode() argument
594 Solver->handleRemoveNode(NId); in removeNode()
595 NodeEntry &N = getNode(NId); in removeNode()
604 FreeNodeIds.push_back(NId); in removeNode()
632 void disconnectEdge(EdgeId EId, NodeId NId) { in disconnectEdge() argument
634 Solver->handleDisconnectEdge(EId, NId); in disconnectEdge()
637 E.disconnectFrom(*this, NId); in disconnectEdge()
642 void disconnectAllNeighborsFromNode(NodeId NId) { in disconnectAllNeighborsFromNode() argument
643 for (auto AEId : adjEdgeIds(NId)) in disconnectAllNeighborsFromNode()
644 disconnectEdge(AEId, getEdgeOtherNodeId(AEId, NId)); in disconnectAllNeighborsFromNode()
651 void reconnectEdge(EdgeId EId, NodeId NId) { in reconnectEdge() argument
653 E.connectTo(*this, EId, NId); in reconnectEdge()
655 Solver->handleReconnectEdge(EId, NId); in reconnectEdge()