Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/atoms/elementwise/square.R
#####
## CVXPY SOURCE: atoms/elementwise/square.py
## Square -- convenience wrapper for power(x, 2)
#' Square of an expression: x^2
#'
#' @param x An Expression
#' @returns A `PowerApprox` atom with p=2, the same atom `power(x, 2)` builds
#' @export
square <- function(x) {
## CVXPY SOURCE: square.py:20-22 -- `return power(x, 2)`, i.e. the FACTORY,
## which yields PowerApprox (measured against CVXPY 1.9.2). This used to
## call `Power(x, 2)` -- the exact class -- and that divergence is visible
## in solver selection: exact `Power` is in CVXPY's POWCONE_ATOMS
## (atoms/__init__.py:130), so a squared term inside a constraint reported a
## required PowCone3D cone and locked out every MISOCP-capable solver that
## has no power cone (SCIP, CPLEX, Gurobi). CVXPY reports {Zero, NonNeg,
## SOC} for the same problem. For p = 2 both classes canonicalize to the
## same SOC, so this changes classification, not the cone program.
power(x, 2)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.