Limited Memory BFGS Minimizer with Bounds on Parameters with optim() 'C' Interface
Overview
Interfacing to Nocedal et al. L-BFGS-B.3.0 (See http://users.iems.northwestern.edu/~nocedal/lbfgsb.html) limited memory BFGS minimizer with bounds on parameters. This is a fork of 'lbfgsb3'. This registers a 'R' compatible 'C' interface to L-BFGS-B.3.0 that uses the same function types and optimization as the optim() function (see writing 'R' extensions and source for details). This package also adds more stopping criteria as well as allowing the adjustment of more tolerances.
- Added a thread-safe C++ port of the L-BFGS-B 3.0 Fortran code (the Fortran is kept and remains the default). It keeps no shared mutable state and does not call the R API, so independent problems can be solved concurrently (for example as an inner optimizer in an OpenMP loop). The port reproduces the Fortran results exactly. Its workspace is allocated once per thread and reused (zeroed per run), so memory scales with the number of threads, not the number of optimizations.
- The C++ port is available from C/C++ as
lbfgsb3Cts(the second element of.lbfgsb3cPtr(), set up byiniLbfgsb3inlbfgsb3ptr.h) and from R withlbfgsb3c(..., control = list(engine = "cpp")).
Show all changes in 2026-3.5Hide the rest of the changes in 2026-3.5
lbfgsb3C_no longer stores its$inforesult in a global R list.lmmis now validated.lbfgsb3c()errors unless it is a whole number >= 1; the C entry points returnfail = 29("ERROR: INVALID LMM") instead of dividing by zero (lmm <= 0) or overflowing the workspace size (very largelmm).n <= 0returnsfail = 13before any work arrays are allocated.- Nested
lbfgsb3c()calls (an objective that runs its own optimization) now work: the R callbacks are kept per call instead of in globals that the inner call overwrote. A gradient of the wrong length is now an error instead of a read past its end. - Added
src/Makevars(OpenMP for the internal thread-safety test helper, and explicit$(FLIBS)). - Removed the unused
timer.f(itscpu_timecall left an unresolved symbol with flang 21+), and the vignette no longer callspkgbuild::compile_dll()(it failed when checked outside the source tree). control$reltolis now checked for length one (the check testedabstolinstead, so an emptyreltolwas read out of bounds).
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-03-10
Documentation
- Help pages
- 2
- Examples that run
- 100%2 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 50%
- lbfgsb3c-nocompile HTML
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 36
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
8 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/nlmixr2/lbfgsb3c on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-06 · The repository has a site deploy workflow
pkgdown site last built 2026-10-06
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-08-27Pull request it wrote: opened by a project memberCommits: at least 1 crediting it in the message
- Claude Opus 51 commit · Aug 2026
Dependencies
Installing lbfgsb3c adds 3 packages (2 with compiled code, 2.9 MB of source tarballs). Heaviest: Rcpp 1.8 MB, RcppArmadillo 1.0 MB, numDeriv 74 KB.
Show all 14 packagesHide all 14 packages
Code & Tests
People & History
Show 3 peopleHide 3 people
Pick two releases to compare their code metrics.
- 2026-3.5Latest2026-10-06 · current release · diff ↗ ·
listed once in CRAN's queue
Seen in one reading of CRAN's incoming queue, at 2026-10-06 15:36 UTC, so it stayed less than the time between readings. - RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 2024-3.5
- RR 4.4.0 released · 2024-04-24
- 2024-3.42024-04-04 · diff ↗
- 2024-3.32024-04-01 · diff ↗
- 2020-3.32023-11-28 · diff ↗
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- 2020-3.22020-03-03 · diff ↗
- 2020-2.32020-02-10 · diff ↗
- 2019-11.26
- RR 3.6.0 released · 2019-04-26
Package metadata
- First published
- 2018-10-19
- Total releases
- 10 / 8 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 3.6
- Download size
- 143 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("lbfgsb3c")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.