Skip to content

Commit

Permalink
Merge pull request #160 from astamm/extra-arguments-hin
Browse files Browse the repository at this point in the history
Add propagation of extra arguments to inequality constraints
  • Loading branch information
astamm authored Jun 18, 2024
2 parents 68763bc + df74bfb commit b166950
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/auglag.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ auglag <- function(x0, fn, gr = NULL, lower = NULL, upper = NULL, hin = NULL,
"restate the inequality to be <=0. The ability to use the old ",
"behavior will be removed in a future release.")
.hin <- match.fun(hin)
hin <- function(x) -.hin(x) # change hin >= 0 to hin <= 0 !
hin <- function(x) -.hin(x, ...) # change hin >= 0 to hin <= 0 !
}
}
if (!dfree) {
Expand Down
2 changes: 1 addition & 1 deletion R/ccsaq.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ ccsaq <- function(x0, fn, gr = NULL, lower = NULL, upper = NULL, hin = NULL,
"restate the inequality to be <=0. The ability to use the old ",
"behavior will be removed in a future release.")
.hin <- match.fun(hin)
hin <- function(x) -.hin(x) # change hin >= 0 to hin <= 0 !
hin <- function(x) -.hin(x, ...) # change hin >= 0 to hin <= 0 !
}
if (is.null(hinjac)) {
hinjac <- function(x) nl.jacobian(x, hin)
Expand Down
2 changes: 1 addition & 1 deletion R/cobyla.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ cobyla <- function(x0, fn, lower = NULL, upper = NULL, hin = NULL,
"restate the inequality to be <=0. The ability to use the old ",
"behavior will be removed in a future release.")
.hin <- match.fun(hin)
hin <- function(x) -.hin(x) # change hin >= 0 to hin <= 0 !
hin <- function(x) -.hin(x, ...) # change hin >= 0 to hin <= 0 !
}
}

Expand Down
2 changes: 1 addition & 1 deletion R/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ isres <- function(x0, fn, lower, upper, hin = NULL, heq = NULL, maxeval = 10000,
"restate the inequality to be <=0. The ability to use the old ",
"behavior will be removed in a future release.")
.hin <- match.fun(hin)
hin <- function(x) -.hin(x) # change hin >= 0 to hin <= 0 !
hin <- function(x) -.hin(x, ...) # change hin >= 0 to hin <= 0 !
}
}

Expand Down
2 changes: 1 addition & 1 deletion R/mma.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ mma <- function(x0, fn, gr = NULL, lower = NULL, upper = NULL, hin = NULL,
"restate the inequality to be <=0. The ability to use the old ",
"behavior will be removed in a future release.")
.hin <- match.fun(hin)
hin <- function(x) -.hin(x) # change hin >= 0 to hin <= 0 !
hin <- function(x) -.hin(x, ...) # change hin >= 0 to hin <= 0 !
}
if (is.null(hinjac)) {
hinjac <- function(x) nl.jacobian(x, hin)
Expand Down
2 changes: 1 addition & 1 deletion R/slsqp.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ slsqp <- function(x0, fn, gr = NULL, lower = NULL, upper = NULL, hin = NULL,
"restate the inequality to be <=0. The ability to use the old ",
"behavior will be removed in a future release.")
.hin <- match.fun(hin)
hin <- function(x) -.hin(x) # change hin >= 0 to hin <= 0 !
hin <- function(x) -.hin(x, ...) # change hin >= 0 to hin <= 0 !
}

if (is.null(hinjac)) {
Expand Down

0 comments on commit b166950

Please sign in to comment.