power function

Elementwise Power

Elementwise Power

Raises each element of the input to the power pp. If expr is a CVXR expression, then expr^p is equivalent to power(expr,p). methods

## 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 p.

Details

For p=0p = 0 and f(x)=1f(x) = 1, this function is constant and positive. For p=1p = 1 and f(x)=xf(x) = x, this function is affine, increasing, and the same sign as xx. For p=2,4,8,p = 2,4,8,\ldots and f(x)=xpf(x) = |x|^p, this function is convex, positive, with signed monotonicity. For p<0p < 0 and f(x)=f(x) =

  • xpx^p: for x>0x > 0
  • ++\infty: x0x \leq 0

, this function is convex, decreasing, and positive. For 0<p<10 < p < 1 and f(x)=f(x) =

  • xpx^p: for x0x \geq 0
  • -\infty: x<0x < 0

, this function is concave, increasing, and positivea. For p>1,p2,4,8,p > 1, p \neq 2,4,8,\ldots and f(x)=f(x) =

  • xpx^p: for x0x \geq 0
  • ++\infty: x<0x < 0

, 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)
  • Maintainer: Anqi Fu
  • License: Apache License 2.0 | file LICENSE
  • Last published: 2024-11-07