gpflash 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. gpflash-0.2.0/.clang-format +13 -0
  2. gpflash-0.2.0/.github/workflows/ci.yml +55 -0
  3. gpflash-0.2.0/.github/workflows/wheels.yml +145 -0
  4. gpflash-0.2.0/.gitignore +15 -0
  5. gpflash-0.2.0/CHANGELOG.md +35 -0
  6. gpflash-0.2.0/CITATION.cff +33 -0
  7. gpflash-0.2.0/CMakeLists.txt +131 -0
  8. gpflash-0.2.0/LICENSE +202 -0
  9. gpflash-0.2.0/NOTICE +2 -0
  10. gpflash-0.2.0/PKG-INFO +179 -0
  11. gpflash-0.2.0/README.md +329 -0
  12. gpflash-0.2.0/THIRD-PARTY-NOTICES +24 -0
  13. gpflash-0.2.0/cmake/GpFlashConfig.cmake.in +32 -0
  14. gpflash-0.2.0/cmake/GpFlashDependencies.cmake +59 -0
  15. gpflash-0.2.0/include/gpflash/Version.hpp +28 -0
  16. gpflash-0.2.0/include/gpflash/assembly/CholTerms.hpp +75 -0
  17. gpflash-0.2.0/include/gpflash/assembly/EtaTermHpGrad.hpp +27 -0
  18. gpflash-0.2.0/include/gpflash/assembly/KernTermHpGrad.hpp +43 -0
  19. gpflash-0.2.0/include/gpflash/assembly/KernelAssembly.hpp +144 -0
  20. gpflash-0.2.0/include/gpflash/assembly/KernelMatrix.hpp +95 -0
  21. gpflash-0.2.0/include/gpflash/assembly/KernelMatrixGrad.hpp +182 -0
  22. gpflash-0.2.0/include/gpflash/assembly/KmatNuggetGrad.hpp +160 -0
  23. gpflash-0.2.0/include/gpflash/assembly/PosteriorCovariance.hpp +111 -0
  24. gpflash-0.2.0/include/gpflash/assembly/SigmaGrad.hpp +62 -0
  25. gpflash-0.2.0/include/gpflash/assembly/SigmaMatrix.hpp +66 -0
  26. gpflash-0.2.0/include/gpflash/assembly/SymmetryMatrix.hpp +376 -0
  27. gpflash-0.2.0/include/gpflash/core/Errors.hpp +318 -0
  28. gpflash-0.2.0/include/gpflash/core/NoiseModel.hpp +25 -0
  29. gpflash-0.2.0/include/gpflash/core/ParallelContext.hpp +138 -0
  30. gpflash-0.2.0/include/gpflash/core/Platform.hpp +141 -0
  31. gpflash-0.2.0/include/gpflash/core/StringFormat.hpp +42 -0
  32. gpflash-0.2.0/include/gpflash/inputs/EigMaxUbMethod.hpp +35 -0
  33. gpflash-0.2.0/include/gpflash/inputs/HpVal.hpp +71 -0
  34. gpflash-0.2.0/include/gpflash/inputs/KernelId.hpp +33 -0
  35. gpflash-0.2.0/include/gpflash/inputs/ModelOptions.hpp +68 -0
  36. gpflash-0.2.0/include/gpflash/inputs/SymmetrySpec.hpp +110 -0
  37. gpflash-0.2.0/include/gpflash/inputs/TrainingData.hpp +78 -0
  38. gpflash-0.2.0/include/gpflash/kernels/HpGradInputs.hpp +95 -0
  39. gpflash-0.2.0/include/gpflash/kernels/KernelBase.hpp +301 -0
  40. gpflash-0.2.0/include/gpflash/kernels/KernelDispatch.hpp +64 -0
  41. gpflash-0.2.0/include/gpflash/kernels/KernelStationary.hpp +106 -0
  42. gpflash-0.2.0/include/gpflash/kernels/OptzSeeding.hpp +55 -0
  43. gpflash-0.2.0/include/gpflash/kernels/inner_product/KernelInnerProduct.hpp +222 -0
  44. gpflash-0.2.0/include/gpflash/kernels/inner_product/Linear.hpp +65 -0
  45. gpflash-0.2.0/include/gpflash/kernels/inner_product/Quadratic.hpp +65 -0
  46. gpflash-0.2.0/include/gpflash/kernels/radial/KernelRadial.hpp +235 -0
  47. gpflash-0.2.0/include/gpflash/kernels/radial/Matern32.hpp +70 -0
  48. gpflash-0.2.0/include/gpflash/kernels/radial/Matern52.hpp +79 -0
  49. gpflash-0.2.0/include/gpflash/kernels/radial/RatQuad.hpp +154 -0
  50. gpflash-0.2.0/include/gpflash/kernels/radial/SqExp.hpp +59 -0
  51. gpflash-0.2.0/include/gpflash/kernels/stationary/Periodic.hpp +362 -0
  52. gpflash-0.2.0/include/gpflash/linear_algebra/BlasLapack.hpp +268 -0
  53. gpflash-0.2.0/include/gpflash/linear_algebra/Cholesky.hpp +104 -0
  54. gpflash-0.2.0/include/gpflash/linear_algebra/InnerProducts.hpp +146 -0
  55. gpflash-0.2.0/include/gpflash/linear_algebra/RecursiveInv.hpp +134 -0
  56. gpflash-0.2.0/include/gpflash/mean/MeanModel.hpp +289 -0
  57. gpflash-0.2.0/include/gpflash/mean/MeanModelWeights.hpp +112 -0
  58. gpflash-0.2.0/include/gpflash/optimization/HpOptimizer.hpp +230 -0
  59. gpflash-0.2.0/include/gpflash/optimization/MllOptzObjective.hpp +139 -0
  60. gpflash-0.2.0/include/gpflash/optimization/MllOptzResult.hpp +110 -0
  61. gpflash-0.2.0/include/gpflash/optimization/MultistartReport.hpp +290 -0
  62. gpflash-0.2.0/include/gpflash/optimization/README.md +144 -0
  63. gpflash-0.2.0/include/gpflash/optimization/local_optz/LocalOptzResult.hpp +73 -0
  64. gpflash-0.2.0/include/gpflash/optimization/local_optz/OptimizerNlopt.hpp +167 -0
  65. gpflash-0.2.0/include/gpflash/optimization/multistart/LatinHypercube.hpp +81 -0
  66. gpflash-0.2.0/include/gpflash/optimization/multistart/MultistartResult.hpp +167 -0
  67. gpflash-0.2.0/include/gpflash/optimization/multistart/OptimumClusters.hpp +106 -0
  68. gpflash-0.2.0/include/gpflash/optimization/multistart/RunMultistart.hpp +277 -0
  69. gpflash-0.2.0/include/gpflash/optimization/search_space/ActiveBounds.hpp +82 -0
  70. gpflash-0.2.0/include/gpflash/optimization/search_space/HpAtBound.hpp +106 -0
  71. gpflash-0.2.0/include/gpflash/optimization/search_space/HpOptzLayout.hpp +198 -0
  72. gpflash-0.2.0/include/gpflash/optimization/search_space/OptzOptions.hpp +176 -0
  73. gpflash-0.2.0/include/gpflash/optimization/search_space/OptzRegion.hpp +293 -0
  74. gpflash-0.2.0/include/gpflash/posterior_build/PosteriorBuild.hpp +190 -0
  75. gpflash-0.2.0/include/gpflash/posterior_cache/CacheInfo.hpp +165 -0
  76. gpflash-0.2.0/include/gpflash/posterior_cache/CacheInputHash.hpp +144 -0
  77. gpflash-0.2.0/include/gpflash/posterior_cache/CacheLayout.hpp +325 -0
  78. gpflash-0.2.0/include/gpflash/posterior_cache/Hdf5Store.hpp +167 -0
  79. gpflash-0.2.0/include/gpflash/posterior_cache/PosteriorCache.hpp +210 -0
  80. gpflash-0.2.0/include/gpflash/posterior_cache/PosteriorContents.hpp +28 -0
  81. gpflash-0.2.0/include/gpflash/posterior_cache/PosteriorModelInfo.hpp +84 -0
  82. gpflash-0.2.0/include/gpflash/posterior_cache/PosteriorPrecompute.hpp +112 -0
  83. gpflash-0.2.0/include/gpflash/posterior_cache/README.md +69 -0
  84. gpflash-0.2.0/include/gpflash/posterior_eval/GpPosterior.hpp +109 -0
  85. gpflash-0.2.0/include/gpflash/posterior_eval/PosteriorEval.hpp +113 -0
  86. gpflash-0.2.0/include/gpflash/posterior_eval/PosteriorGrad.hpp +272 -0
  87. gpflash-0.2.0/include/gpflash/posterior_eval/PosteriorOptions.hpp +34 -0
  88. gpflash-0.2.0/include/gpflash/posterior_eval/PosteriorQuery.hpp +261 -0
  89. gpflash-0.2.0/include/gpflash/posterior_eval/PosteriorResult.hpp +44 -0
  90. gpflash-0.2.0/include/gpflash/preconditioning/ConditionedCholesky.hpp +242 -0
  91. gpflash-0.2.0/include/gpflash/preconditioning/EtaTerms.hpp +52 -0
  92. gpflash-0.2.0/include/gpflash/preconditioning/PreconScales.hpp +36 -0
  93. gpflash-0.2.0/include/gpflash/training/EvalMll.hpp +311 -0
  94. gpflash-0.2.0/include/gpflash/training/EvalMllDispatch.hpp +105 -0
  95. gpflash-0.2.0/include/gpflash/training/EvalMllGrad.hpp +149 -0
  96. gpflash-0.2.0/include/gpflash/training/EvalVariances.hpp +31 -0
  97. gpflash-0.2.0/include/gpflash/training/MllHpGrad.hpp +37 -0
  98. gpflash-0.2.0/include/gpflash/training/MllResult.hpp +52 -0
  99. gpflash-0.2.0/include/gpflash/training/StageTiming.hpp +64 -0
  100. gpflash-0.2.0/pyproject.toml +93 -0
  101. gpflash-0.2.0/python/CMakeLists.txt +19 -0
  102. gpflash-0.2.0/python/LICENSES_bundled.txt +880 -0
  103. gpflash-0.2.0/python/README.md +145 -0
  104. gpflash-0.2.0/python/ci/install_deps_unix.sh +147 -0
  105. gpflash-0.2.0/python/ci/install_deps_windows.ps1 +123 -0
  106. gpflash-0.2.0/python/gpflash/__init__.py +105 -0
  107. gpflash-0.2.0/python/gpflash/_core.pyi +917 -0
  108. gpflash-0.2.0/python/gpflash/_gp.py +218 -0
  109. gpflash-0.2.0/python/gpflash/py.typed +0 -0
  110. gpflash-0.2.0/python/src/bindings.cpp +610 -0
  111. gpflash-0.2.0/python/tests/test_core.py +100 -0
  112. gpflash-0.2.0/python/tests/test_diagnostics.py +118 -0
  113. gpflash-0.2.0/python/tests/test_gaussian_process.py +181 -0
  114. gpflash-0.2.0/python/tests/test_numerics.py +154 -0
  115. gpflash-0.2.0/tst/CMakeLists.txt +175 -0
  116. gpflash-0.2.0/tst/GpFlashTestSupport.hpp +277 -0
  117. gpflash-0.2.0/tst/check_formatting.cmake +53 -0
  118. gpflash-0.2.0/tst/check_prediction_only_includes.cmake +84 -0
  119. gpflash-0.2.0/tst/test_gpflash_cache.cpp +1536 -0
  120. gpflash-0.2.0/tst/test_gpflash_chol_solves.cpp +405 -0
  121. gpflash-0.2.0/tst/test_gpflash_inner_product_gradient.cpp +115 -0
  122. gpflash-0.2.0/tst/test_gpflash_input_validation.cpp +952 -0
  123. gpflash-0.2.0/tst/test_gpflash_kernel_assembly.cpp +256 -0
  124. gpflash-0.2.0/tst/test_gpflash_kernel_center.cpp +370 -0
  125. gpflash-0.2.0/tst/test_gpflash_kernel_contract.cpp +236 -0
  126. gpflash-0.2.0/tst/test_gpflash_kernel_finite_difference.cpp +409 -0
  127. gpflash-0.2.0/tst/test_gpflash_kernel_matrix_grad.cpp +255 -0
  128. gpflash-0.2.0/tst/test_gpflash_kernel_posterior_assembly.cpp +218 -0
  129. gpflash-0.2.0/tst/test_gpflash_kmat_nugget.cpp +424 -0
  130. gpflash-0.2.0/tst/test_gpflash_kmat_nugget_grad.cpp +235 -0
  131. gpflash-0.2.0/tst/test_gpflash_linear.cpp +461 -0
  132. gpflash-0.2.0/tst/test_gpflash_local_optz.cpp +238 -0
  133. gpflash-0.2.0/tst/test_gpflash_multistart.cpp +379 -0
  134. gpflash-0.2.0/tst/test_gpflash_multistart_report.cpp +614 -0
  135. gpflash-0.2.0/tst/test_gpflash_optimizer.cpp +947 -0
  136. gpflash-0.2.0/tst/test_gpflash_optimizer_mpi.cpp +528 -0
  137. gpflash-0.2.0/tst/test_gpflash_optimizer_periodic.cpp +328 -0
  138. gpflash-0.2.0/tst/test_gpflash_periodic.cpp +158 -0
  139. gpflash-0.2.0/tst/test_gpflash_posterior.cpp +651 -0
  140. gpflash-0.2.0/tst/test_gpflash_posterior_nonradial.cpp +288 -0
  141. gpflash-0.2.0/tst/test_gpflash_recursive_inv.cpp +174 -0
  142. gpflash-0.2.0/tst/test_gpflash_search_space.cpp +380 -0
  143. gpflash-0.2.0/tst/test_gpflash_sigma_matrix.cpp +238 -0
  144. gpflash-0.2.0/tst/test_gpflash_stage_timing.cpp +99 -0
  145. gpflash-0.2.0/tst/test_gpflash_string_format.cpp +47 -0
  146. gpflash-0.2.0/tst/test_gpflash_struct_checks.cpp +828 -0
  147. gpflash-0.2.0/tst/test_gpflash_symmetry.cpp +984 -0
  148. gpflash-0.2.0/tst/test_gpflash_training.cpp +1127 -0
  149. gpflash-0.2.0/tst/test_gpflash_version.cpp +53 -0
