numo-gsl-integration 0.1.0 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c42681d508010807cd1ef98568ddcbd6f8d2de8a59e812b5161aac0caf70f72
4
- data.tar.gz: '0048c5a0902c526f7b34c015b6bbdcc5372d4f2fc57623aeec06ce70c10fe8dc'
3
+ metadata.gz: 0ed1ccbd179314a5925c135faa809ff255bb9acf626c475af39237c8e397f89a
4
+ data.tar.gz: 891a0e74db19f6d5c5b40aeff66a2610dbf063c5d2ccd3b9dfdae0a730a880fd
5
5
  SHA512:
6
- metadata.gz: b01f0b964db92305a9a9bbaf884a600217aaa84ad6b4970c91327881f8bf3088ad8d0150ca3af505624f6beabd2645bafe3ea99e27ca9ec0987fe21056d8acf3
7
- data.tar.gz: 5c5afeda8c3d6bb2e1c512c37c7e5957d27fa9bc3b2f1290a341664f48398a570d36610491c05848daa6064bd160e0b477891114d8751e0590a96a118e37ebb0
6
+ metadata.gz: 86207b0346bcff38a8892e36c8721d2327010b7367a74b91344db9c799ae2ea0390203572ce275efad201a47bc480f66e26b1daad753cfd63c878c7b78575793
7
+ data.tar.gz: 532c33c4e35c701e901cf10d771a9c982533b927353dbbe0d53173684dc2ab66a90231e617906a10cc3d530aa05f364ea83735982e3721b421e06e1cbb2b983a
data/CHANGELOG.md CHANGED
@@ -2,11 +2,33 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.3.0] - 2026-11-05
6
+
7
+ ### Added in 0.3.0
8
+
9
+ - Added fixed point quadrature with Legendre, first- and second-kind Chebyshev, Gegenbauer, Jacobi, Laguerre, Hermite, exponential, and rational rules.
10
+
11
+ ## [0.2.0] - 2026-11-05
12
+
13
+ ### Changed in 0.2.0
14
+
15
+ - Removed the runtime dependency on `numo-gsl-alt`.
16
+ - Defined `Numo::GSL::GslError` and installed the process-wide GSL error handler in the native extension.
17
+ - Added the numeric GSL error code to messages raised by the integration GSL error handler.
18
+ - Replaced wrapper-side validation errors with `TypeError` and `ArgumentError`.
19
+ - Changed Markdown formatting from `markdownlint-cli2 --fix` to Prettier while retaining `markdownlint-cli2` for linting.
20
+ - Extended Markdown formatting and linting to all Markdown files under the project root and `docs`.
21
+ - Added Prettier installation to the CI workflow.
22
+
23
+ ### Removed in 0.2.0
24
+
25
+ - Removed `Numo::GSL::Integration::Error`.
26
+
5
27
  ## [0.1.0] - 2026-11-04
6
28
 
7
- ### Added
29
+ ### Added in 0.1.0
8
30
 
9
- - Added fixed-order Gauss–Legendre integration for smooth functions.
31
+ - Added fixed-order Gauss-Legendre integration for smooth functions.
10
32
  - Added Romberg integration for smooth functions with function-evaluation counts.
11
33
  - Added CQUAD doubly-adaptive integration with function-evaluation counts.
12
34
  - Added QAWF adaptive integration for sine- and cosine-weighted Fourier integrals over a semi-infinite interval.
@@ -24,8 +46,8 @@
24
46
  - Added RBS declarations for the public integration API and RBS validation to the default Rake task.
25
47
  - Added automated rubyfmt, clang-format, and Markdown checks, with `format:check` and `format:apply` tasks.
26
48
 
27
- ### Changed
49
+ ### Changed in 0.1.0
28
50
 
29
- - Load `numo/gsl` before the integration native extension and make `Numo::GSL::Integration::Error` inherit from `Numo::GSL::GslError`.
30
- - Delegate GSL-reported integration errors to the process-wide handler installed by `numo-gsl-alt` instead of converting return statuses to `Integration::Error`.
31
- - Ensure integration workspaces, weight tables, and temporary arrays are released when integration completes normally or raises an exception.
51
+ - Loaded `numo/gsl` before the integration native extension and made `Numo::GSL::Integration::Error` inherit from `Numo::GSL::GslError`.
52
+ - Delegated GSL-reported integration errors to the process-wide handler installed by `numo-gsl-alt` instead of converting return statuses to `Integration::Error`.
53
+ - Ensured integration workspaces, weight tables, and temporary arrays are released when integration completes normally or raises an exception.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Numo::GSL::Integration
2
2
 
