R: Disciplined Convex Optimization

# Disciplined Convex Optimization

## Documentation for package ‘CVXR’ version 1.9.2

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

A B C D E F G H I K L M N O P Q R S T U V X Z misc

## -- A --

And | Logical AND
as_cvxr_expr | Convert a value to a CVXR Expression
available_solvers | List available solvers

## -- B --

backward | Compute the gradient of a solution with respect to Parameters
bmat | Construct a Block Matrix

## -- C --

CallbackParam | Callback Parameter
cdiac | Global Monthly and Annual Temperature Anomalies (degrees C), 1850-2015 (Relative to the 1961-1990 Mean) (May 2016)
ceil_expr | Elementwise Ceiling
CLARABEL_SOLVER | Solver Name Constants
condition_number | Condition number of a PSD matrix
Constant | Create a Constant Expression
constants | Get the Constants in an Expression
constraints | Get Problem Constraints (read-only)
conv | 1D discrete convolution
convolve | 1D discrete convolution (numpy-style)
COPT_SOLVER | Solver Name Constants
CPLEX_SOLVER | Solver Name Constants
cummax_expr | Cumulative maximum along an axis
cumsum_axis | Cumulative sum along an axis
curvature | Get Expression Curvature
cvar | Conditional Value at Risk (CVaR)
CVXOPT_SOLVER | Solver Name Constants
cvxr_diff | Compute kth Order Differences of an Expression
cvxr_mean | Mean of an expression
cvxr_norm | Compute a norm of an expression
cvxr_outer | Outer product of two vectors
cvxr_std | Standard deviation of an expression
cvxr_var | Variance of an expression

## -- D --

deep_flatten | Recursively flatten a nested list of expressions into one column vector
delta | Access the perturbation 'delta' of a Variable or Parameter
delta<- | Access the perturbation 'delta' of a Variable or Parameter
derivative | Apply the derivative of the solution map to perturbations
diag | Standard R Functions for CVXR Expressions
DiagMat | Extract Diagonal from a Matrix
DiagVec | Vector to Diagonal Matrix
DIFFCP_SOLVER | Solver Name Constants
diff_pos | The difference x - y with domain x > y > 0
dist_ratio | Distance ratio
dotsort | Weighted sorted dot product
dspop | Direct Standardization: Population
dssamp | Direct Standardization: Sample
dual_value | Get the Dual Value of a Constraint

## -- E --

ECOS_BB_SOLVER | Solver Name Constants
ECOS_SOLVER | Solver Name Constants
entr | Create an entropy atom -x * log(x)
Equality | Create an Equality Constraint
exclude_solvers | List available solvers
ExpCone | Create an Exponential Cone Constraint
expr_H | Conjugate-Transpose of an Expression
expr_sign | Get the DCP Sign of an Expression
eye_minus_inv | Unity resolvent (I - X) inverse for positive square matrix X

## -- F --

FiniteSet | FiniteSet Constraint
floor_expr | Elementwise Floor
format_labeled | Pretty-print an expression with labels substituted

## -- G --

gen_lambda_max | Maximum generalized eigenvalue
geo_mean | (Weighted) geometric mean of a vector
get_bounds | Lower/Upper Bounds of a Leaf
get_problem_data | Get Problem Data for a Solver (deprecated)
GLPK_MI_SOLVER | Solver Name Constants
GLPK_SOLVER | Solver Name Constants
gmatmul | Geometric matrix multiplication A diamond X
gradient | Access the gradient of a Variable or Parameter
gradient<- | Access the gradient of a Variable or Parameter
GUROBI_SOLVER | Solver Name Constants

## -- H --

harmonic_mean | Harmonic mean: n / sum(1/x_i)
HIGHS_SOLVER | Solver Name Constants
hstack | Horizontal concatenation of expressions
huber | Create a Huber loss atom

## -- I --

