pub struct FloatEncoderCenterRadiusConfig {
pub center: f64,
pub radius: f64,
pub nb_bit_precision: usize,
pub nb_bit_padding: usize,
}Expand description
Parameters allowing to construct a FloatEncoder from the center and radius of the range to be
represented.
Fields§
§center: f64§radius: f64§nb_bit_precision: usize§nb_bit_padding: usizeTrait Implementations§
Source§impl Clone for FloatEncoderCenterRadiusConfig
impl Clone for FloatEncoderCenterRadiusConfig
Source§fn clone(&self) -> FloatEncoderCenterRadiusConfig
fn clone(&self) -> FloatEncoderCenterRadiusConfig
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 EncoderCreationEngine<FloatEncoderCenterRadiusConfig, FloatEncoder> for DefaultEngine
§Description:
Implementation of EncoderCreationEngine for DefaultEngine that creates an encoder to
encode 64 bits floating point numbers.
impl EncoderCreationEngine<FloatEncoderCenterRadiusConfig, 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: &FloatEncoderCenterRadiusConfig,
) -> Result<FloatEncoder, EncoderCreationError<Self::EngineError>>
fn create_encoder_from( &mut self, config: &FloatEncoderCenterRadiusConfig, ) -> 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(&FloatEncoderCenterRadiusConfig {
center: 10.,
radius: 5.,
nb_bit_precision: 8,
nb_bit_padding: 1,
})?;Source§unsafe fn create_encoder_from_unchecked(
&mut self,
config: &FloatEncoderCenterRadiusConfig,
) -> FloatEncoder
unsafe fn create_encoder_from_unchecked( &mut self, config: &FloatEncoderCenterRadiusConfig, ) -> FloatEncoder
Unsafely creates an encoder from a config. Read more
Source§impl EncoderVectorCreationEngine<FloatEncoderCenterRadiusConfig, 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<FloatEncoderCenterRadiusConfig, 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: &[FloatEncoderCenterRadiusConfig],
) -> Result<FloatEncoderVector, EncoderVectorCreationError<Self::EngineError>>
fn create_encoder_vector_from( &mut self, config: &[FloatEncoderCenterRadiusConfig], ) -> 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![
FloatEncoderCenterRadiusConfig {
center: 10.,
radius: 5.,
nb_bit_precision: 8,
nb_bit_padding: 1,
};
1
])?;Source§unsafe fn create_encoder_vector_from_unchecked(
&mut self,
config: &[FloatEncoderCenterRadiusConfig],
) -> FloatEncoderVector
unsafe fn create_encoder_vector_from_unchecked( &mut self, config: &[FloatEncoderCenterRadiusConfig], ) -> FloatEncoderVector
Unsafely creates an encoder vector from a config. Read more
Source§impl PartialEq for FloatEncoderCenterRadiusConfig
impl PartialEq for FloatEncoderCenterRadiusConfig
Source§fn eq(&self, other: &FloatEncoderCenterRadiusConfig) -> bool
fn eq(&self, other: &FloatEncoderCenterRadiusConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FloatEncoderCenterRadiusConfig
Auto Trait Implementations§
impl Freeze for FloatEncoderCenterRadiusConfig
impl RefUnwindSafe for FloatEncoderCenterRadiusConfig
impl Send for FloatEncoderCenterRadiusConfig
impl Sync for FloatEncoderCenterRadiusConfig
impl Unpin for FloatEncoderCenterRadiusConfig
impl UnwindSafe for FloatEncoderCenterRadiusConfig
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