selinv 1.0.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 (86) hide show
  1. selinv-1.0.0/.gitignore +107 -0
  2. selinv-1.0.0/.gitlab-ci.yml +74 -0
  3. selinv-1.0.0/CHANGELOG.md +39 -0
  4. selinv-1.0.0/CMakeLists.txt +157 -0
  5. selinv-1.0.0/LICENSE +80 -0
  6. selinv-1.0.0/PKG-INFO +333 -0
  7. selinv-1.0.0/README.md +308 -0
  8. selinv-1.0.0/csrc/selinv_bind.cpp +503 -0
  9. selinv-1.0.0/csrc/selinv_interface.c +686 -0
  10. selinv-1.0.0/csrc/selinv_interface.h +224 -0
  11. selinv-1.0.0/csrc/selinv_pool.hpp +196 -0
  12. selinv-1.0.0/docs/api.md +42 -0
  13. selinv-1.0.0/docs/conf.py +85 -0
  14. selinv-1.0.0/docs/index.md +63 -0
  15. selinv-1.0.0/docs/install.md +98 -0
  16. selinv-1.0.0/docs/math.md +158 -0
  17. selinv-1.0.0/extern/selinv/C2Finterface.c +784 -0
  18. selinv-1.0.0/extern/selinv/assmb.f +76 -0
  19. selinv-1.0.0/extern/selinv/betree.f +82 -0
  20. selinv-1.0.0/extern/selinv/bfinit.f +61 -0
  21. selinv-1.0.0/extern/selinv/blkdinv.f +140 -0
  22. selinv-1.0.0/extern/selinv/blkfc2.f +319 -0
  23. selinv-1.0.0/extern/selinv/blkfct.f +163 -0
  24. selinv-1.0.0/extern/selinv/blkslv.f +110 -0
  25. selinv-1.0.0/extern/selinv/btree2.f +99 -0
  26. selinv-1.0.0/extern/selinv/chlsup.f +98 -0
  27. selinv-1.0.0/extern/selinv/chordr.f +85 -0
  28. selinv-1.0.0/extern/selinv/create.f +48 -0
  29. selinv-1.0.0/extern/selinv/dreadhb.f +47 -0
  30. selinv-1.0.0/extern/selinv/dscal.f +50 -0
  31. selinv-1.0.0/extern/selinv/dsymmv.f +82 -0
  32. selinv-1.0.0/extern/selinv/dumpL.f +51 -0
  33. selinv-1.0.0/extern/selinv/epost2.f +115 -0
  34. selinv-1.0.0/extern/selinv/etordr.f +84 -0
  35. selinv-1.0.0/extern/selinv/etpost.f +104 -0
  36. selinv-1.0.0/extern/selinv/etree.f +93 -0
  37. selinv-1.0.0/extern/selinv/fcnthn.f +237 -0
  38. selinv-1.0.0/extern/selinv/flo2ho.f +130 -0
  39. selinv-1.0.0/extern/selinv/fnsplt.f +137 -0
  40. selinv-1.0.0/extern/selinv/fntsiz.f +95 -0
  41. selinv-1.0.0/extern/selinv/fsup1.f +86 -0
  42. selinv-1.0.0/extern/selinv/fsup2.f +77 -0
  43. selinv-1.0.0/extern/selinv/genmmd.f +200 -0
  44. selinv-1.0.0/extern/selinv/getrhs.f +44 -0
  45. selinv-1.0.0/extern/selinv/gtimer.f +29 -0
  46. selinv-1.0.0/extern/selinv/igathr.f +52 -0
  47. selinv-1.0.0/extern/selinv/ilo2ho.f +118 -0
  48. selinv-1.0.0/extern/selinv/inpnv.f +84 -0
  49. selinv-1.0.0/extern/selinv/invinv.f +65 -0
  50. selinv-1.0.0/extern/selinv/ldindx.f +64 -0
  51. selinv-1.0.0/extern/selinv/lstats.f +90 -0
  52. selinv-1.0.0/extern/selinv/mmdelm.f +192 -0
  53. selinv-1.0.0/extern/selinv/mmdint.f +67 -0
  54. selinv-1.0.0/extern/selinv/mmdnum.f +98 -0
  55. selinv-1.0.0/extern/selinv/mmdupd.f +259 -0
  56. selinv-1.0.0/extern/selinv/mmpy.f +74 -0
  57. selinv-1.0.0/extern/selinv/mmpy1.f +92 -0
  58. selinv-1.0.0/extern/selinv/mmpy2.f +123 -0
  59. selinv-1.0.0/extern/selinv/mmpy4.f +168 -0
  60. selinv-1.0.0/extern/selinv/mmpy8.f +313 -0
  61. selinv-1.0.0/extern/selinv/mmpyi.f +76 -0
  62. selinv-1.0.0/extern/selinv/ordmmd.f +96 -0
  63. selinv-1.0.0/extern/selinv/ordnat.f +51 -0
  64. selinv-1.0.0/extern/selinv/pchol.f +99 -0
  65. selinv-1.0.0/extern/selinv/readmatrix.f +15 -0
  66. selinv-1.0.0/extern/selinv/readmatrixheader.f +10 -0
  67. selinv-1.0.0/extern/selinv/selinv.f +425 -0
  68. selinv-1.0.0/extern/selinv/sfinit.f +137 -0
  69. selinv-1.0.0/extern/selinv/smxpy1.f +66 -0
  70. selinv-1.0.0/extern/selinv/smxpy2.f +90 -0
  71. selinv-1.0.0/extern/selinv/smxpy4.f +134 -0
  72. selinv-1.0.0/extern/selinv/smxpy8.f +277 -0
  73. selinv-1.0.0/extern/selinv/symfc2.f +271 -0
  74. selinv-1.0.0/extern/selinv/symfct.f +109 -0
  75. selinv-1.0.0/pixi.lock +8105 -0
  76. selinv-1.0.0/pyproject.toml +212 -0
  77. selinv-1.0.0/src/selinv/__init__.py +355 -0
  78. selinv-1.0.0/src/selinv/_selinv_core.pyi +154 -0
  79. selinv-1.0.0/src/selinv/py.typed +0 -0
  80. selinv-1.0.0/tests/conftest.py +47 -0
  81. selinv-1.0.0/tests/helpers.py +144 -0
  82. selinv-1.0.0/tests/test_replicate.py +467 -0
  83. selinv-1.0.0/tests/test_selinv_diag.py +130 -0
  84. selinv-1.0.0/tests/test_selinvfull.py +494 -0
  85. selinv-1.0.0/tests/test_smoke.py +199 -0
  86. selinv-1.0.0/tests/test_thread_safety.py +111 -0
