Struct EllCalcCore

Source
pub struct EllCalcCore {
    pub n_f: f64,
    pub n_plus_1: f64,
    pub half_n: f64,
    pub inv_n: f64,
    /* private fields */
}
Expand description

The EllCalcCore struct represents the parameters for calculating the new Ellipsoid Search Space.

Properties:

  • n_f: The n_f property represents the number of variables in the ellipsoid search space.
  • n_plus_1: The n_plus_1 property represents the value of n + 1, where n is the dimension of the search space. It is used in calculations related to the ellipsoid search space.
  • half_n: The half_n property represents half of the dimension of the ellipsoid search space. It is used in the calculation of the parameters for the ellipsoid search space.
  • cst1: The cst1 property is a constant used in the calculation of the parameters for the new Ellipsoid Search Space. Its specific purpose and value are not provided in the code snippet.
  • cst2: The cst2 property is a constant used in the calculation of the parameters for the new Ellipsoid Search Space. It is not specified what exactly it represents or how it is used in the calculation.
  • cst3: The cst3 property is a constant value used in the calculation of the parameters for the new Ellipsoid Search Space. It is not specified what exactly this constant represents or how it is used in the calculations.

Fields§

§n_f: f64§n_plus_1: f64§half_n: f64§inv_n: f64

Implementations§

Source§

impl EllCalcCore

Source

pub fn new(n_f: f64) -> EllCalcCore

Constructs a new EllCalcCore instance, initializing its fields based on the provided dimension n_f.

This is a constructor function for the EllCalcCore struct. It takes in the dimension n_f and uses it to calculate and initialize the other fields of EllCalcCore that depend on n_f.

Being a constructor function, it is part of the public API of the EllCalcCore struct. The documentation follows the conventions and style of the other documentation in this crate.

Arguments:

  • n_f: The parameter n_f represents the value of n in the calculations. It is a floating-point number.

Returns:

The new function returns an instance of the EllCalcCore struct.

§Examples:
use approx_eq::assert_approx_eq;
use ellalgo_rs::ell_calc::EllCalcCore;

let ell_calc_core = EllCalcCore::new(4.0);

assert_approx_eq!(ell_calc_core.n_f, 4.0);
assert_approx_eq!(ell_calc_core.half_n, 2.0);
assert_approx_eq!(ell_calc_core.n_plus_1, 5.0);
Source

pub fn calc_parallel_bias_cut_fast( &self, beta0: f64, beta1: f64, tsq: f64, b0b1: f64, eta: f64, ) -> (f64, f64, f64)

The function calculates the core values for updating an ellipsoid with either a parallel-cut or a deep-cut.

Arguments:

  • beta0: The parameter beta0 represents the semi-minor axis of the ellipsoid before the cut. It is a floating-point number.
  • beta1: The parameter beta1 represents the length of the semi-minor axis of the ellipsoid.
  • tsq: tsq is a reference to a f64 value, which represents the square of the semi-major axis of the ellipsoid.

§Examples
use approx_eq::assert_approx_eq;
use ellalgo_rs::ell_calc::EllCalcCore;

let ell_calc_core = EllCalcCore::new(4.0);
let (rho, sigma, delta) = ell_calc_core.calc_parallel_bias_cut_fast(1.0, 2.0, 4.0, 2.0, 12.0);
assert_approx_eq!(rho, 1.2);
assert_approx_eq!(sigma, 0.8);
assert_approx_eq!(delta, 0.8);
Source

pub fn calc_parallel_bias_cut( &self, beta0: f64, beta1: f64, tsq: f64, ) -> (f64, f64, f64)

The function calculates the core values for updating an ellipsoid with either a parallel-cut or a deep-cut.

Arguments:

  • beta0: The parameter beta0 represents the semi-minor axis of the ellipsoid before the cut. It is a floating-point number.
  • beta1: The parameter beta1 represents the length of the semi-minor axis of the ellipsoid.
  • tsq: tsq is a reference to a f64 value, which represents the square of the semi-major axis of the ellipsoid.

§Examples
use approx_eq::assert_approx_eq;
use ellalgo_rs::ell_calc::EllCalcCore;

