pub struct FloatEncoderMinMaxConfig {
pub min: f64,
pub max: f64,
pub nb_bit_precision: usize,
pub nb_bit_padding: usize,
}Expand description
Parameters allowing to construct a FloatEncoder from the bounds of the range to be
represented.
Fields§
§min: f64§max: f64§nb_bit_precision: usize§nb_bit_padding: usizeTrait Implementations§
Source§impl Clone for FloatEncoderMinMaxConfig
impl Clone for FloatEncoderMinMaxConfig
Source§fn clone(&self) -> FloatEncoderMinMaxConfig
fn clone(&self) -> FloatEncoderMinMaxConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FloatEncoderMinMaxConfig
impl Debug for FloatEncoderMinMaxConfig
Source§impl EncoderCreationEngine<FloatEncoderMinMaxConfig, FloatEncoder> for DefaultEngine
§Description:
Implementation of EncoderCreationEngine for DefaultEngine that creates an encoder to
encode 64 bits floating point numbers.
impl EncoderCreationEngine<FloatEncoderMinMaxConfig, FloatEncoder> for DefaultEngine
§Description:
Implementation of EncoderCreationEngine for DefaultEngine that creates an encoder to
encode 64 bits floating point numbers.
Source§fn create_encoder_from(
&mut self,
config: &FloatEncoderMinMaxConfig,
) -> Result<FloatEncoder, EncoderCreationError<Self::EngineError>>
fn create_encoder_from( &mut self, config: &FloatEncoderMinMaxConfig, ) -> Result<FloatEncoder, EncoderCreationError<Self::EngineError>>
§Example:
use concrete_core::prelude::*;
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let encoder = engine.create_encoder_from(&FloatEncoderMinMaxConfig {
min: 0.,
max: 10.,
nb_bit_precision: 8,
nb_bit_padding: 1,
})?;Source§unsafe fn create_encoder_from_unchecked(
&mut self,
config: &FloatEncoderMinMaxConfig,
) -> FloatEncoder
unsafe fn create_encoder_from_unchecked( &mut self, config: &FloatEncoderMinMaxConfig, ) -> FloatEncoder
Unsafely creates an encoder from a config. Read more
Source§impl EncoderVectorCreationEngine<FloatEncoderMinMaxConfig, FloatEncoderVector> for DefaultEngine
§Description:
Implementation of EncoderVectorCreationEngine for DefaultEngine that creates an encoder
vector to encode vectors of 64 bits floating point numbers.
impl EncoderVectorCreationEngine<FloatEncoderMinMaxConfig, FloatEncoderVector> for DefaultEngine
§Description:
Implementation of EncoderVectorCreationEngine for DefaultEngine that creates an encoder
vector to encode vectors of 64 bits floating point numbers.
Source§fn create_encoder_vector_from(
&mut self,
config: &[FloatEncoderMinMaxConfig],
) -> Result<FloatEncoderVector, EncoderVectorCreationError<Self::EngineError>>
fn create_encoder_vector_from( &mut self, config: &[FloatEncoderMinMaxConfig], ) -> Result<FloatEncoderVector, EncoderVectorCreationError<Self::EngineError>>
§Example:
use concrete_core::prelude::*;
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let encoder_vector = engine.create_encoder_vector_from(
vec![
FloatEncoderMinMaxConfig {
min: 0.,
max: 10.,
nb_bit_precision: 8,
nb_bit_padding: 1,
};
1
]
.as_slice(),
)?;Source§unsafe fn create_encoder_vector_from_unchecked(
&mut self,
config: &[FloatEncoderMinMaxConfig],
) -> FloatEncoderVector
unsafe fn create_encoder_vector_from_unchecked( &mut self, config: &[FloatEncoderMinMaxConfig], ) -> FloatEncoderVector
Unsafely creates an encoder vector from a config. Read more
Source§impl PartialEq for FloatEncoderMinMaxConfig
impl PartialEq for FloatEncoderMinMaxConfig
impl StructuralPartialEq for FloatEncoderMinMaxConfig
Auto Trait Implementations§
impl Freeze for FloatEncoderMinMaxConfig
impl RefUnwindSafe for FloatEncoderMinMaxConfig
impl Send for FloatEncoderMinMaxConfig
impl Sync for FloatEncoderMinMaxConfig
impl Unpin for FloatEncoderMinMaxConfig
impl UnwindSafe for FloatEncoderMinMaxConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more