public GenericItemSimilarity(ItemSimilarity otherSimilarity, DataModel dataModel, int maxToKeep) { this.similarityMaps = new FastByIDMap <FastByIDMap <double?> >(); this.similarItemIDsIndex = new FastByIDMap <FastIDSet>(); long[] itemIDs = GenericUserSimilarity.longIteratorToList(dataModel.getItemIDs()); DataModelSimilaritiesIterator allSimilarities = new DataModelSimilaritiesIterator(otherSimilarity, itemIDs); this.initSimilarityMaps(TopItems.getTopItemItemSimilarities(maxToKeep, allSimilarities).GetEnumerator()); }
public GenericItemSimilarity(IEnumerable <ItemItemSimilarity> similarities, int maxToKeep) { this.similarityMaps = new FastByIDMap <FastByIDMap <double?> >(); this.similarItemIDsIndex = new FastByIDMap <FastIDSet>(); this.initSimilarityMaps(TopItems.getTopItemItemSimilarities(maxToKeep, similarities.GetEnumerator()).GetEnumerator()); }