/// <summary> /// this function used to do item extension , you provide two SIL about item a and b ,it return a SIL about (ab) /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static SparseIdList IStep(SparseIdList a, SparseIdList b) { SparseIdList sparseIdList = new SparseIdList(a.GetLength()); ListNode aNode, bNode; for (int i = 0; i < a.GetLength(); i++) { aNode = a.GetElement(i, 0); bNode = b.GetElement(i, 0); while ((aNode != null) && (bNode != null)) { if (aNode.GetSparseId == bNode.GetSparseId) { sparseIdList.AddElement(i, aNode.GetSparseId); aNode = aNode.GetNext; bNode = bNode.GetNext; } else if (aNode.GetSparseId > bNode.GetSparseId) { bNode = bNode.GetNext; } else { aNode = aNode.GetNext; } } } return(sparseIdList); }