Function opendp::transformations::make_resize
source · pub fn make_resize<TA, MI, MO>(
input_domain: VectorDomain<AtomDomain<TA>>,
input_metric: MI,
size: usize,
constant: TA
) -> Fallible<Transformation<VectorDomain<AtomDomain<TA>>, VectorDomain<AtomDomain<TA>>, MI, MO>>where
TA: 'static + Clone + CheckAtom,
MI: IsMetricOrdered<Distance = IntDistance>,
MO: IsMetricOrdered<Distance = IntDistance>,
(VectorDomain<AtomDomain<TA>>, MI): MetricSpace,
(VectorDomain<AtomDomain<TA>>, MO): MetricSpace,
Expand description
Make a Transformation that either truncates or imputes records
with constant
to match a provided size
.
Arguments
input_domain
- Domain of input data.input_metric
- Metric of input data.size
- Number of records in output data.constant
- Value to impute with.
Generics
TA
- Atomic Type.MI
- Input Metric. One ofInsertDeleteDistance
orSymmetricDistance
MO
- Output Metric. One ofInsertDeleteDistance
orSymmetricDistance
Returns
A vector of the same type TA
, but with the provided size
.