Skip to content

Commit

Permalink
fix problem and add check for print.level
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@342 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
maechler committed Dec 2, 1997
1 parent 06c3bc5 commit 723d4ff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/library/base/R/nlm
Expand Up @@ -4,9 +4,11 @@ function(f, p, hessian=FALSE, typsize=rep(1,length(p)),
stepmax=max(1000 * sqrt(sum((p/typsize)^2)), 1000),
steptol=1e-6, iterlim=100)
{
if(0 == print.level <- as.integer(print.level)) msg <- 9
else if(print.level == 1) msg <- 1
else if(print.level == 2) msg <- 17

print.level <- as.integer(print.level)
if(print.level < 0 || print.level > 2)
stop("`print.level' must be in {0,1,2}")
msg <- c(9,1,17)[1+print.level]
.Internal(nlm(f, p, hessian, typsize, fscale, msg, ndigit, gradtol,
stepmax, steptol, iterlim))
}
Expand Down

0 comments on commit 723d4ff

Please sign in to comment.