The package hset for the R language contains an implementation of a S4 class for sets and multisets of numbers. The implementation, based on the hash table data structure from the package hash (Brown, 2019), allows for quick operations when the set is a dynamic object. An important example is when a set or a multiset is part of the state of a Markov chain in which in each iteration various elements are moved in and out of the set.
翻译:R语言中的hset包含了一种S4类的实现,用于表示数字的集合和多重集。该实现基于哈希表数据结构来自包hash(Brown,2019),可以实现集合为动态对象时的快速操作。一个重要的例子是,当集合或多重集是马尔可夫链状态的一部分时,在每次迭代中会有各种元素进出该集合。