Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

CVXR (version 1.0)

harmonic_mean: Harmonic Mean

Description

The harmonic mean, (1ni=1nxi1)1. For a matrix, the function is applied over all entries.

Usage

harmonic_mean(x)

Arguments

x

An '>Expression, vector, or matrix.

Value

An '>Expression representing the harmonic mean of the input.

Examples

Run this code
# NOT RUN {
x <- Variable()
prob <- Problem(Maximize(harmonic_mean(x)), list(x >= 0, x <= 5))
result <- solve(prob)
result$value
result$getValue(x)
# }

Run the code above in your browser using DataLab