3
- `numo-gsl-integration` provides numerical integration routines from the [GNU Scientific Library (GSL)](https://www.gnu.org/software/gsl/) under the `Numo::GSL::Integration` namespace. It depends on [`numo-gsl-alt`](https://github.com/mvz/numo-gsl-alt) for the `Numo::GSL` namespace and GSL error handling.
3
+ `numo-gsl-integration` provides numerical integration routines from the [GNU Scientific Library (GSL)](https://www.gnu.org/software/gsl/) under the `Numo::GSL::Integration` namespace. It can be installed and loaded without [`numo-gsl`](https://github.com/ruby-numo/numo-gsl) or [`numo-gsl-alt`](https://github.com/mvz/numo-gsl-alt).
4
4
 
5
5
  ## Requirements
6
6
 
@@ -8,11 +8,7 @@
8
8
  - GNU Scientific Library (GSL)
9
9
  - `gsl-config` available in `PATH`
10
10
 
11
- The `numo-gsl-alt` Ruby gem is installed as a runtime dependency. GSL itself must be installed separately.
12
-
13
- ## Why numo-gsl-alt?
14
-
15
- This gem intentionally depends on [`numo-gsl-alt`](https://github.com/mvz/numo-gsl-alt) rather than [`numo-gsl`](https://github.com/ruby-numo/numo-gsl). The main reason is Ruby compatibility: `numo-gsl` 0.1.2 does not build with Ruby 4.0 because its generated native extension registers a three-argument C function as a one-argument Ruby method. Ruby 4.0 rejects that incompatible function-pointer type during compilation. `numo-gsl-integration` targets Ruby 3.2 or later and is developed and tested with `numo-gsl-alt` 0.1.x, including Ruby 4.0.
11
+ GSL itself must be installed separately.
16
12
 
17
13
  ## Installation
18
14
 
@@ -38,8 +34,6 @@ Load the library:
38
34
  require "numo/gsl/integration"
39
35
  ```
40
36
 
41
- The entry point loads `numo/gsl` before the integration native extension. This ensures that `numo-gsl-alt` initializes the `Numo::GSL` namespace and installs its GSL error handler before integration routines are loaded.
42
-
43
37
  For example, use `qag` to integrate a function over a finite interval:
44
38
 
45
39
  ```ruby
@@ -50,22 +44,23 @@ end
50
44
 
51
45
  ## Supported routines
52
46
 
53
- | Method | Interval | Intended use |
54
- | --- | --- | --- |
55
- | `qag` | Finite | General-purpose adaptive integration |
56
- | `qng` | Finite | Non-adaptive integration of smooth functions |
57
- | `qags` | Finite | Functions with integrable singularities or discontinuities |
58
- | `qagp` | Finite | Known singular or discontinuity points |
59
- | `qagi` | Infinite | Integration over the entire real line |
60
- | `qagiu` | Semi-infinite | Integration from a finite lower bound to positive infinity |
61
- | `qagil` | Semi-infinite | Integration from negative infinity to a finite upper bound |
62
- | `qawc` | Finite | Cauchy principal value with a known singular point |
63
- | `qaws` | Finite | Algebraic and logarithmic endpoint singularities |
64
- | `qawo` | Finite | Sine- or cosine-weighted oscillatory integrals |
65
- | `qawf` | Semi-infinite | Sine- or cosine-weighted Fourier integrals |
66
- | `cquad` | Finite | Difficult integrands and endpoint singularities |
67
- | `romberg` | Finite | Smooth functions with extrapolated trapezoidal integration |
68
- | `glfixed` | Finite | Fixed-order Gauss–Legendre integration of smooth functions |
47
+ | Method | Interval | Intended use |
48
+ | --------- | -------------- | ---------------------------------------------------------------- |
49
+ | `qng` | Finite | Non-adaptive integration of smooth functions |
50
+ | `qag` | Finite | General-purpose adaptive integration |
51
+ | `qags` | Finite | Functions with integrable singularities or discontinuities |
52
+ | `qagp` | Finite | Known singular or discontinuity points |
53
+ | `qagi` | Infinite | Integration over the entire real line |
54
+ | `qagiu` | Semi-infinite | Integration from a finite lower bound to positive infinity |
55
+ | `qagil` | Semi-infinite | Integration from negative infinity to a finite upper bound |
56
+ | `qawc` | Finite | Cauchy principal value with a known singular point |
57
+ | `qaws` | Finite | Algebraic and logarithmic endpoint singularities |
58
+ | `qawo` | Finite | Sine- or cosine-weighted oscillatory integrals |
59
+ | `qawf` | Semi-infinite | Sine- or cosine-weighted Fourier integrals |
60
+ | `cquad` | Finite | Difficult integrands and endpoint singularities |
61
+ | `romberg` | Finite | Smooth functions with extrapolated trapezoidal integration |
62
+ | `glfixed` | Finite | Fixed-order Gauss-Legendre integration of smooth functions |
63
+ | `fixed` | Rule-dependent | Fixed-order Gaussian quadrature with selectable weight functions |
69
64
 
70
65
  See [Integration routines](docs/routines.md) for parameters and examples.
71
66
 
@@ -1,19 +1,13 @@
1
1
  # GSL error handling
2
2
 
3
- `numo-gsl-alt` installs the process-wide GSL error handler that converts GSL errors to `Numo::GSL::GslError`. `numo-gsl-integration` neither replaces nor temporarily disables that handler.
3
+ `numo-gsl-integration` defines `Numo::GSL::GslError` as a subclass of `StandardError` and installs a process-wide GSL error handler when the native extension is loaded.
4
+ Errors reported by GSL are raised directly as `Numo::GSL::GslError`. The message contains the GSL source file, line number, reason, and numeric error code:
4
5
 
5
- Errors reported by GSL are raised directly as `Numo::GSL::GslError` by the handler installed by `numo-gsl-alt`. `numo-gsl-integration` does not convert integration return statuses into separate exceptions.
6
-
7
- The workspaces used by QAG, QAGS, QAGP, QAGI, QAGIU, QAGIL, QAWC, QAWS, QAWO, QAWF, CQUAD, and Romberg are released when a call completes normally or raises an exception. QAWS, QAWO, and QAWF also release their weight tables, GLFIXED releases its Gauss–Legendre table, and QAGP releases its temporary copy of the point array.
8
-
9
- `Numo::GSL::Integration::Error` is reserved for validation or state errors detected by `numo-gsl-integration` itself. It inherits from `Numo::GSL::GslError`:
10
-
11
- ```mermaid
12
- flowchart BT
13
- IntegrationError["Numo::GSL::Integration::Error"] -->|inherits from| GslError["Numo::GSL::GslError"]
14
- GslError -->|inherits from| StandardError
6
+ ```text
7
+ file:line: reason (GSL error code)
15
8
  ```
16
9
 
17
- Code can rescue all GSL-related errors with `Numo::GSL::GslError`, or rescue `Numo::GSL::Integration::Error` when it needs to handle only errors detected by the integration wrapper.
18
-
19
- The GSL error handler is shared by the entire process. This gem leaves its ownership with `numo-gsl-alt` and does not switch the handler around individual integration calls.
10
+ `numo-gsl-integration` does not convert integration return statuses into separate exceptions.
11
+ The workspaces used by QAG, QAGS, QAGP, QAGI, QAGIU, QAGIL, QAWC, QAWS, QAWO, QAWF, CQUAD, and Romberg are released when a call completes normally or raises an exception. QAWS, QAWO, and QAWF also release their weight tables, GLFIXED releases its Gauss–Legendre table, and QAGP releases its temporary copy of the point array.
12
+ Invalid argument types raise `TypeError`. Invalid values, counts, or ordering raise `ArgumentError`. Exceptions raised by the integrand are propagated unchanged.
13
+ The GSL error handler is shared by the entire process. Loading this gem replaces the previously registered handler. If another GSL binding is loaded afterward, that binding may replace this gem's handler in turn.