id | Get Expression ID
iff | Logical Biconditional
implies | Logical Implication
include_solvers | List available solvers
indicator | Indicator function for constraints
Inequality | Create an Inequality Constraint
INFEASIBLE | Solution Status Constants
INFEASIBLE_INACCURATE | Solution Status Constants
INFEASIBLE_OR_UNBOUNDED | Solution Status Constants
installed_solvers | List installed solvers
inv_pos | Inverse position: x^{-1} (for x > 0)
inv_prod | Reciprocal of product of entries
IPOPT_SOLVER | Solver Name Constants
is_affine | Check if an Expression is Affine
is_atom_smooth | Check if an Atom is Smooth
is_concave | Check if an Expression is Concave
is_constant | Check if an Expression is Constant
is_convex | Check if an Expression is Convex
is_dcp | Check if an Expression is DCP-Compliant
is_dgp | Check if a Constraint is DGP-Compliant
is_dnlp | Check if an Expression or Problem is DNLP-Compliant
is_dpp | Check DPP Compliance
is_dqcp | Check if Expression is DQCP-Compliant
is_linearizable_concave | Check if an Expression is Linearizable-Concave
is_linearizable_convex | Check if an Expression is Linearizable-Convex
is_log_log_affine | Check if Expression is Log-Log Affine
is_log_log_concave | Check if Expression is Log-Log Concave
is_log_log_convex | Check if Expression is Log-Log Convex
is_lp | Check if a Problem is a Linear Program
is_matrix | Is the Expression a Matrix?
is_mixed_integer | Check if a Problem is Mixed-Integer
is_nonneg | Check if Expression is Non-Negative
is_nonpos | Check if Expression is Non-Positive
is_nsd | Check if Expression is Negative Semidefinite
is_psd | Check if Expression is Positive Semidefinite
is_pwl | Check if Expression is Piecewise Linear
is_qp | Check if a Problem is a Quadratic Program
is_quadratic | Check if an Expression is Quadratic
is_quasiconcave | Check if Expression is Quasiconcave
is_quasiconvex | Check if Expression is Quasiconvex
is_quasilinear | Check if Expression is Quasilinear
is_scalar | Is the Expression a Scalar?
is_smooth | Check if an Expression is Smooth
is_symmetric | Check if Expression is Symmetric
is_vector | Is the Expression a Vector?
is_zero | Check if Expression is Zero

## -- K --

kl_div | KL Divergence: x*log(x/y) - x + y
KNITRO_SOLVER | Solver Name Constants
kron | Kronecker product of two expressions

## -- L --

label | Get the label of an expression
label<- | Set the label of an expression
lambda_max | Maximum eigenvalue
lambda_min | Minimum eigenvalue
lambda_sum_largest | Sum of largest k eigenvalues
lambda_sum_smallest | Sum of smallest k eigenvalues
length_expr | Length of a Vector (Last Nonzero Index)
log1p_atom | Log(1 + x) - elementwise
log1p_expr | Log(1 + x) - elementwise
loggamma | Elementwise log of the gamma function
logistic | Logistic function: log(1 + exp(x)) - elementwise
log_det | Log-determinant
log_normcdf | Elementwise log of the standard normal CDF
log_sum_exp | Log-sum-exp: log(sum(exp(x)))

## -- M --

make_sparse_diagonal_matrix | Make a CSC sparse diagonal matrix
math_atoms | Standard R Functions for CVXR Expressions
matrix_frac | Matrix fractional function
matrix_trace | Trace of a square matrix expression
Maximize | Create a Maximization Objective
max_elemwise | Elementwise maximum of expressions
max_entries | Maximum entry of an expression
Minimize | Create a Minimization Objective
min_elemwise | Elementwise minimum of expressions
min_entries | Minimum entry of an expression
mixed_norm | Mixed norm (L_{p,q} norm): column-wise p-norm, then q-norm
MOSEK_SOLVER | Solver Name Constants
multiply | Elementwise multiplication (deprecated)

## -- N --

name | Get Expression Name
neg | Negative part: -min(x, 0)
NonNeg | Create a Non-Negative Constraint
NonPos | Create a Non-Positive Constraint
norm | Standard R Functions for CVXR Expressions
norm1 | L1 norm of an expression
norm2 | Euclidean norm (deprecated alias)
normcdf | Standard Normal Cumulative Distribution Function
norm_inf | L-infinity norm of an expression
norm_nuc | Nuclear norm (sum of singular values)
Not | Logical NOT

## -- O --

objective | Get Problem Objective (read-only)
one_minus_pos | The difference 1 - x with domain (0, 1)
OPTIMAL | Solution Status Constants
OPTIMAL_INACCURATE | Solution Status Constants
Or | Logical OR
OSQP_SOLVER | Solver Name Constants
outer | Standard R Functions for CVXR Expressions

## -- P --