let ell_calc_core = EllCalcCore::new(4.0);
let (rho, sigma, delta) = ell_calc_core.calc_parallel_bias_cut(1.0, 2.0, 4.0);
assert_approx_eq!(rho, 1.2);
assert_approx_eq!(sigma, 0.8);
assert_approx_eq!(delta, 0.8);
Source

pub fn calc_parallel_central_cut(&self, beta1: f64, tsq: f64) -> (f64, f64, f64)

The function calculates the core values for updating an ellipsoid with the parallel-cut method.

Arguments:

  • beta1: The parameter beta1 represents the semi-minor axis of the ellipsoid. It is a floating-point number.
  • tsq: The parameter tsq represents the square of the gamma semi-axis length of the ellipsoid.

§Example
use approx_eq::assert_approx_eq;
use ellalgo_rs::ell_calc::EllCalcCore;

let ell_calc_core = EllCalcCore::new(4.0);
let (rho, sigma, delta) = ell_calc_core.calc_parallel_central_cut(1.0, 4.0);
assert_approx_eq!(rho, 0.4);
assert_approx_eq!(sigma, 0.8);
assert_approx_eq!(delta, 1.2);
Source

pub fn calc_bias_cut_fast( &self, beta: f64, tau: f64, eta: f64, ) -> (f64, f64, f64)

The function calculates the core values needed for updating an ellipsoid with the deep-cut method.

Arguments:

  • beta: The beta parameter represents a value used in the calculation of the core of updating the ellipsoid with the deep-cut. It is of type f64, which means it is a 64-bit floating-point number.
  • tau: The parameter tau represents the time constant of the system. It is a measure of how quickly the system responds to changes.
  • eta: The parameter eta represents the deep-cut factor. It is a measure of how much the ellipsoid is being updated or modified.

§Example
use approx_eq::assert_approx_eq;
use ellalgo_rs::ell_calc::EllCalcCore;

let ell_calc_core = EllCalcCore::new(4.0);
let (rho, sigma, delta) = ell_calc_core.calc_bias_cut_fast(1.0, 2.0, 6.0);
assert_approx_eq!(rho, 1.2);
assert_approx_eq!(sigma, 0.8);
assert_approx_eq!(delta, 0.8);
Source

pub fn calc_bias_cut(&self, beta: f64, tau: f64) -> (f64, f64, f64)

The function calculates the core values needed for updating an ellipsoid with the deep-cut method.

Arguments:

  • beta: The beta parameter represents a value used in the calculation of the core of updating the ellipsoid with the deep-cut. It is of type f64, which means it is a 64-bit floating-point number.
  • tau: The parameter tau represents the time constant of the system. It is a measure of how quickly the system responds to changes.
  • eta: The parameter eta represents the deep-cut factor. It is a measure of how much the ellipsoid is being updated or modified.

§Example
use approx_eq::assert_approx_eq;
use ellalgo_rs::ell_calc::EllCalcCore;

let ell_calc_core = EllCalcCore::new(4.0);
let (rho, sigma, delta) = ell_calc_core.calc_bias_cut(1.0, 2.0);
assert_approx_eq!(rho, 1.2);
assert_approx_eq!(sigma, 0.8);
assert_approx_eq!(delta, 0.8);
Source

pub fn calc_central_cut(&self, tsq: f64) -> (f64, f64, f64)

The calc_central_cut_core function calculates the core values needed for updating an ellipsoid with the central-cut.

Arguments:

  • tsq: The parameter tsq represents the square of the time taken to update the ellipsoid with the central-cut.

§Example
use approx_eq::assert_approx_eq;
use ellalgo_rs::ell_calc::EllCalcCore;
let ell_calc_core = EllCalcCore::new(4.0);
let (rho, sigma, delta) = ell_calc_core.calc_central_cut(4.0);
assert_approx_eq!(rho, 0.4);
assert_approx_eq!(sigma, 0.4);
assert_approx_eq!(delta, 16.0/15.0);

Trait Implementations§

Source§

impl Clone for EllCalcCore

Source§

fn clone(&self) -> EllCalcCore

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EllCalcCore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.