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
: Then_f
property represents the number of variables in the ellipsoid search space.n_plus_1
: Then_plus_1
property represents the value ofn + 1
, wheren
is the dimension of the search space. It is used in calculations related to the ellipsoid search space.half_n
: Thehalf_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
: Thecst1
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
: Thecst2
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
: Thecst3
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
impl EllCalcCore
Sourcepub fn new(n_f: f64) -> EllCalcCore
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 parametern_f
represents the value ofn
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);
Sourcepub fn calc_parallel_bias_cut_fast(
&self,
beta0: f64,
beta1: f64,
tsq: f64,
b0b1: f64,
eta: f64,
) -> (f64, f64, f64)
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 parameterbeta0
represents the semi-minor axis of the ellipsoid before the cut. It is a floating-point number.beta1
: The parameterbeta1
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);
Sourcepub fn calc_parallel_bias_cut(
&self,
beta0: f64,
beta1: f64,
tsq: f64,
) -> (f64, f64, f64)
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 parameterbeta0
represents the semi-minor axis of the ellipsoid before the cut. It is a floating-point number.beta1
: The parameterbeta1
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);
Sourcepub fn calc_parallel_central_cut(&self, beta1: f64, tsq: f64) -> (f64, f64, f64)
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 parameterbeta1
represents the semi-minor axis of the ellipsoid. It is a floating-point number.tsq
: The parametertsq
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);
Sourcepub fn calc_bias_cut_fast(
&self,
beta: f64,
tau: f64,
eta: f64,
) -> (f64, f64, f64)
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
: Thebeta
parameter represents a value used in the calculation of the core of updating the ellipsoid with the deep-cut. It is of typef64
, which means it is a 64-bit floating-point number.tau
: The parametertau
represents the time constant of the system. It is a measure of how quickly the system responds to changes.eta
: The parametereta
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);
Sourcepub fn calc_bias_cut(&self, beta: f64, tau: f64) -> (f64, f64, f64)
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
: Thebeta
parameter represents a value used in the calculation of the core of updating the ellipsoid with the deep-cut. It is of typef64
, which means it is a 64-bit floating-point number.tau
: The parametertau
represents the time constant of the system. It is a measure of how quickly the system responds to changes.eta
: The parametereta
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);
Sourcepub fn calc_central_cut(&self, tsq: f64) -> (f64, f64, f64)
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 parametertsq
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
impl Clone for EllCalcCore
Source§fn clone(&self) -> EllCalcCore
fn clone(&self) -> EllCalcCore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more