@@ -0,0 +1,107 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.pyc
6
+ *.pyo
7
+ *.pyd
8
+ .Python
9
+ *.egg
10
+ *.egg-info/
11
+ dist/
12
+ build/
13
+ eggs/
14
+ parts/
15
+ var/
16
+ sdist/
17
+ develop-eggs/
18
+ .installed.cfg
19
+ lib/
20
+ lib64/
21
+ MANIFEST
22
+
23
+ # Virtual environments
24
+ .env
25
+ .venv
26
+ env/
27
+ venv/
28
+ ENV/
29
+ env.bak/
30
+ venv.bak/
31
+
32
+ # Distribution / packaging
33
+ .eggs/
34
+ pip-wheel-metadata/
35
+ share/python-wheels/
36
+ *.whl
37
+
38
+ # C / C++ / Fortran
39
+ *.o
40
+ *.a
41
+ *.so
42
+ *.so.*
43
+ *.dylib
44
+ *.dll
45
+ *.mod
46
+ *.smod
47
+
48
+ # CMake
49
+ CMakeCache.txt
50
+ CMakeFiles/
51
+ CMakeScripts/
52
+ Testing/
53
+ Makefile
54
+ cmake_install.cmake
55
+ install_manifest.txt
56
+ compile_commands.json
57
+ CTestTestfile.cmake
58
+ _deps/
59
+ *.cmake
60
+ !cmake/*.cmake
61
+
62
+ # scikit-build
63
+ _skbuild/
64
+
65
+ # pytest
66
+ .pytest_cache/
67
+ .coverage
68
+ htmlcov/
69
+ .tox/
70
+ nosetests.xml
71
+ coverage.xml
72
+ *.cover
73
+ *.hypothesis/
74
+
75
+ # Jupyter Notebooks
76
+ .ipynb_checkpoints
77
+ *.ipynb
78
+
79
+ # Editor / IDE
80
+ .vscode/
81
+ .idea/
82
+ *.swp
83
+ *.swo
84
+ *~
85
+ .DS_Store
86
+ Thumbs.db
87
+
88
+ # Sphinx docs build
89
+ docs/_build/
90
+ docs/api/_autosummary/
91
+
92
+ # MyPy
93
+ .mypy_cache/
94
+ .dmypy.json
95
+ dmypy.json
96
+
97
+ # Ruff / linters
98
+ .ruff_cache/
99
+
100
+ # CI artifacts
101
+ *.log
102
+ *.out
103
+ .gitlab-ci-local
104
+
105
+ # Local env files
106
+ .env.local
107
+ .env.*.local
@@ -0,0 +1,74 @@
1
+ # --- selinv GitLab CI --------------------------------------------------------
2
+ #
3
+ # Stages
4
+ # test – pytest for each supported Python version
5
+ # build-wheels – binary wheels + sdist (version tags only)
6
+ # publish – upload to PyPI (version tags only)
7
+ #
8
+ # Required CI/CD variables
9
+ # PYPI_TOKEN – PyPI API token (masked, protected)
10
+ #
11
+ # Optional CI/CD variables
12
+ # TWINE_REPOSITORY_URL – custom PyPI registry URL (defaults to pypi.org)
13
+
14
+ default:
15
+ image: ghcr.io/prefix-dev/pixi:latest
16
+
17
+ stages:
18
+ - test
19
+ - build-wheels
20
+ - publish
21
+
22
+ # --- test --------------------------------------------------------------------
23
+
24
+ test:
25
+ stage: test
26
+ script:
27
+ - pixi run -e $PIXI_ENVIRONMENT test -v
28
+ parallel:
29
+ matrix:
30
+ - PIXI_ENVIRONMENT: [py310, py311, py312, py313, py314]
31
+
32
+
33
+ # --- build-wheels ------------------------------------------------------------
34
+
35
+ build-wheel:
36
+ stage: build-wheels
37
+ rules:
38
+ - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/
39
+ script:
40
+ - pixi run -e $PIXI_ENVIRONMENT wheel
41
+ parallel:
42
+ matrix:
43
+ - PIXI_ENVIRONMENT: [py310, py311, py312, py313, py314]
44
+ artifacts:
45
+ paths:
46
+ - dist/*.whl
47
+ expire_in: 1 month
48
+
49
+ build-sdist:
50
+ stage: build-wheels
51
+ rules:
52
+ - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/
53
+ script:
54
+ - pixi run -e dev sdist
55
+ artifacts:
56
+ paths:
57
+ - dist/*.tar.gz
58
+ expire_in: 1 month
59
+
60
+ # --- publish -----------------------------------------------------------------
61
+
62
+ publish:
63
+ stage: publish
64
+ rules:
65
+ - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/
66
+ needs:
67
+ - build-wheel
68
+ - build-sdist
69
+ script:
70
+ - pixi run -e dev twine upload --verbose --non-interactive --repository pypi dist/*
71
+ artifacts:
72
+ paths:
73
+ - dist/
74
+ expire_in: 1 month
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0]
11
+
12
+ ### Added
13
+ - Initial release of the `selinv` Python package.
14
+ - Python bindings for the SelInv selected-inversion algorithm (Lin, Yang et al., 2011)
15
+ via [nanobind](https://github.com/wjakob/nanobind).
16
+ - `selinv(A)` — compute the diagonal of A⁻¹ for a sparse symmetric positive-definite
17
+ matrix `A` given in CSC/CSR format.
18
+ - `selinvfull(A, P)` — compute selected off-diagonal elements of A⁻¹ specified by the
19
+ sparsity pattern `P`.
20
+ - CMake-based build system using `scikit-build-core` for installation via `pip`.
21
+ - Support for BLAS/LAPACK backends (OpenBLAS on Linux; Accelerate on macOS).
22
+ - Optional METIS reordering support (disabled by default; enable with
23
+ `-DSELINV_USE_METIS=ON`).
24
+ - Test suite under `tests/` exercising correctness against dense
25
+ reference inverses from NumPy/SciPy.
26
+ - Sphinx documentation with mathematical background, installation guide, and API
27
+ reference.
28
+ - GitLab CI pipeline for automated testing, wheel building (via `cibuildwheel`), and
29
+ publishing to a private PyPI registry.
30
+
31
+ ### Dependencies
32
+ - Python ≥ 3.9
33
+ - NumPy ≥ 1.21
34
+ - SciPy ≥ 1.7
35
+ - A Fortran compiler (gfortran ≥ 7) and CMake ≥ 3.15 are required at build time.
36
+ - BLAS and LAPACK libraries are required at build time.
37
+
38
+ [Unreleased]: https://gitlab.in2p3.fr/lemaitre/selinv/-/compare/v0.1.0...HEAD
39
+ [0.1.0]: https://gitlab.in2p3.fr/lemaitre/selinv/-/tags/v0.1.0
@@ -0,0 +1,157 @@
1
+ cmake_minimum_required(VERSION 3.18)
2
+
3
+ # ---------------------------------------------------------------------------
4
+ # scikit-build-core calls CMake before the project() command to detect the
5
+ # Python interpreter; the actual languages are declared below.
6
+ # ---------------------------------------------------------------------------
7
+ project(selinv LANGUAGES C CXX Fortran)
8
+
9
+ set(CMAKE_CXX_STANDARD 17)
10
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
11
+ set(CMAKE_CXX_EXTENSIONS OFF)
12
+
13
+ # ---------------------------------------------------------------------------
14
+ # Dependencies
15
+ # ---------------------------------------------------------------------------
16
+
17
+ # Python – must be found BEFORE nanobind (nanobind's cmake config requires it).
18
+ # scikit-build-core sets this up automatically; for a plain cmake invocation
19
+ # the interpreter and development headers must be on PATH / in the prefix.
20
+ find_package(Python 3.9
21
+ REQUIRED COMPONENTS Interpreter Development.Module
22
+ OPTIONAL_COMPONENTS Development.SABIModule
23
+ )
24
+
25
+ # nanobind – provided as a build requirement via scikit-build-core.
26
+ # In a plain CMake build outside scikit-build-core, run:
27
+ # pip install nanobind
28
+ # and CMake will find it through the Python site-packages.
29
+ find_package(nanobind CONFIG REQUIRED)
30
+
31
+ # BLAS / LAPACK – required by the Fortran solver.
32
+ find_package(BLAS REQUIRED)
33
+ find_package(LAPACK REQUIRED)
34
+
35
+ # ---------------------------------------------------------------------------
36
+ # Optional: METIS reordering (Node Nested Dissection)
37
+ # ---------------------------------------------------------------------------
38
+ option(SELINV_USE_METIS "Enable METIS reordering support" OFF)
39
+
40
+ if(SELINV_USE_METIS)
41
+ find_library(METIS_LIB NAMES metis REQUIRED
42
+ DOC "Path to the METIS library (libmetis)")
43
+ find_path(METIS_INCLUDE_DIR NAMES metis.h REQUIRED
44
+ DOC "Path to the METIS include directory")
45
+ if(NOT METIS_LIB OR NOT METIS_INCLUDE_DIR)
46
+ message(FATAL_ERROR
47
+ "METIS requested but not found. "
48
+ "Set METIS_LIB and METIS_INCLUDE_DIR manually or disable "
49
+ "SELINV_USE_METIS.")
50
+ endif()
51
+ message(STATUS "selinv: METIS support enabled (${METIS_LIB})")
52
+ endif()
53
+
54
+ # ---------------------------------------------------------------------------
55
+ # Fortran sources – all .f files in extern/selinv/
56
+ # ---------------------------------------------------------------------------
57
+ file(GLOB FORTRAN_SOURCES
58
+ "${CMAKE_CURRENT_SOURCE_DIR}/extern/selinv/*.f"
59
+ )
60
+
61
+ if(NOT FORTRAN_SOURCES)
62
+ message(FATAL_ERROR "No Fortran sources found in extern/selinv/")
63
+ endif()
64
+
65
+ # ---------------------------------------------------------------------------
66
+ # Static library: Fortran core (supernodal LDL' + SelInv)
67
+ # ---------------------------------------------------------------------------
68
+ add_library(selinv_fortran STATIC
69
+ ${FORTRAN_SOURCES}
70
+ )
71
+
72
+ # Position-independent code is required for shared libraries / Python extensions
73
+ set_target_properties(selinv_fortran PROPERTIES
74
+ POSITION_INDEPENDENT_CODE ON
75
+ )
76
+
77
+ target_link_libraries(selinv_fortran PUBLIC
78
+ ${LAPACK_LIBRARIES}
79
+ ${BLAS_LIBRARIES}
80
+ )
81
+
82
+ # On macOS use Accelerate instead of the separately-found BLAS/LAPACK when the
83
+ # detected libraries resolve to the Accelerate framework (cmake ≥ 3.22 sets the
84
+ # BLA_VENDOR to Apple for this case).
85
+ if(APPLE)
86
+ target_link_options(selinv_fortran PUBLIC -framework Accelerate)
87
+ endif()
88
+
89
+ # ---------------------------------------------------------------------------
90
+ # Static library: thread-safe C interface (replaces C2Finterface.c)
91
+ # ---------------------------------------------------------------------------
92
+ add_library(selinv_c_interface STATIC
93
+ "${CMAKE_CURRENT_SOURCE_DIR}/csrc/selinv_interface.c"
94
+ )
95
+
96
+ target_include_directories(selinv_c_interface PUBLIC
97
+ "${CMAKE_CURRENT_SOURCE_DIR}/csrc"
98
+ )
99
+
100
+ target_link_libraries(selinv_c_interface PUBLIC selinv_fortran)
101
+
102
+ set_target_properties(selinv_c_interface PROPERTIES
103
+ POSITION_INDEPENDENT_CODE ON
104
+ )
105
+
106
+ if(SELINV_USE_METIS)
107
+ target_compile_definitions(selinv_c_interface PRIVATE METIS)
108
+ target_include_directories(selinv_c_interface PRIVATE "${METIS_INCLUDE_DIR}")
109
+ target_link_libraries(selinv_c_interface PUBLIC "${METIS_LIB}")
110
+ endif()
111
+
112
+ # ---------------------------------------------------------------------------
113
+ # nanobind Python extension: _selinv_core
114
+ # ---------------------------------------------------------------------------
115
+ nanobind_add_module(_selinv_core
116
+ NB_STATIC # link nanobind statically → fewer runtime dependencies
117
+ "${CMAKE_CURRENT_SOURCE_DIR}/csrc/selinv_bind.cpp"
118
+ )
119
+
120
+ # On Linux, bind all function references inside _selinv_core.so to the definitions
121
+ # inside the same .so (i.e. our local 3-argument dscal_ from dscal.f), so
122
+ # that MKL's 4-argument dscal_ — which is loaded transitively via numpy/scipy
123
+ # at runtime — cannot override them and cause a segfault.
124
+ # The equivalent on macOS (two-level namespace) is not needed because dylibs
125
+ # resolve symbols at link time rather than load time.
126
+ target_link_options(_selinv_core PRIVATE
127
+ $<$<PLATFORM_ID:Linux>:-Wl,-Bsymbolic-functions>
128
+ )
129
+
130
+ target_include_directories(_selinv_core PRIVATE
131
+ "${CMAKE_CURRENT_SOURCE_DIR}/csrc"
132
+ )
133
+
134
+ target_link_libraries(_selinv_core PRIVATE selinv_c_interface)
135
+
136
+ if(SELINV_USE_METIS)
137
+ target_compile_definitions(_selinv_core PRIVATE SELINV_HAS_METIS)
138
+ endif()
139
+
140
+ # Install the extension alongside the Python package sources
141
+ install(TARGETS _selinv_core
142
+ LIBRARY DESTINATION selinv
143
+ RUNTIME DESTINATION selinv
144
+ )
145
+
146
+ # ---------------------------------------------------------------------------
147
+ # Summary
148
+ # ---------------------------------------------------------------------------
149
+ message(STATUS "")
150
+ message(STATUS "selinv configuration summary")
151
+ message(STATUS " Fortran compiler : ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
152
+ message(STATUS " C compiler : ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
153
+ message(STATUS " C++ compiler : ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
154
+ message(STATUS " BLAS : ${BLAS_LIBRARIES}")
155
+ message(STATUS " LAPACK : ${LAPACK_LIBRARIES}")
156
+ message(STATUS " METIS support : ${SELINV_USE_METIS}")
157
+ message(STATUS "")
selinv-1.0.0/LICENSE ADDED
@@ -0,0 +1,80 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Mathieu Bernard
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice,
9
+ this list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from this
17
+ software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
+ POSSIBILITY OF SUCH DAMAGE.
30
+
31
+
32
+ ==============================================================================
33
+ The Fortran sources in extern/selinv/ are part of the SelInv package and are
34
+ distributed under the following license:
35
+ ==============================================================================
36
+
37
+ Selected Inversion Package (SelInv)
38
+
39
+ Copyright (c) 2011, The Regents of the University of California,
40
+ Department of Energy contract-operators of the Lawrence Berkeley
41
+ National Laboratory. All rights reserved.
42
+
43
+ 1. Redistribution and use in source and binary forms, with or without
44
+ modification, are permitted provided that the following conditions are
45
+ met:
46
+
47
+ (1) Redistributions of source code must retain the copyright notice,
48
+ this list of conditions and the following disclaimer.
49
+
50
+ (2) Redistributions in binary form must reproduce the copyright
51
+ notice, this list of conditions and the following disclaimer in the
52
+ documentation and/or other materials provided with the distribution.
53
+
54
+ (3) Neither the name of the University of California, Lawrence
55
+ Berkeley National Laboratory, U.S. Dept. of Energy nor the names of its
56
+ contributors may be used to endorse or promote products derived from
57
+ this software without specific prior written permission.
58
+
59
+ 2. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
60
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
61
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
62
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
63
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
64
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
65
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
66
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
67
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
68
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
69
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
70
+
71
+ 3. You are under no obligation whatsoever to provide any bug fixes,
72
+ patches, or upgrades to the features, functionality or performance of
73
+ the source code ("Enhancements") to anyone; however, if you choose to
74
+ make your Enhancements available either publicly, or directly to
75
+ Lawrence Berkeley National Laboratory, without imposing a separate
76
+ written license agreement for such Enhancements, then you hereby grant
77
+ the following license: a non-exclusive, royalty-free perpetual license
78
+ to install, use, modify, prepare derivative works, incorporate into
79
+ other computer software, distribute, and sublicense such enhancements or
80
+ derivative works thereof, in binary and source code form.