tests/simpleTest.R

library(RcppNLoptExample)

expected <- c(0.3333333, 0.2962963)

val <- testConstrainedProblem("MMA")
stopifnot(all.equal(val, expected, tolerance=1e-5))

## expected slight difference in parameters hence tolerance set lower
val <- testConstrainedProblem("COBYLA")
stopifnot(all.equal(val, expected, tolerance=1e-3))

Try the RcppNLoptExample package in your browser

Any scripts or data that you put into this service are public.

RcppNLoptExample documentation built on May 2, 2019, 5:56 a.m.