# Reference

The AbstractVariable interface:

Convex.AbstractVariableType
abstract type AbstractVariable <: AbstractExpr end

An AbstractVariable should have head field, an id_hash field and a size field to conform to the AbstractExpr interface, and implement methods (or use the field-access fallbacks) for

Optionally, also implement sign!, vartype!, and add_constraint! to allow users to modify those values or add a constraint.

source
Convex._valueFunction
_value(x::AbstractVariable)

Raw access to the current value of x; used internally by Convex.jl.

source
Convex.sign!Function
sign!(x::AbstractVariable, s::Sign)

Sets the current sign of x to s.

source

Functions:

Convex.fix!Function
fix!(x::AbstractVariable, v = value(x))

Fixes x to v. It is subsequently treated as a constant in future optimization problems. See also free!.

source
Convex.evaluateFunction
evaluate(x::AbstractExpr)

Returns the current value of x if assigned; errors otherwise.

source
Convex.solve!Function
solve!(problem::Problem{T}, optimizer::MOI.ModelLike;
check_vexity::Bool = true,
verbose::Bool = true,
warmstart::Bool = false,
silent_solver::Bool = false) where {T}

Solves the problem, populating problem.optval with the optimal value, as well as the values of the variables (accessed by evaluate) and constraint duals (accessed by cons.dual), where applicable.

Optional keyword arguments:

• check_vexity (default: true): emits a warning if the problem is not DCP
• verbose (default: true): emits a warning if the problem was not solved optimally or warmstart=true but is not supported by the solver.
• warmstart (default: false): whether the solver should start the optimization from a previous optimal value (according to the current value of the variables in the problem, which can be set by set_value! and accessed by evaluate).
• silent_solver: whether the solver should be silent (and not emit output or logs) during the solution process.
source
Convex.emit_dcp_warningsFunction
emit_dcp_warnings

Controls whether or not warnings are emitted for when an expression fails to be of disciplined convex form. To turn warnings off, override the method via

Convex.emit_dcp_warnings() = false

This will cause Julia's method invalidation to recompile any functions emitting DCP warnings and remove them. This should be run from top-level (not within a function).

source