@@ -0,0 +1,13 @@
1
+ ---
2
+ Language: Cpp
3
+ BasedOnStyle: Google
4
+ ColumnLimit: 120
5
+ IndentWidth: 4
6
+ BinPackArguments: false
7
+ BinPackParameters: false
8
+ ConstructorInitializerIndentWidth: 8
9
+ ContinuationIndentWidth: 8
10
+ AlignAfterOpenBracket: AlwaysBreak
11
+ AlignOperands: false
12
+ BreakBeforeBinaryOperators: NonAssignment
13
+ IncludeBlocks: Preserve
@@ -0,0 +1,55 @@
1
+ # Builds the C++ library and runs its tests (ctest) on Linux and macOS, after every push to main.
2
+ #
3
+ # Linux installs everything the tests can use, so it runs the full suite: the formatting check with clang-format 15
4
+ # and the MPI optimizer test with MPICH. macOS runs the rest, with Apple clang and Homebrew's libraries, as the README's
5
+ # macOS build does. A manual run (workflow_dispatch) tests any branch on request.
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches: [main]
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ build_and_test:
18
+ name: ${{ matrix.name }}
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ include:
24
+ - name: Linux (GCC)
25
+ os: ubuntu-24.04
26
+ - name: macOS (Apple clang)
27
+ os: macos-15
28
+ steps:
29
+ - uses: actions/checkout@v7.0.1
30
+
31
+ - name: Install dependencies (Linux)
32
+ if: runner.os == 'Linux'
33
+ run: |
34
+ sudo apt-get update
35
+ sudo apt-get install -y cmake g++ libarmadillo-dev libopenblas-dev libhdf5-dev libnlopt-cxx-dev \
36
+ clang-format-15 mpich libmpich-dev
37
+
38
+ - name: Install dependencies (macOS)
39
+ if: runner.os == 'macOS'
40
+ run: brew install armadillo libomp hdf5 nlopt
41
+
42
+ - name: Configure (Linux)
43
+ if: runner.os == 'Linux'
44
+ run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
45
+
46
+ # The MPI test runs on Linux only: the macOS runner has too few cores for its 4 processes.
47
+ - name: Configure (macOS)
48
+ if: runner.os == 'macOS'
49
+ run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DOpenMP_ROOT="$(brew --prefix libomp)" -DGPFLASH_BUILD_MPI_TEST=OFF
50
+
51
+ - name: Build
52
+ run: cmake --build build --parallel
53
+
54
+ - name: Test
55
+ run: ctest --test-dir build --output-on-failure
@@ -0,0 +1,145 @@
1
+ # Builds the Python wheels and sdist and tests each wheel, after every push to main, and publishes to PyPI when a
2
+ # GitHub release is published. A manual run (workflow_dispatch) tests any branch, and can publish to TestPyPI to try a
3
+ # release first. Pull requests do not run it: a run takes several hundred billed minutes on a private repository.
4
+ #
5
+ # Publishing uses PyPI trusted publishing: no token is stored. Before the first release, add this repository and
6
+ # workflow (wheels.yml, environment "pypi") as a trusted publisher on the PyPI project, and likewise on TestPyPI with
7
+ # environment "testpypi". Publishing runs only in the public repository, where the trusted publishers point.
8
+ name: Wheels
9
+
10
+ on:
11
+ push:
12
+ branches: [main]
13
+ release:
14
+ types: [published]
15
+ workflow_dispatch:
16
+ inputs:
17
+ platforms:
18
+ description: "Which platforms to build wheels for"
19
+ type: choice
20
+ options: [all, linux, macos, windows]
21
+ default: all
22
+ publish_to_testpypi:
23
+ description: "Publish the built distributions to TestPyPI (needs every platform)"
24
+ type: boolean
25
+ default: false
26
+
27
+ permissions:
28
+ contents: read
29
+
30
+ jobs:
31
+ # The runners, one per wheel platform: Linux x86_64 and aarch64 (native), macOS arm64 and x86_64, Windows x64. A
32
+ # manual run can keep one platform, so a fix for it costs one runner rather than five.
33
+ plan:
34
+ name: Choose platforms
35
+ runs-on: ubuntu-24.04
36
+ outputs:
37
+ include: ${{ steps.pick.outputs.include }}
38
+ steps:
39
+ - id: pick
40
+ env:
41
+ PLATFORMS: ${{ inputs.platforms || 'all' }}
42
+ run: |
43
+ runners='[
44
+ {"platform": "linux", "os": "ubuntu-24.04"},
45
+ {"platform": "linux", "os": "ubuntu-24.04-arm"},
46
+ {"platform": "macos", "os": "macos-15", "macos_deployment_target": "15.0"},
47
+ {"platform": "macos", "os": "macos-15-intel", "macos_deployment_target": "15.0"},
48
+ {"platform": "windows", "os": "windows-2025"}
49
+ ]'
50
+ include=$(jq -c --arg p "$PLATFORMS" '[.[] | select($p == "all" or .platform == $p)]' <<< "$runners")
51
+ echo "include=$include" >> "$GITHUB_OUTPUT"
52
+
53
+ build_wheels:
54
+ name: Wheels on ${{ matrix.os }}
55
+ needs: plan
56
+ runs-on: ${{ matrix.os }}
57
+ strategy:
58
+ fail-fast: false
59
+ matrix:
60
+ include: ${{ fromJSON(needs.plan.outputs.include) }}
61
+ steps:
62
+ - uses: actions/checkout@v7.0.1
63
+ # Windows builds its libraries from source, OpenBLAS alone taking almost two hours, so they are cached, keyed on
64
+ # the script that builds them. The script reuses a restored install, and only a complete one is saved.
65
+ - name: Restore Windows libraries
66
+ id: windows_deps
67
+ if: runner.os == 'Windows'
68
+ uses: actions/cache/restore@v6.1.0
69
+ with:
70
+ path: C:\gpflash_deps
71
+ key: windows-deps-${{ hashFiles('python/ci/install_deps_windows.ps1') }}
72
+ - uses: pypa/cibuildwheel@v4.2.1
73
+ env:
74
+ # The oldest macOS the wheel runs on. It must not be older than the Homebrew libraries delocate bundles,
75
+ # which are built for the runner's own macOS.
76
+ MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_deployment_target }}
77
+ - name: Check Windows libraries
78
+ id: windows_deps_check
79
+ if: always() && runner.os == 'Windows' && steps.windows_deps.outputs.cache-hit != 'true'
80
+ shell: pwsh
81
+ run: if (Test-Path C:\gpflash_deps\gpflash_deps_complete) { "complete=true" >> $env:GITHUB_OUTPUT }
82
+ - name: Save Windows libraries
83
+ if: always() && steps.windows_deps_check.outputs.complete == 'true'
84
+ uses: actions/cache/save@v6.1.0
85
+ with:
86
+ path: C:\gpflash_deps
87
+ key: windows-deps-${{ hashFiles('python/ci/install_deps_windows.ps1') }}
88
+ - uses: actions/upload-artifact@v7.0.1
89
+ with:
90
+ name: wheels-${{ matrix.os }}
91
+ path: ./wheelhouse/*.whl
92
+
93
+ build_sdist:
94
+ name: Source distribution
95
+ runs-on: ubuntu-24.04
96
+ steps:
97
+ - uses: actions/checkout@v7.0.1
98
+ - uses: actions/setup-python@v7.0.0
99
+ with:
100
+ python-version: "3.13"
101
+ - run: python -m pip install build
102
+ - run: python -m build --sdist
103
+ - uses: actions/upload-artifact@v7.0.1
104
+ with:
105
+ name: sdist
106
+ path: dist/*.tar.gz
107
+
108
+ publish_pypi:
109
+ name: Publish to PyPI
110
+ needs: [build_wheels, build_sdist]
111
+ if: github.repository == 'marchildon/gpflash' && github.event_name == 'release' && github.event.action == 'published'
112
+ runs-on: ubuntu-24.04
113
+ environment:
114
+ name: pypi
115
+ url: https://pypi.org/p/gpflash
116
+ permissions:
117
+ id-token: write
118
+ steps:
119
+ - uses: actions/download-artifact@v8.0.1
120
+ with:
121
+ path: dist
122
+ merge-multiple: true
123
+ - uses: pypa/gh-action-pypi-publish@v1.14.2
124
+ with:
125
+ skip-existing: true # a rerun after a partial upload skips what is already there
126
+
127
+ publish_testpypi:
128
+ name: Publish to TestPyPI
129
+ needs: [build_wheels, build_sdist]
130
+ if: github.repository == 'marchildon/gpflash' && github.event_name == 'workflow_dispatch' && inputs.publish_to_testpypi && inputs.platforms == 'all'
131
+ runs-on: ubuntu-24.04
132
+ environment:
133
+ name: testpypi
134
+ url: https://test.pypi.org/p/gpflash
135
+ permissions:
136
+ id-token: write
137
+ steps:
138
+ - uses: actions/download-artifact@v8.0.1
139
+ with:
140
+ path: dist
141
+ merge-multiple: true
142
+ - uses: pypa/gh-action-pypi-publish@v1.14.2
143
+ with:
144
+ repository-url: https://test.pypi.org/legacy/
145
+ skip-existing: true
@@ -0,0 +1,15 @@
1
+ # No trailing slash, so it also matches a `build` symlink; `build/` matches directories only.
2
+ /build
3
+
4
+ # Every other build directory, at any depth, such as tst/build or a builds/ tree.
5
+ **/build*/
6
+
7
+ # macOS Finder metadata.
8
+ .DS_Store
9
+
10
+ # Python: bytecode, test caches, and the sdist and wheels python -m build writes. build_python/, where pip builds
11
+ # the module, matches the build-directory rule above.
12
+ __pycache__/
13
+ .pytest_cache/
14
+ /dist/
15
+ *.egg-info/
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ Every release of GpFlash and what it changed. Version numbers follow
4
+ [semantic versioning](https://semver.org); before 1.0, a minor release may change the interface.
5
+
6
+ ## 0.2.0 (2026-10-17)
7
+
8
+ ### Added
9
+
10
+ - **Python package**, `pip install gpflash`, with wheels for Linux (x86_64, aarch64), macOS
11
+ (arm64, x86_64) and Windows (x64) on Python 3.11 to 3.14, every dependency included. It offers
12
+ a NumPy-style `GaussianProcess` (`fit`, `predict`, `predict_gradient`, `save`, `load`) and the
13
+ C++ interface under its C++ names. See [`python/README.md`](python/README.md).
14
+ - CMake option `GPFLASH_BUILD_PYTHON`, off by default, to build the Python module.
15
+ - Citation information for the GpFlash paper, [arXiv:2610.16861](https://arxiv.org/abs/2610.16861):
16
+ `CITATION.cff`, which gives the repository a "Cite this repository" button, and a BibTeX
17
+ entry in [`python/README.md`](python/README.md).
18
+ - Continuous integration: the C++ tests on Linux and macOS, and the Python wheels on every
19
+ platform, after each push to `main`.
20
+
21
+ ### Fixed
22
+
23
+ - A cache save that fails part way, as on a full disk, no longer leaves its file open in HDF5. HDF5 1.10
24
+ cannot close it, and the process may crash as it exits.
25
+
26
+ ### Changed
27
+
28
+ - The version is set in one place, `include/gpflash/Version.hpp`; CMake and the Python package
29
+ read it from there.
30
+
31
+ ## 0.1.0 (2026-10-12)
32
+
33
+ First release: a header-only C++14 library for exact Gaussian process regression, with the
34
+ marginal log likelihood and its analytic hyperparameter gradients, hyperparameter fitting
35
+ through NLopt, posterior mean and variance with their gradients, and an HDF5 posterior cache.
@@ -0,0 +1,33 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use GpFlash, please cite the paper below."
3
+ type: software
4
+ title: GpFlash
5
+ abstract: >-
6
+ Header-only C++ library for exact, dense Gaussian process regression: the marginal log
7
+ likelihood with analytic hyperparameter gradients, hyperparameter fitting, and posterior
8
+ mean and variance, with Python bindings.
9
+ authors:
10
+ - family-names: Marchildon
11
+ given-names: André
12
+ repository-code: "https://github.com/marchildon/gpflash"
13
+ license: Apache-2.0
14
+ keywords:
15
+ - gaussian-process
16
+ - kriging
17
+ - surrogate-model
18
+ - cpp
19
+ - python
20
+ preferred-citation:
21
+ type: article
22
+ title: "GpFlash: Maximizing Speed and Minimizing Memory for Gaussian Process Training and Prediction"
23
+ authors:
24
+ - family-names: Marchildon
25
+ given-names: André
26
+ year: 2026
27
+ month: 10
28
+ url: "https://arxiv.org/abs/2610.16861"
29
+ doi: 10.48550/arXiv.2610.16861
30
+ identifiers:
31
+ - type: other
32
+ value: "arXiv:2610.16861"
33
+ description: The arXiv preprint
@@ -0,0 +1,131 @@
1
+ # The package's one build: standalone, from a parent project's add_subdirectory, or by a build system that puts the
2
+ # dependencies on CMAKE_PREFIX_PATH.
3
+
4
+ cmake_minimum_required(VERSION 3.22)
5
+
6
+ # The version is set once, in include/gpflash/Version.hpp; CMake and pyproject.toml both read it from there.
7
+ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/include/gpflash/Version.hpp _gpflash_version_hpp)
8
+ string(REGEX MATCH "MAJOR ([0-9]+)\n#define GPFLASH_VERSION_MINOR ([0-9]+)\n#define GPFLASH_VERSION_PATCH ([0-9]+)"
9
+ _ "${_gpflash_version_hpp}")
10
+ project(GpFlash VERSION ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3} LANGUAGES CXX)
11
+
12
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
13
+ # The package's own targets, the tests, compile as ISO C++14 (-std=c++14, not the compiler's gnu++14 default), so a
14
+ # GNU extension in a header fails here. Not exported: a consumer only inherits the cxx_std_14 floor below.
15
+ set(CMAKE_CXX_STANDARD 14)
16
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
17
+ set(CMAKE_CXX_EXTENSIONS OFF)
18
+
19
+ set(GPFLASH_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
20
+
21
+ # Only 64-bit targets have been built and tested. A 32-bit one should compile, ARMA_64BIT_WORD below keeping the
22
+ # element counts 64-bit, and run out of address space at roughly 10,000 training points.
23
+ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
24
+ message(WARNING "GpFlash is tested on 64-bit targets only; this one has ${CMAKE_SIZEOF_VOID_P}-byte pointers.")
25
+ endif()
26
+
27
+ include(GNUInstallDirs)
28
+ include(CMakePackageConfigHelpers)
29
+
30
+ # The vendor as FindBLAS spells it (OpenBLAS, Apple for Accelerate, Intel10_64lp for MKL, ...). The caller's
31
+ # BLA_VENDOR wins; otherwise Accelerate on Apple, which every Mac has, and OpenBLAS elsewhere.
32
+ if(DEFINED BLA_VENDOR)
33
+ set(GPFLASH_BLA_VENDOR "${BLA_VENDOR}")
34
+ elseif(DEFINED ENV{BLA_VENDOR})
35
+ set(GPFLASH_BLA_VENDOR "$ENV{BLA_VENDOR}")
36
+ elseif(APPLE)
37
+ set(GPFLASH_BLA_VENDOR Apple)
38
+ else()
39
+ set(GPFLASH_BLA_VENDOR OpenBLAS)
40
+ endif()
41
+
42
+ # ARMA_DONT_USE_WRAPPER binds BlasLapack.hpp's extern "C" prototypes straight to the linked library.
43
+ # ARMA_USE_BLAS and ARMA_USE_LAPACK let Armadillo's own operations call the same library.
44
+ # ARMA_DONT_USE_FORTRAN_HIDDEN_ARGS stays off: BlasLapack.hpp follows Armadillo's hidden-length setting, and a
45
+ # gfortran-built LAPACK needs the lengths (GCC bug 90329).
46
+ # ARMA_NO_DEBUG drops Armadillo's bounds checks; the library's own checks guard what reaches its loops.
47
+ # ARMA_USE_HDF5 selects the save path posterior_cache/ needs; a consumer compiling without it would get a different
48
+ # one that does not work.
49
+ # ARMA_64BIT_WORD is Armadillo's default on a 64-bit target, stated because an n_train by n_train buffer passes 2^31
50
+ # elements at n_train ~ 46,000. BlasLapack.hpp static_asserts it for a consumer compiling without these defines.
51
+ # The target's INTERFACE definitions below hand every one to consumers.
52
+ set(GPFLASH_ARMA_DEFS
53
+ ARMA_DONT_USE_WRAPPER
54
+ ARMA_NO_DEBUG
55
+ ARMA_USE_BLAS
56
+ ARMA_USE_LAPACK
57
+ ARMA_USE_HDF5
58
+ ARMA_64BIT_WORD)
59
+
60
+ # Platform.hpp's probe, decided here where the vendor is known; "All" leaves it to the header. Apple and NAS are
61
+ # FindBLAS's names for Accelerate.
62
+ if(GPFLASH_BLA_VENDOR MATCHES "^(Apple|NAS)$")
63
+ set(GPFLASH_PLATFORM_DEFS GPFLASH_BLAS_SKINNY_GEMV_IS_SLOW=1)
64
+ elseif(GPFLASH_BLA_VENDOR STREQUAL "All")
65
+ set(GPFLASH_PLATFORM_DEFS "")
66
+ else()
67
+ set(GPFLASH_PLATFORM_DEFS GPFLASH_BLAS_SKINNY_GEMV_IS_SLOW=0)
68
+ endif()
69
+
70
+ macro(gpflash_find_dependency)
71
+ find_package(${ARGV} REQUIRED)
72
+ endmacro()
73
+ include(cmake/GpFlashDependencies.cmake)
74
+
75
+ # Header-only, so an INTERFACE target: a consumer compiles every loop itself, with its own flags. The README's
76
+ # "Compiling the headers" section is the contract this target meets; a build not using it follows that section.
77
+ add_library(GpFlash INTERFACE)
78
+ # The installed name, so a parent project's add_subdirectory links the same target a find_package user does.
79
+ add_library(GpFlash::GpFlash ALIAS GpFlash)
80
+ target_include_directories(GpFlash INTERFACE
81
+ $<BUILD_INTERFACE:${GPFLASH_ROOT}/include>
82
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
83
+ target_compile_definitions(GpFlash INTERFACE ${GPFLASH_ARMA_DEFS} ${GPFLASH_PLATFORM_DEFS})
84
+
85
+ # A floor, not a pin.
86
+ target_compile_features(GpFlash INTERFACE cxx_std_14)
87
+
88
+ target_link_libraries(GpFlash INTERFACE
89
+ GpFlash::Armadillo
90
+ OpenMP::OpenMP_CXX
91
+ LAPACK::LAPACK
92
+ BLAS::BLAS
93
+ GpFlash::HDF5
94
+ GpFlash::NLopt)
95
+
96
+ install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.hpp")
97
+ install(FILES LICENSE NOTICE THIRD-PARTY-NOTICES DESTINATION ${CMAKE_INSTALL_DOCDIR})
98
+
99
+ # A consumer calls find_package(GpFlash) and links GpFlash::GpFlash. The package config finds the dependencies,
100
+ # then includes the targets file.
101
+ set(GPFLASH_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/GpFlash)
102
+ install(TARGETS GpFlash EXPORT GpFlash-export)
103
+ install(EXPORT GpFlash-export
104
+ NAMESPACE GpFlash::
105
+ DESTINATION ${GPFLASH_INSTALL_CMAKEDIR}
106
+ FILE GpFlashTargets.cmake)
107
+ configure_file(cmake/GpFlashConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/GpFlashConfig.cmake @ONLY)
108
+ # Before 1.0 a minor release may break the interface, so a request for 0.Y accepts only 0.Y.x.
109
+ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/GpFlashConfigVersion.cmake
110
+ COMPATIBILITY SameMinorVersion
111
+ ARCH_INDEPENDENT)
112
+ install(FILES
113
+ ${CMAKE_CURRENT_BINARY_DIR}/GpFlashConfig.cmake
114
+ ${CMAKE_CURRENT_BINARY_DIR}/GpFlashConfigVersion.cmake
115
+ cmake/GpFlashDependencies.cmake
116
+ DESTINATION ${GPFLASH_INSTALL_CMAKEDIR})
117
+
118
+ # The Python module gpflash._core: built when pip drives this file through scikit-build-core (pyproject.toml), which
119
+ # defines SKBUILD, or on request. A C++ consumer never needs Python.
120
+ option(GPFLASH_BUILD_PYTHON "Build the Python module gpflash._core" OFF)
121
+ if(GPFLASH_BUILD_PYTHON OR DEFINED SKBUILD)
122
+ add_subdirectory(python)
123
+ endif()
124
+
125
+ # Only for this project's own build: a parent project's add_subdirectory builds none of the tests.
126
+ if(PROJECT_IS_TOP_LEVEL)
127
+ include(CTest)
128
+ if(BUILD_TESTING)
129
+ add_subdirectory(tst)
130
+ endif()
131
+ endif()
gpflash-0.2.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
gpflash-0.2.0/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ GpFlash
2
+ Copyright 2026 André Marchildon