| ^,Expression,numeric-method | R Documentation |
Raises each element of the input to the power p.
If expr is a CVXR expression, then expr^p is equivalent to power(expr,p).
## S4 method for signature 'Expression,numeric'
e1 ^ e2
power(x, p, max_denom = 1024)
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 |
For p = 0 and f(x) = 1, this function is constant and positive.
For p = 1 and f(x) = x, this function is affine, increasing, and the same sign as x.
For p = 2,4,8,\ldots and f(x) = |x|^p, this function is convex, positive, with signed monotonicity.
For p < 0 and f(x) =
x^p for x > 0
+\inftyx \leq 0
, this function is convex, decreasing, and positive.
For 0 < p < 1 and f(x) =
x^p for x \geq 0
-\inftyx < 0
, this function is concave, increasing, and positivea.
For p > 1, p \neq 2,4,8,\ldots and f(x) =
x^p for x \geq 0
+\inftyx < 0
, this function is convex, increasing, and positive.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.