Releases: HugoMVale/odrpack95
odrpack 3.0.1
This release includes two major changes that are not backward-compatible:
- The signature of the model function was modified to use explicit-size arrays (instead of assumed-shape arrays) and to include an extra
type(c_ptr) :: dataargument:
subroutine fcn_t( &
n, m, q, np, ldifx, beta, xplusd, ifixb, ifixx, ideval, f, fjacb, fjacd, istop, data) bind(C)
!! User-supplied subroutine for evaluating the model.
import :: c_int, c_double, c_ptr
implicit none
integer(c_int), intent(in) :: n
!! Number of observations.
integer(c_int), intent(in) :: m
!! Number of columns of data in the independent variable.
integer(c_int), intent(in) :: q
!! Number of responses per observation.
integer(c_int), intent(in) :: np
!! Number of function parameters.
integer(c_int), intent(in) :: ldifx
!! Leading dimension of array `ifixx`.
real(c_double), intent(in) :: beta(np)
!! Current values of parameters.
real(c_double), intent(in) :: xplusd(n, m)
!! Current value of explanatory variable, i.e., `x + delta`.
integer(c_int), intent(in) :: ifixb(np)
!! Indicators for "fixing" parameters (`beta`).
integer(c_int), intent(in) :: ifixx(ldifx, m)
!! Indicators for "fixing" explanatory variable (`x`).
integer(c_int), intent(in) :: ideval
!! Indicator for selecting computation to be performed.
real(c_double), intent(out) :: f(n, q)
!! Predicted function values.
real(c_double), intent(out) :: fjacb(n, np, q)
!! Jacobian with respect to `beta`.
real(c_double), intent(out) :: fjacd(n, m, q)
!! Jacobian with respect to errors `delta`.
integer(c_int), intent(out) :: istop
!! Stopping condition, with meaning as follows.
!! `0`: Current `beta` and `x + delta` were acceptable and values were computed
!! successfully.
!! `1`: Current `beta` and `x + delta` are not acceptable; 'odrpack' should select
!! values closer to most recently used values if possible.
!! `-1`: Current `beta` and `x + delta` are not acceptable; 'odrpack' should stop.
type(c_ptr), intent(in), value :: data
!! User-defined data passed to the function.
end subroutine- The signature of the
odrsubroutine was modified. Instead of passing the model function (callback) directly as first positional argument, we now pass atype(odrpack_model) :: modelobject, which includes the function and optional data.
subroutine odr(model, ...)
type(odrpack_model) :: model
...
end subroutinetype odrpack_model
procedure(fcn_t), nopass, pointer :: fcn => null()
type(c_ptr) :: data = c_null_ptr
end typeThese changes were required to allow the library to be called via the C API without closures on either the Fortran side or the foreign side. Closures on the Fortran side require an executable stack (at least with GCC), which is not compatible with musl-based Linux or with Julia's REPL. In addition, Julia does not support cfunction closures on macOS/ARM.
odrpack 2.1.0
The C API was extended with an optional void *thunk argument, allowing arbitrary data to be passed to callbacks without relying on closures. This change was motivated by the fact that Julia’s cFunction does not support closures on certain platforms, such as macOS ARM.
odrpack 2.0.3
Updated Meson and CMake build files to enable building a shared library, a requirement for the Julia bindings.
odrpack 2.0.2
Fix a type omission in C-API.
odrpack 2.0.1
This release includes two major changes that are not backward-compatible:
- The signature of the model function
fcn_twas updated and is now:
subroutine fcn_t(beta, xplusd, ifixb, ifixx, ideval, f, fjacb, fjacd, istop)
!! User-supplied subroutine for evaluating the model.
import :: wp
implicit none
real(wp), intent(in) :: beta(:)
!! Current values of parameters.
real(wp), intent(in) :: xplusd(:, :)
!! Current value of explanatory variable, i.e., `x + delta`. Shape: `(n, m)`.
integer, intent(in) :: ifixb(:)
!! Indicators for "fixing" parameters (`beta`).
integer, intent(in) :: ifixx(:, :)
!! Indicators for "fixing" explanatory variable (`x`). Shape: `(ldifx, m)`.
integer, intent(in) :: ideval
!! Indicator for selecting computation to be performed.
real(wp), intent(out) :: f(:, :)
!! Predicted function values. Shape: `(n, q)`.
real(wp), intent(out) :: fjacb(:, :, :)
!! Jacobian with respect to `beta`. Shape: `(n, np, q)`.
real(wp), intent(out) :: fjacd(:, :, :)
!! Jacobian with respect to errors `delta`. Shape: `(n, m, q)`.
integer, intent(out) :: istop
!! Stopping condition, with meaning as follows.
!! `0`: Current `beta` and `x + delta` were acceptable and values were computed
!! successfully.
!! `1`: Current `beta` and `x + delta` are not acceptable; 'odrpack' should select
!! values closer to most recently used values if possible.
!! `-1`: Current `beta` and `x + delta` are not acceptable; 'odrpack' should stop.
end subroutine fcn_t- Some argument names and location in the C-API were also slighted updated.
- All
odrarray arguments must now strictly conform to the expected shapes. Previously, it was possible to provide input arrays larger than required, which were internally sliced to the correct shape. This is no longer accepted.
odrpack 1.0.2
Refactor solve to avoid temporary arrays.
odrpack 1.0.1
Improved meson build to simplify inclusion as subproject in odrpack-python.
odrpack 1.0.0
v1.0.0 Update README.md