def transform_sigma_max(expr): X = only_arg(expr) m, n = dims(X) S = epi_var(expr, "sigma_max_S", size=(m+n, m+n)) t = epi_var(expr, "sigma_max") t_In = expression.diag_vec(expression.multiply(expression.ones(n, 1), t)) t_Im = expression.diag_vec(expression.multiply(expression.ones(m, 1), t)) return t, [ expression.eq_constraint(expression.index(S, 0, n, 0, n), t_In), expression.eq_constraint(expression.index(S, n, n+m, 0, n), X), expression.eq_constraint(expression.index(S, n, n+m, n, n+m), t_Im), expression.semidefinite(S)]
def transform_sigma_max(expr): X = only_arg(expr) m, n = dims(X) S = epi_var(expr, "sigma_max_S", size=(m + n, m + n)) t = epi_var(expr, "sigma_max") t_In = expression.diag_vec(expression.multiply(expression.ones(n, 1), t)) t_Im = expression.diag_vec(expression.multiply(expression.ones(m, 1), t)) return t, [ expression.eq_constraint(expression.index(S, 0, n, 0, n), t_In), expression.eq_constraint(expression.index(S, n, n + m, 0, n), X), expression.eq_constraint(expression.index(S, n, n + m, n, n + m), t_Im), expression.semidefinite(S) ]
def transform_lambda_max(expr): t = epi_var(expr, "lambda_max", size=(1,1)) X = only_arg(expr) n = dim(X, 0) tI = expression.diag_vec(expression.multiply(expression.ones(n, 1), t)) return t, [expression.psd_constraint(tI, X)]
def transform_lambda_max(expr): t = epi_var(expr, "lambda_max", size=(1, 1)) X = only_arg(expr) n = dim(X, 0) tI = expression.diag_vec(expression.multiply(expression.ones(n, 1), t)) return t, [expression.psd_constraint(tI, X)]