Skip to content

Commit d18f8ed

Browse files
arisa77facebook-github-bot
authored andcommitted
Update compactor API (facebookresearch#247)
Summary: Pull Request resolved: facebookresearch#247 Update the compactor API to have consistent formatting with shuffler and permuter APIs. Changes are applied to type T and LabelT to consider them as implicit batches. Reviewed By: chualynn, RuiyuZhu Differential Revision: D37524033 fbshipit-source-id: 36afb8057f37242c71f42c5e1184844610d0921f
1 parent c9bbe03 commit d18f8ed

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

fbpcf/mpc_std_lib/compactor/ICompactor.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,29 @@ namespace fbpcf::mpc_std_lib::compactor {
1919
*/
2020
/**
2121
* A type T corresponds to a set of values (i.e., a batch) to be
22-
* compactified, e.g. std::vector
23-
* A type LabelT corresponds to a binary label, e.g., bool, Bit
22+
* compactified, e.g. std::vector.
23+
* Similarly, a type LabelT corresponds to a set of binary labels (i.e., a
24+
* batch), e.g. std::vector.
2425
*/
2526
template <typename T, typename LabelT>
2627
class ICompactor {
2728
public:
2829
virtual ~ICompactor() = default;
2930

3031
/**
31-
* Perform a compaction on a set of batches based on specified binary labels.
32-
* @param batches: a set of batches, where every batch is composed of
33-
* n values to be compactified
34-
* @param labels: a binary vector of size n where 1 indicates the
35-
* corresponding items in the input are considered as necessary data;
32+
* Perform a compaction on a set of secret values based on given binary
33+
* labels.
34+
* @param src: a set of n values to be compactified
35+
* @param label: a set of n binary labels, where 1 indicates the
36+
* corresponding items in the src are considered as necessary data;
3637
* otherwise they are considered as unimportant data
3738
* @param shouldRevealSize: whether it is okay to reveal the size of 1s items
38-
* @return the resulting compactified metadata and labels
39+
* @return the resulting compactified src and label
3940
*/
4041

41-
virtual std::tuple<std::vector<T>, std::vector<LabelT>> compaction(
42-
const std::vector<T>& batches,
43-
const std::vector<LabelT>& labels,
42+
virtual std::pair<T, LabelT> compaction(
43+
const T& src,
44+
const LabelT& label,
4445
bool shouldRevealSize) const = 0;
4546
};
4647

0 commit comments

Comments
 (0)