opendp / smartnoise-core

Differential privacy validator and runtime
MIT License
289 stars 33 forks source link

ToContinuous and ToCategorical components #273

Open Shoeboxam opened 4 years ago

Shoeboxam commented 4 years ago

Some utility components that manipulate properties.

ToContinuous takes in categorical integers, and outputs continuous integers. Pseudocode:

Nature::Continuous { lower: min(categories), upper: max(categories) }

ToCategorical takes in continuous integers, and outputs categorical integers. Pseudocode:

Nature::Categorical {categories: (lower..upper).collect() }

Given the recent refactorings to release ownership in the runtime, this takes zero allocations and is a no-op in the runtime.