网页
综合
更新时间 2026-11-14 17:02:10
Atoms -
自动蜘蛛
www.cvxpy.org
正文约 1928 字
⏱️ Help us benchmark CVXPY solvers! Contribute problems and results to the Solver Benchmarks project. Read our new paper on the CVXPY internals!
An atom (with a lower-case “a”) is a mathematical function that can be applied to Expression objects and returns an Expression object.
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.
From an implementation perspective, an atom might be the constructor for some class. For example, the atom \(X \mapsto \lambda_{\max}(X)\) is applied by constructing an instance of the lambda_max class, which inherits directly from Atom and indirectly from Expression. Most atoms are implemented this way.
Alternatively, an atom be a wrapper that initializes and returns an Atom of some other class. For example, running
This happens because (1) CVXPY implements lambda_min() as
(2) the negation operator is a class-based atom, and (3) the precise type of an Expression is based on the last class-based atom applied to it (if any such atom has been applied).
Abstract base class for atoms.
A list of constraints describing the closure of the region where the expression is finite.
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.
A map of variable to SciPy CSC sparse matrix or None.
Is the atom concave?
Is the atom log-log affine?
Is the atom log-log concave?
Is the atom log-log convex?
Is the composition non-increasing in argument idx?
Is the composition non-decreasing in argument idx?
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。