Parameter | Create a Parameter
parameters | Get the Parameters in an Expression
param_backward | Reduction chain-rule hooks (dict-in / dict-out)
param_dict | Get all Parameters of a Problem as a Named List
param_forward | Reduction chain-rule hooks (dict-in / dict-out)
param_id_map | Reduction leaf-id maps
partial_optimize | Partial optimization transform
partial_trace | Partial trace of a tensor product expression
partial_transpose | Partial transpose of a tensor product expression
perspective | Perspective Transform
pf_eigenvalue | Perron-Frobenius eigenvalue of a positive matrix
PIQP_SOLVER | Solver Name Constants
pos | Positive part: max(x, 0)
PowCone3D | Create a 3D Power Cone Constraint
PowConeND | Create an N-Dimensional Power Cone Constraint
power | Create a Power atom
Problem | Create an Optimization Problem
problem_data | Get Problem Data for a Solver
problem_solution | Get the Raw Solution Object (deprecated)
problem_status | Get the Solution Status of a Problem (deprecated)
problem_unpack_results | Unpack Solver Results into a Problem
prod_entries | Product of entries along an axis
PSD | Create a Positive Semidefinite Constraint
psolve | Solve a Convex Optimization Problem
ptp | Peak-to-peak (range): max(x) - min(x)
p_norm | General p-norm of an expression

## -- Q --

quad_form | Quadratic form x^T P x
quad_over_lin | Sum of squares divided by a scalar

## -- R --

reduction-chain-rule | Reduction chain-rule hooks (dict-in / dict-out)
reduction-id-map | Reduction leaf-id maps
rel_entr | Relative Entropy: x*log(x/y)
reshape_expr | Reshape an expression to a new shape
residual | Get the Residual of a Constraint
resolvent | Resolvent inverse(sI - X)

## -- S --

sample_bounds | Sampling Bounds for NLP Random Restarts
sample_bounds<- | Sampling Bounds for NLP Random Restarts
scalarize | Scalarize multiple objectives into a single objective
scalar_product | Scalar product (alias for vdot)
scalene | Scalene penalty: alpha * pos(x) + beta * neg(x)
SCIP_SOLVER | Solver Name Constants
SCS_SOLVER | Solver Name Constants
sd | Standard R Functions for CVXR Expressions
set_excluded_solvers | List available solvers
set_label | Attach a label to an expression
sigma_max | Maximum singular value
size | Get Expression Size
SizeMetrics | Problem Size Metrics
size_metrics | Get Size Metrics for a Problem
SOC | Create a Second-Order Cone Constraint
solution | Get the Raw Solution Object
solver-constants | Solver Name Constants
solver_default_param | Standard Solver Parameter Mappings
SOLVER_ERROR | Solution Status Constants
solver_opts | Create Solver Options
solver_stats | Get Solver Statistics
solve_via_data | Solve via Raw Data
square | Square of an expression: x^2
status | Get the Solution Status of a Problem
status-constants | Solution Status Constants
std | Standard deviation of an expression
sum_entries | Sum the entries of an expression
sum_largest | Sum of k largest entries
sum_smallest | Sum of k smallest entries
sum_squares | Sum of squares (= quad_over_lin(x, 1))

## -- T --

total_variation | Total variation of a vector or matrix
to_latex | Convert CVXR Object to LaTeX
tr_inv | Trace of matrix inverse
tv | Total variation (deprecated alias)

## -- U --

UNBOUNDED | Solution Status Constants
UNBOUNDED_INACCURATE | Solution Status Constants
UNO_SOLVER | Solver Name Constants
unpack_results | Unpack Results (backward-compatible alias)
upper_tri | Extract strict upper triangle of a square matrix
USER_LIMIT | Solution Status Constants

## -- V --

value | Get the Numeric Value of an Expression
value<- | Set the Value of a Leaf Expression
var | Standard R Functions for CVXR Expressions
Variable | Create an Optimization Variable
variables | Get the Variables in an Expression
var_backward | Reduction chain-rule hooks (dict-in / dict-out)
var_dict | Get all Variables of a Problem as a Named List
var_forward | Reduction chain-rule hooks (dict-in / dict-out)
var_id_map | Reduction leaf-id maps
vdot | Vector dot product (inner product)
vec | Vectorize an expression (column vector)
vec_to_upper_tri | Reshape a vector into an upper triangular matrix
violation | Get the Violation of a Constraint
visualize | Visualize the Canonicalization Pipeline of a CVXR Problem
vstack | Vertical concatenation of expressions

## -- X --

xexp | x * exp(x) - elementwise
Xor | Logical XOR
XPRESS_SOLVER | Solver Name Constants

## -- Z --

Zero | Create a Zero Constraint

## -- misc --

%<<% | Negative Semidefinite Constraint Operator
%>>% | Positive Semidefinite Constraint Operator