^,Expression,numeric-method {CVXR} | R Documentation |
Elementwise Power
Description
Raises each element of the input to the power .
If
expr
is a CVXR expression, then expr^p
is equivalent to power(expr,p)
.
Usage
## S4 method for signature 'Expression,numeric'
e1 ^ e2
power(x, p, max_denom = 1024)
Arguments
e1 |
An Expression object to exponentiate. |
e2 |
The power of the exponential. Must be a numeric scalar. |
x |
An Expression, vector, or matrix. |
p |
A scalar value indicating the exponential power. |
max_denom |
The maximum denominator considered in forming a rational approximation of |
Details
For and
, this function is constant and positive.
For
and
, this function is affine, increasing, and the same sign as
.
For
and
, this function is convex, positive, with signed monotonicity.
For
and
for
, this function is convex, decreasing, and positive.
For and
for
, this function is concave, increasing, and positivea.
For and
for
, this function is convex, increasing, and positive.
Examples
## Not run:
x <- Variable()
prob <- Problem(Minimize(power(x,1.7) + power(x,-2.3) - power(x,0.45)))
result <- solve(prob)
result$value
result$getValue(x)
## End(Not run)