26 using System.Collections.Generic;
60 if (redNodeCount < 0 || blueNodeCount < 0)
61 throw new ArgumentException(
"Invalid node count: " + redNodeCount +
";" + blueNodeCount);
62 if ((
long)redNodeCount + blueNodeCount >
int.MaxValue ||
63 (
long)redNodeCount * blueNodeCount >
int.MaxValue)
64 throw new ArgumentException(
"Too many nodes: " + redNodeCount +
";" + blueNodeCount);
75 return new Node(1L + index);
102 var t = u; u = v; v = t;
105 int uindex = (int)(u.
Id - 1);
164 bool isRed =
IsRed(u);
166 (filter ==
ArcFilter.Forward && !isRed) ||
167 (filter ==
ArcFilter.Backward && isRed))) yield
break;
200 bool isRed =
IsRed(u);
202 (filter ==
ArcFilter.Forward && !isRed) ||
203 (filter ==
ArcFilter.Backward && isRed)))
return 0;
211 return ArcCount(u, filter) > 0 ? 1 : 0;