From f1b63514cef2e9605811b5b7ff1c8d1a21a1a700 Mon Sep 17 00:00:00 2001 From: Royi Date: Tue, 31 Dec 2024 20:04:56 +0200 Subject: [PATCH 1/3] Add a Warning to Avoid Julia's Broadcatisng in Expressions Adding a warning to avoid using `.` in expressions. Related to https://github.com/jump-dev/Convex.jl/issues/716. --- docs/src/manual/types.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/manual/types.md b/docs/src/manual/types.md index 6987c8dc4..7d1137c64 100644 --- a/docs/src/manual/types.md +++ b/docs/src/manual/types.md @@ -84,6 +84,7 @@ solve!(problem, SCS.Optimizer) # Once the problem is solved, we can call evaluate() on expr: evaluate(expr) ``` +!!! warning Julia's broadcasting, using the `.` operator should be avoided. The expression `-log(1.0 .+ A * x)` will fail while `-log(1.0 + A * x)` will be correctly encoded. ## Constraints From aca60d6cd89872266b59cf36742b5278ba6c2dcc Mon Sep 17 00:00:00 2001 From: Royi Date: Tue, 31 Dec 2024 20:25:26 +0200 Subject: [PATCH 2/3] Update docs/src/manual/types.md Co-authored-by: Eric Hanson <5846501+ericphanson@users.noreply.github.com> --- docs/src/manual/types.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/src/manual/types.md b/docs/src/manual/types.md index 7d1137c64..9faea8420 100644 --- a/docs/src/manual/types.md +++ b/docs/src/manual/types.md @@ -84,7 +84,9 @@ solve!(problem, SCS.Optimizer) # Once the problem is solved, we can call evaluate() on expr: evaluate(expr) ``` -!!! warning Julia's broadcasting, using the `.` operator should be avoided. The expression `-log(1.0 .+ A * x)` will fail while `-log(1.0 + A * x)` will be correctly encoded. + +!!! warning + Julia's broadcasting, using the `.` operator should be avoided. The expression `-log(1.0 .+ A * x)` will fail while `-log(1.0 + A * x)` will be correctly encoded. ## Constraints From ae25d89264c252c449bbe5e7fd4777dafcad7fdb Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 2 Jan 2025 08:45:56 +1300 Subject: [PATCH 3/3] Update docs/src/manual/types.md --- docs/src/manual/types.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/src/manual/types.md b/docs/src/manual/types.md index 9faea8420..2180b10ef 100644 --- a/docs/src/manual/types.md +++ b/docs/src/manual/types.md @@ -86,7 +86,9 @@ evaluate(expr) ``` !!! warning - Julia's broadcasting, using the `.` operator should be avoided. The expression `-log(1.0 .+ A * x)` will fail while `-log(1.0 + A * x)` will be correctly encoded. + Avoid using Julia's broadcasting (the `.` operator). As an example, the + expression `-log(1.0 .+ A * x)` will fail while `-log(1.0 + A * x)` will + succeed. ## Constraints