Mojo struct
Solver
@memory_only
struct Solver
Aliases
LOWER_BOUND = Int8(0)UPPER_BOUND = Int8(1)FREE = Int8(2)
Fields
- active_size (
Int) - y (
Pointer[Int8, MutUntrackedOrigin]) - G (
Pointer[Float64, MutUntrackedOrigin]) - alpha_status (
Pointer[Int8, MutUntrackedOrigin]) - alpha (
Pointer[Float64, MutUntrackedOrigin]) - QD (
Pointer[Float64, MutUntrackedOrigin]) - eps (
Float64) - Cp (
Float64) - Cn (
Float64) - p (
Pointer[Float64, MutUntrackedOrigin]) - active_set (
Pointer[Int, MutUntrackedOrigin]) - G_bar (
Pointer[Float64, MutUntrackedOrigin]) - l (
Int) - unshrink (
Bool)
Implemented traits
AnyType, Deinitable, Movable
Methods
__init__
fn def __init__(out self)
Args:
- self (
Self)
Returns:
Self
get_C
fn def get_C(self, i: Int) -> Float64
Args:
- self (
Self) - i (
Int)
Returns:
Float64
update_alpha_status
fn def update_alpha_status(self, i: Int)
Args:
- self (
Self) - i (
Int)
is_upper_bound
fn def is_upper_bound(self, i: Int) -> Bool
Args:
- self (
Self) - i (
Int)
Returns:
Bool
is_lower_bound
fn def is_lower_bound(self, i: Int) -> Bool
Args:
- self (
Self) - i (
Int)
Returns:
Bool
is_free
fn def is_free(self, i: Int) -> Bool
Args:
- self (
Self) - i (
Int)
Returns:
Bool
swap_index
fn def swap_index[QM: QMatrix](self, mut Q: QM, i: Int, j: Int)
Parameters:
- QM (
QMatrix)
Args:
- self (
Self) - Q (
QM) - i (
Int) - j (
Int)
reconstruct_gradient
fn def reconstruct_gradient[QM: QMatrix](self, mut Q: QM)
Parameters:
- QM (
QMatrix)
Args:
- self (
Self) - Q (
QM)
Solve
fn def Solve[QM: QMatrix](mut self, l: Int, mut Q: QM, p_: Optional[Pointer[Float64, MutUntrackedOrigin]], y_: Optional[Pointer[Int8, MutUntrackedOrigin]], alpha_: Pointer[Float64, MutUntrackedOrigin], Cp: Float64, Cn: Float64, eps: Float64, mut si: SolutionInfo, shrinking: Int)
Parameters:
- QM (
QMatrix)
Args:
- self (
Self) - l (
Int) - Q (
QM) - p_ (
Optional[Pointer[Float64, MutUntrackedOrigin]]) - y_ (
Optional[Pointer[Int8, MutUntrackedOrigin]]) - alpha_ (
Pointer[Float64, MutUntrackedOrigin]) - Cp (
Float64) - Cn (
Float64) - eps (
Float64) - si (
SolutionInfo) - shrinking (
Int)
select_working_set
fn def select_working_set[QM: QMatrix](self, mut Q: QM, mut out_i: Int, mut out_j: Int) -> Int
Parameters:
- QM (
QMatrix)
Args:
- self (
Self) - Q (
QM) - out_i (
Int) - out_j (
Int)
Returns:
Int
be_shrunk
fn def be_shrunk(self, i: Int, Gmax1: Float64, Gmax2: Float64) -> Bool
Args:
- self (
Self) - i (
Int) - Gmax1 (
Float64) - Gmax2 (
Float64)
Returns:
Bool
do_shrinking
fn def do_shrinking[QM: QMatrix](mut self, mut Q: QM)
Parameters:
- QM (
QMatrix)
Args:
- self (
Self) - Q (
QM)
calculate_rho
fn def calculate_rho(self) -> Float64
Args:
- self (
Self)
Returns:
Float64