pub struct GeometricProgramSolver {
pub max_iter: usize,
pub step_size: f64,
pub tol: f64,
}Expand description
Geometric program solver via convex transformation.
A GP in standard form: minimize p_0(x) subject to p_i(x) ≤ 1, i=1..m, where each p_i is a posynomial. Under the change of variables x = exp(y), the GP becomes convex (log-sum-exp minimization).
This solver applies gradient descent on the log-domain objective.
Fields§
§max_iter: usizeMaximum iterations for the inner gradient descent.
step_size: f64Step size for gradient descent in log-domain.
tol: f64Convergence tolerance.
Implementations§
Source§impl GeometricProgramSolver
impl GeometricProgramSolver
Sourcepub fn eval_log_monomial(log_c: f64, exponents: &[f64], y: &[f64]) -> f64
pub fn eval_log_monomial(log_c: f64, exponents: &[f64], y: &[f64]) -> f64
Evaluate a monomial c · ∏ x_i^{a_i} at log-domain point y (x = exp(y)). Returns log(c) + a^T y.
Sourcepub fn log_sum_exp_posynomial(monomials: &[(f64, Vec<f64>)], y: &[f64]) -> f64
pub fn log_sum_exp_posynomial(monomials: &[(f64, Vec<f64>)], y: &[f64]) -> f64
Evaluate log of a posynomial: log(∑_k exp(log_c_k + a_k^T y)).
Sourcepub fn solve(
&self,
objective: &[(f64, Vec<f64>)],
constraints: &[Vec<(f64, Vec<f64>)>],
y0: &[f64],
) -> (Vec<f64>, f64)
pub fn solve( &self, objective: &[(f64, Vec<f64>)], constraints: &[Vec<(f64, Vec<f64>)>], y0: &[f64], ) -> (Vec<f64>, f64)
Solve the GP: minimize objective posynomial subject to constraint posynomials ≤ 1.
objective: list of (log_coefficient, exponent_vector) pairs for objective posynomial.
constraints: list of posynomials, each a list of (log_c, exponents) pairs.
Returns the optimal y = log(x) and the optimal objective value.
Trait Implementations§
Source§impl Clone for GeometricProgramSolver
impl Clone for GeometricProgramSolver
Source§fn clone(&self) -> GeometricProgramSolver
fn clone(&self) -> GeometricProgramSolver
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more