pub struct EllStable { /* private fields */ }Expand description
The code defines a struct called EllStable that represents the stable version of an ellipsoid
search space in the Ellipsoid method.
EllStable = {x | (x - xc)^T mq^-1 (x - xc) \le \kappa}
Properties:
no_defer_trick: A boolean flag indicating whether the defer trick should be used. The defer trick is a technique used in the Ellipsoid method to improve efficiency by deferring the update of the ellipsoid until a certain condition is met.mq: A matrix representing the shape of the ellipsoid. It is a 2-dimensional array of f64 values.xc: Thexcproperty represents the center of the ellipsoid search space. It is a 1-dimensional array of floating-point numbers.kappa: A scalar value that determines the size of the ellipsoid. A larger value of kappa results in a larger ellipsoid.ndim: Thendimproperty represents the number of dimensions of the ellipsoid search space.helper: Thehelperproperty is an instance of theEllCalcstruct, which is used to perform calculations related to the ellipsoid search space. It provides methods for calculating the distance constant (dc), the center constant (cc), and the quadratic constant (q) used in the elliptsq: Thetsqproperty represents the squared Mahalanobis distance threshold of the ellipsoid. It is used to determine whether a point is inside or outside the ellipsoid.
Implementations§
Source§impl EllStable
impl EllStable
Sourcepub fn new_with_matrix(
kappa: f64,
mq: Array2<f64>,
xc: Array1<f64>,
) -> EllStable
pub fn new_with_matrix( kappa: f64, mq: Array2<f64>, xc: Array1<f64>, ) -> EllStable
The function new_with_matrix constructs a new EllStable object with the given parameters.
Arguments:
kappa: Thekappaparameter is a floating-point number that represents the curvature of the ellipse. It determines the shape of the ellipse, with higher values resulting in a more elongated shape and lower values resulting in a more circular shape.mq: Themqparameter is of typeArray2<f64>, which represents a 2-dimensional array off64(floating-point) values. It is used to store the matrixmqin theEllStableobject.xc: The parameterxcrepresents the center of the ellipsoid in n-dimensional space. It is an array of lengthndim, where each element represents the coordinate of the center along a specific dimension.
Returns:
an instance of the EllStable struct.
Sourcepub fn new(val: Array1<f64>, xc: Array1<f64>) -> EllStable
pub fn new(val: Array1<f64>, xc: Array1<f64>) -> EllStable
Creates a new EllStable.
The function new creates a new EllStable object with the given values.
Arguments:
val: An array of f64 values representing the diagonal elements of a matrix.xc:xcis anArray1<f64>which represents the center of the ellipse. It contains the x and y coordinates of the center point.
Returns:
The function new returns an instance of the EllStable struct.
Sourcepub fn new_with_scalar(val: f64, xc: Array1<f64>) -> EllStable
pub fn new_with_scalar(val: f64, xc: Array1<f64>) -> EllStable
The function new_with_scalar constructs a new EllStable object with a scalar value and a vector.
Arguments:
val: Thevalparameter is a scalar value of typef64. It represents the value of the scalar component of theEllStableobject.xc: The parameterxcis an array of typeArray1<f64>. It represents the center coordinates of the ellipse.
Returns:
an instance of the EllStable struct.
Trait Implementations§
Source§impl SearchSpace for EllStable
impl SearchSpace for EllStable
Source§fn tsq(&self) -> f64
fn tsq(&self) -> f64
The tsq function returns the value of the tsq field of the struct.
Returns:
The method tsq is returning a value of type f64.
Source§fn update_bias_cut<T>(&mut self, cut: &(Self::ArrayType, T)) -> CutStatuswhere
T: UpdateByCutChoice<Self, ArrayType = Self::ArrayType>,
fn update_bias_cut<T>(&mut self, cut: &(Self::ArrayType, T)) -> CutStatuswhere
T: UpdateByCutChoice<Self, ArrayType = Self::ArrayType>,
The update_bias_cut function updates the decision variable based on the given cut.
Arguments:
cut: A tuple containing two elements:
Returns:
The update_bias_cut function returns a value of type CutStatus.
Source§fn update_central_cut<T>(&mut self, cut: &(Self::ArrayType, T)) -> CutStatuswhere
T: UpdateByCutChoice<Self, ArrayType = Self::ArrayType>,
fn update_central_cut<T>(&mut self, cut: &(Self::ArrayType, T)) -> CutStatuswhere
T: UpdateByCutChoice<Self, ArrayType = Self::ArrayType>,
The update_central_cut function updates the cut choices using the gradient and beta values.
Arguments:
cut: Thecutparameter is a tuple containing two elements. The first element is of typeSelf::ArrayType, and the second element is of typeT.
Returns:
The function update_central_cut returns a value of type CutStatus.
type ArrayType = ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
fn set_xc(&mut self, x: Self::ArrayType)
Source§impl SearchSpaceQ for EllStable
impl SearchSpaceQ for EllStable
Source§fn tsq(&self) -> f64
fn tsq(&self) -> f64
The tsq function returns the value of the tsq field of the struct.
Returns:
The method tsq is returning a value of type f64.
Source§fn update_q<T>(&mut self, cut: &(Self::ArrayType, T)) -> CutStatuswhere
T: UpdateByCutChoice<Self, ArrayType = Self::ArrayType>,
fn update_q<T>(&mut self, cut: &(Self::ArrayType, T)) -> CutStatuswhere
T: UpdateByCutChoice<Self, ArrayType = Self::ArrayType>,
The update_q function updates the decision variable based on the given cut.
Arguments:
cut: A tuple containing two elements:
Returns:
The update_bias_cut function returns a value of type CutStatus.