Atoms¶
Atoms are mathematical functions that can be applied to
Expression
instances.
Applying an atom to an expression yields another expression.
Atoms and compositions thereof are precisely the mechanisms that allow you to
build up mathematical expression trees in CVXPY.
Every atom is tagged with information about its domain, sign, curvature, log-log curvature, and monotonicity; this information lets atom instances reason about whether or not they are DCP or DGP. See the Atomic Functions page for a compact, accessible summary of each atom’s attributes.
- Affine Atoms
- Elementwise Atoms
- Other Atoms
- cummax
- diff_pos
- eye_minus_inv
- geo_mean
- gmatmul
- harmonic_mean
- inv_prod
- lambda_max
- lambda_min
- lambda_sum_largest
- lambda_sum_smallest
- log_det
- log_sum_exp
- matrix_frac
- max
- min
- mixed_norm
- norm
- norm1
- norm2
- norm_inf
- normNuc
- one_minus_pos
- pf_eigenvalue
- pnorm
- Pnorm
- prod
- quad_form
- quad_over_lin
- resolvent
- sigma_max
- sum_largest
- sum_smallest
- sum_squares
- tv
Atom¶
- class cvxpy.atoms.atom.Atom(*args)[source]¶
Bases:
Expression
Abstract base class for atoms.
- property domain: List[Constraint]¶
A list of constraints describing the closure of the region where the expression is finite.
- property grad¶
Gives the (sub/super)gradient of the expression w.r.t. each variable.
Matrix expressions are vectorized, so the gradient is a matrix. None indicates variable values unknown or outside domain.
- Returns:
A map of variable to SciPy CSC sparse matrix or None.