Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/reformulations/log1p.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2014: Madeleine Udell and contributors
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file or at https://opensource.org/license/bsd-2-clause

Base.log1p(x::AbstractExpr) = log(1 + x)
14 changes: 14 additions & 0 deletions test/test_atoms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,20 @@ function test_inner_product()
return
end

### reformulations/log1p

function test_log1p()
target = """
variables: t, x
minobjective: 1.0 * t + 0.0
[1.0 * t, 1.0, 1.0 * x + 1.0] in ExponentialCone()
"""
_test_reformulation(target) do context
return log1p(Variable(1))
end
return
end

### reformulations/norm

function test_norm()
Expand Down
Loading