File: tests.R

package info (click to toggle)
r-cran-deoptim 2.2-8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 252 kB
  • sloc: ansic: 431; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 519 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
library(DEoptim)

# Tests for partial argument matching (#2)
# 'p' matched 'params' (prior to ae82a815751f6c1eeaef4e51430df8fcef556af9)
# 'M' matched MARGIN
# 'F' matched FUN
RosenbrockPartialMatch <-
function(x, p, M, F)
{
  x1 <- x[1]
  x2 <- x[2]
  100 * (x2 - x1 * x1)^2 + (1 - x1)^2 
}
lower <- c(-10, -10)
upper <- -lower

set.seed(21)
deCtrl <- DEoptim.control(trace = FALSE, parallelType = "parallel")
deopt <- DEoptim(RosenbrockPartialMatch, lower, upper, deCtrl,
                 p = NULL, M = NULL, F = NULL)