checksolver function

Test if requested solver is present

Test if requested solver is present

Test if requested solver is present. UTF-8

checksolver(method, allmeth, allpkg) checkallsolvers()

Arguments

  • method: Character string giving the name of the solver requested.
  • allmeth: Character vector giving the names of the methods optimr can use.
  • allpkg: Character vector giving the names of the packages where solvers are found.

Returns

If the solver defined by character string in method is available, then checksolver returns this string, else NULL.

checkallsolvers() returns a vector of strings that are the names of missing solvers, else NULL if all solvers specified in allmeth

are present where allmeth is returned from a call to ctrldefault(n)

where n is some integer.

Examples

allmeth <- c("Rvmmin", "nlminb","ipopttest") allpkg <- c("Rvmmin", "stats","ipoptr") print(checksolver("nlminb", allmeth, allpkg)) # If Rvmmin NOT available, get msg that PACKAGE not available. print(checksolver("Rvmmin", allmeth, allpkg)) # Get message that SOLVER not found print(checksolver("notasolver", allmeth, allpkg))
  • Maintainer: John C Nash
  • License: GPL-2
  • Last published: 2024-12-10