Changelog
Source:NEWS.md
xsdm 1.0.0
First public release.
Highlights
-
End-to-end C++ likelihood chain. The optimization hot path (
loglik_math,loglik_bio,log_prob_detect,math_to_bio,create_param_vector_masked,like_neg_ltsgr) is now driven entirely by C++ kernels via thin R wrappers. The pure-R reference implementations are preserved as non-exported*_rfunctions inR/internals.Rand used by the test suite to assert numerical parity attol = 1e-6. -
optimize_likelihood()andprofile_likelihood()driveucminfcpp::ucminfcpp_xptr()with a pure-C++ XPtr factory (make_loglik_math_xptr_cpp), so there are no R callbacks in the inner loop. - Parameter masking is fully integrated: any subset of the canonical parameter vector can be fixed during optimization, and the remaining free parameters are optimized end-to-end on the math scale.
-
Profile-likelihood name propagation fix.
profile_likelihood()now preserves free-parameter names across theucminfboundary, so profile rows are reliably labelled with the parameter being held fixed.
API changes
-
New canonical exported names (with thin C++ wrappers):
exported non-exported reference loglik_mathxsdm:::loglik_math_rloglik_bioxsdm:::loglik_bio_rlog_prob_detectxsdm:::log_prob_detect_rmath_to_bioxsdm:::math_to_bio_rcreate_param_vector_maskedxsdm:::create_param_vector_masked_rlike_neg_ltsgrxsdm:::like_neg_ltsgr_rdist_between_paramsxsdm:::dist_between_params_r like_neg_ltsgr_cppis no longer exported; it remains as an unexported back-compat alias (xsdm:::like_neg_ltsgr_cpp) that forwards tolike_neg_ltsgr. New code should calllike_neg_ltsgrdirectly.dist_between_params()is now backed by a pure-C++ implementation insrc/dist_between_params.cppthat builds the pairing cost matrix and solves the linear sum assignment problem via a clean-room Hungarian / Kuhn–Munkres routine (O(n^3) potentials variant from Kuhn 1955, Munkres 1957, Jonker & Volgenant 1987). No code is taken from thecluepackage, avoiding the GPL-2 / AGPL-3 licence mismatch. The pure-R referencexsdm:::dist_between_params_rcontinues to callclue::solve_LSAP()and is used by the parity tests intests/testthat/test-dist_between_params_r_vs_cpp.R. The legacy brute-force referencedistance_between_params()is also preserved (non-exported) asxsdm:::distance_between_params_r.
Validation & robustness
-
optimize_likelihood(),start_parms(), andget_start_parms_()now rejectnum_starts < 3early with an informativecheckmateerror, rather than crashing insidesobol::sobol_design()(which segfaults atnseq = 0and returns a malformed vector atnseq = 1). -
start_parms()runtime:sobol::sobol_designoutput is defensively coerced to adata.frame, protecting against future behaviour changes.
Build & packaging
-
terraandtibblemoved fromSuggests:toImports:. Both are used unconditionally in mainline package code (env_data_array(),habitat_suitability(),start_parms(),vsp()). -
src/*.hppheaders renamed tosrc/*.hto satisfyR CMD check’s “Subdirectory ‘src’ contains” warning. - New
R-CMD-check.yamlGitHub workflow runsR CMD check --as-cranon Ubuntu (release / devel / oldrel-1 / oldrel-2), Windows, and macOS. - Test suite: 1006 tests, full suite ~9s, all green; parity tests live under
tests/testthat/test-*_r_vs_cpp.R.
Internals
- All non-exported helpers (
check_env_array,logit,permutations,auto_plot_lims_, etc.) consolidated inR/internals.R. -
profile_likelihood()cleanly stops when the requested parameter is outside the masked design.