本文整理汇总了C++中TNodeI::GetInEId方法的典型用法代码示例。如果您正苦于以下问题:C++ TNodeI::GetInEId方法的具体用法?C++ TNodeI::GetInEId怎么用?C++ TNodeI::GetInEId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TNodeI
的用法示例。
在下文中一共展示了TNodeI::GetInEId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Dump
void TNEANetMP::Dump(FILE *OutF) const {
const int NodePlaces = (int) ceil(log10((double) GetNodes()));
const int EdgePlaces = (int) ceil(log10((double) GetEdges()));
fprintf(OutF, "-------------------------------------------------\nDirected Node-Edge Network: nodes: %d, edges: %d\n", GetNodes(), GetEdges());
for (TNodeI NodeI = BegNI(); NodeI < EndNI(); NodeI++) {
fprintf(OutF, " %*d]\n", NodePlaces, NodeI.GetId());
// load node attributes
TIntV IntAttrN;
IntAttrValueNI(NodeI.GetId(), IntAttrN);
fprintf(OutF, " nai[%d]", IntAttrN.Len());
for (int i = 0; i < IntAttrN.Len(); i++) {
fprintf(OutF, " %*i", NodePlaces, IntAttrN[i]()); }
TStrV StrAttrN;
StrAttrValueNI(NodeI.GetId(), StrAttrN);
fprintf(OutF, " nas[%d]", StrAttrN.Len());
for (int i = 0; i < StrAttrN.Len(); i++) {
fprintf(OutF, " %*s", NodePlaces, StrAttrN[i]()); }
TFltV FltAttrN;
FltAttrValueNI(NodeI.GetId(), FltAttrN);
fprintf(OutF, " naf[%d]", FltAttrN.Len());
for (int i = 0; i < FltAttrN.Len(); i++) {
fprintf(OutF, " %*f", NodePlaces, FltAttrN[i]()); }
fprintf(OutF, " in[%d]", NodeI.GetInDeg());
for (int edge = 0; edge < NodeI.GetInDeg(); edge++) {
fprintf(OutF, " %*d", EdgePlaces, NodeI.GetInEId(edge)); }
fprintf(OutF, "\n");
fprintf(OutF, " out[%d]", NodeI.GetOutDeg());
for (int edge = 0; edge < NodeI.GetOutDeg(); edge++) {
fprintf(OutF, " %*d", EdgePlaces, NodeI.GetOutEId(edge)); }
fprintf(OutF, "\n");
}
for (TEdgeI EdgeI = BegEI(); EdgeI < EndEI(); EdgeI++) {
fprintf(OutF, " %*d] %*d -> %*d", EdgePlaces, EdgeI.GetId(), NodePlaces, EdgeI.GetSrcNId(), NodePlaces, EdgeI.GetDstNId());
// load edge attributes
TIntV IntAttrE;
IntAttrValueEI(EdgeI.GetId(), IntAttrE);
fprintf(OutF, " eai[%d]", IntAttrE.Len());
for (int i = 0; i < IntAttrE.Len(); i++) {
fprintf(OutF, " %*i", EdgePlaces, IntAttrE[i]());
}
TStrV StrAttrE;
StrAttrValueEI(EdgeI.GetId(), StrAttrE);
fprintf(OutF, " eas[%d]", StrAttrE.Len());
for (int i = 0; i < StrAttrE.Len(); i++) {
fprintf(OutF, " %*s", EdgePlaces, StrAttrE[i]());
}
TFltV FltAttrE;
FltAttrValueEI(EdgeI.GetId(), FltAttrE);
fprintf(OutF, " eaf[%d]", FltAttrE.Len());
for (int i = 0; i < FltAttrE.Len(); i++) {
fprintf(OutF, " %*f", EdgePlaces, FltAttrE[i]());
}
fprintf(OutF, "\n");
}
fprintf(OutF, "\n");
}
示例2: Dump
void TNEGraph::Dump(FILE *OutF) const {
const int NodePlaces = (int) ceil(log10((double) GetNodes()));
const int EdgePlaces = (int) ceil(log10((double) GetEdges()));
fprintf(OutF, "-------------------------------------------------\nDirected Node-Edge Graph: nodes: %d, edges: %d\n", GetNodes(), GetEdges());
for (TNodeI NodeI = BegNI(); NodeI < EndNI(); NodeI++) {
fprintf(OutF, " %*d]\n", NodePlaces, NodeI.GetId());
fprintf(OutF, " in[%d]", NodeI.GetInDeg());
for (int edge = 0; edge < NodeI.GetInDeg(); edge++) {
fprintf(OutF, " %*d", EdgePlaces, NodeI.GetInEId(edge)); }
fprintf(OutF, "\n out[%d]", NodeI.GetOutDeg());
for (int edge = 0; edge < NodeI.GetOutDeg(); edge++) {
fprintf(OutF, " %*d", EdgePlaces, NodeI.GetOutEId(edge)); }
fprintf(OutF, "\n");
}
for (TEdgeI EdgeI = BegEI(); EdgeI < EndEI(); EdgeI++) {
fprintf(OutF, " %*d] %*d -> %*d\n", EdgePlaces, EdgeI.GetId(), NodePlaces, EdgeI.GetSrcNId(), NodePlaces, EdgeI.GetDstNId());
}
fprintf(OutF, "\n");
}