Skip to content

Commit

Permalink
Merge pull request #33 from reinh-bader/fgsl_devel_1.6.0
Browse files Browse the repository at this point in the history
Changes for FGSL 1.6.0
  • Loading branch information
reinh-bader authored Mar 23, 2024
2 parents e89442a + 9565fbf commit 27a3e7c
Show file tree
Hide file tree
Showing 812 changed files with 99,879 additions and 12,816 deletions.
2,580 changes: 1,617 additions & 963 deletions Doxyfile

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
Changes in 1.6.0 (by R Bader):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This release introduces support for gsl 2.7. An overview:

1. added gsl_spmatrix interfaces norm1, dense_add, dens_sub
2. added gsl_linalg_QL interfaces decomp, unpack
3. added gsl_multilarge_linear_matrix_ptr and gsl_multilarge_linear_rhs_ptr interfaces
4. added large dense linear regression example program
5. added gsl_linalg_cholesky_band interfaces for solvem, svxm, scale, scale_apply
6. added gsl_linalg_QR_UR, gsl_linalg_QR_UU, gsl_linalg_QR_UZ, gsl_linalg_QR_UD
interfaces
7. added gsl_multifit_linear_lcurvature interface
8. added gsl_spline2d_eval_extrap interface
9. bug fixes for missing interfaces and status handling, *fprintf revision,
removal of __FILE__ (issue #36)
10. gsl_linalg_LU_band remains unsupported, due to its use of gsl_vector_uint
11. added a copy of the GSL 2.7 reference pdf to the doc folder.

Changes in 1.5.0 (by R Bader):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This release introduces support for gsl 2.6. An overview:
Expand Down
8 changes: 5 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@

This is release 1.5.0 of the Fortran interface
This is release 1.6.0 of the Fortran interface
to the GNU Scientific Library.
It is based on version 2.6 of GSL, and should not be used with
It is based on version 2.7 of GSL, and should not be used with
earlier GSL releases.

Please use the release 1.0.0 in combination with GSL 1.x
Please use the release 1.1.0 in combination with GSL 2.1 or 2.2.1
Please use the release 1.2.0 in combination with GSL 2.3
Please use the release 1.3.0 in combination with GSL 2.4
Please use the release 1.4.0 in combination with GSL 2.5
Please use the release 1.5.0 in combination with GSL 2.6

Please consult the NEWS file for a change log.

Expand All @@ -27,7 +28,7 @@ Installation procedure:
includes into different packages e.g., gsl and gsl-devel.
For building FGSL, both must be installed.
2. The ANSI C compiler used to build the GSL installation
3. A Fortran 2003 compiler.
3. A Fortran compiler that supports C interop.

(B) autoconf setup:
This section applies only if you have downloaded the github
Expand Down Expand Up @@ -130,3 +131,4 @@ Releases:
* 1.3.0: August, 2019
* 1.4.0: March, 2021
* 1.5.0: July, 2021
* 1.6.0: March, 2024
18 changes: 9 additions & 9 deletions api/array.finc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
end block try
if ( present(stat) ) stat = stat_local
if ( .not. present(stat) .and. stat_local /= fgsl_success ) &
call fgsl_error("aligning failed", __FILE__, __LINE__, stat_local)
call fgsl_error("aligning failed", 'fgsl_array', __LINE__, stat_local)
end function fgsl_vector_init
function fgsl_vector_int_init(array, stride, stat)
integer(fgsl_int), target, contiguous, intent(in) :: array(:)
Expand Down Expand Up @@ -80,7 +80,7 @@
end block try
if ( present(stat) ) stat = stat_local
if ( .not. present(stat) .and. stat_local /= fgsl_success ) &
call fgsl_error("aligning failed", __FILE__, __LINE__, stat_local)
call fgsl_error("aligning failed", 'fgsl_array', __LINE__, stat_local)
end function fgsl_vector_int_init
!> Legacy specific fgsl_vector_init of for GSL vector initialization
!> \param type - determine intrinsic type of vector object
Expand Down Expand Up @@ -290,7 +290,7 @@
end block try
if ( present(stat) ) stat = stat_local
if ( .not. present(stat) .and. stat_local /= fgsl_success ) &
call fgsl_error("aligning failed", __FILE__, __LINE__, stat_local)
call fgsl_error("aligning failed", 'fgsl_array', __LINE__, stat_local)
end function fgsl_vector_complex_init
!> Wrap a rank 1 Fortran array slice inside a double precision complex
!> real GSL vector object. This is invoked via the generic
Expand Down Expand Up @@ -432,8 +432,8 @@
!> GSL matrix object. This is invoked via the generic fgsl_matrix_init.
!> \param array - requires the actual argument to have the
!> TARGET and CONTIGUOUS attributes.
!> \param n - number of rows in array
!> \param m - number of columns in array
!> \param n - number of rows (C:columns) in array
!> \param m - number of columns (C:rows) in array
!> \param fmat - double precision GSL matrix object, which is allocated
!> \return Status
function fgsl_matrix_init(array, n, m, stat)
Expand All @@ -460,7 +460,7 @@
nloc, mloc, fgsl_matrix_init%gsl_matrix)
if ( present(stat) ) stat = stat_local
if ( .not. present(stat) .and. stat_local /= fgsl_success ) &
call fgsl_error("aligning failed", __FILE__, __LINE__, stat_local)
call fgsl_error("aligning failed", 'fgsl_array', __LINE__, stat_local)
end function fgsl_matrix_init
!> Legacy specific to wrap a rank 2 Fortran array inside a double precision
!> real GSL matrix object. This is invoked via the generic
Expand Down Expand Up @@ -601,8 +601,8 @@
!> fgsl_matrix_init.
!> \param array - requires the actual argument to have the
!> TARGET and CONTIGUOUS attributes.
!> \param n - number of rows in array
!> \param m - number of columns in array
!> \param n - number of rows (C:columns) in array
!> \param m - number of columns (C:rows) in array
!> \param fmat - double precision complex GSL matrix object, which is allocated
!> \return Status
function fgsl_matrix_complex_init(array, n, m, stat)
Expand All @@ -628,7 +628,7 @@
nloc, mloc, fgsl_matrix_complex_init%gsl_matrix_complex)
if ( present(stat) ) stat = stat_local
if ( .not. present(stat) .and. stat_local /= fgsl_success ) &
call fgsl_error("aligning failed", __FILE__, __LINE__, stat_local)
call fgsl_error("aligning failed", 'fgsl_array', __LINE__, stat_local)
end function fgsl_matrix_complex_init
!> Legacy function to wrap a rank 2 Fortran array inside a double precision
!> complex GSL matrix object. This is invoked via the generic
Expand Down
28 changes: 6 additions & 22 deletions api/histogram.finc
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,9 @@
character(kind=fgsl_char, len=*), intent(in) :: range_format, bin_format
integer(fgsl_int) :: fgsl_histogram_fprintf
!
character(kind=fgsl_char,len=fgsl_strmax), target :: lrf, lbf
if (len(trim(range_format)) < fgsl_strmax .and. &
len(trim(bin_format)) < fgsl_strmax) then
lrf = trim(range_format) // c_null_char
lbf = trim(bin_format) // c_null_char
fgsl_histogram_fprintf = &
gsl_histogram_fprintf(stream%gsl_file, h%gsl_histogram, &
c_loc(lrf), c_loc(lbf))
else
fgsl_histogram_fprintf = fgsl_failure
end if
fgsl_histogram_fprintf = &
gsl_histogram_fprintf(stream%gsl_file, h%gsl_histogram, &
range_format // c_null_char, bin_format // c_null_char)
end function fgsl_histogram_fprintf
function fgsl_histogram_fscanf(stream, h)
type(fgsl_file), intent(in) :: stream
Expand Down Expand Up @@ -456,17 +448,9 @@
character(kind=fgsl_char, len=*), intent(in) :: range_format, bin_format
integer(fgsl_int) :: fgsl_histogram2d_fprintf
!
character(kind=fgsl_char,len=fgsl_strmax), target :: lrf, lbf
if (len(trim(range_format)) < fgsl_strmax .and. &
len(trim(bin_format)) < fgsl_strmax) then
lrf = trim(range_format) // c_null_char
lbf = trim(bin_format) // c_null_char
fgsl_histogram2d_fprintf = &
gsl_histogram2d_fprintf(stream%gsl_file, h%gsl_histogram2d, &
c_loc(lrf), c_loc(lbf))
else
fgsl_histogram2d_fprintf = fgsl_failure
end if
fgsl_histogram2d_fprintf = &
gsl_histogram2d_fprintf(stream%gsl_file, h%gsl_histogram2d, &
range_format // c_null_char, bin_format // c_null_char)
end function fgsl_histogram2d_fprintf
function fgsl_histogram2d_fscanf(stream, h)
type(fgsl_file), intent(in) :: stream
Expand Down
54 changes: 43 additions & 11 deletions api/interp.finc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
integer(fgsl_int) :: fgsl_interp_init
!check that the array dimensions match
if (size(xa) /= size(ya)) then
call fgsl_error('xa and ya dimensions do not match', __FILE__, __LINE__, fgsl_ebadlen)
call fgsl_error('xa and ya dimensions do not match', 'fgsl_interp', __LINE__, fgsl_ebadlen)
fgsl_interp_init = fgsl_ebadlen
return
endif
Expand Down Expand Up @@ -200,7 +200,7 @@
integer(fgsl_int) :: fgsl_spline_init
!check if dimenions match
if (size(xa) /= size(ya)) then
call fgsl_error('xa and ya dimensions do not match', __FILE__, __LINE__, fgsl_ebadlen)
call fgsl_error('xa and ya dimensions do not match', 'fgsl_interp', __LINE__, fgsl_ebadlen)
fgsl_spline_init = fgsl_ebadlen
return
endif
Expand Down Expand Up @@ -335,12 +335,12 @@
integer(fgsl_int) :: fgsl_interp2d_init
! this may be a good time to check the dimensions of za vs those of xa and ya
if (size(xa) /= size(za, dim=1)) then
call fgsl_error('xa and za dimensions do not match', __FILE__, __LINE__, fgsl_ebadlen)
call fgsl_error('xa and za dimensions do not match', 'fgsl_interp', __LINE__, fgsl_ebadlen)
fgsl_interp2d_init = fgsl_ebadlen
return
endif
if (size(ya) /= size(za, dim=2)) then
call fgsl_error('ya and za dimensions do not match', __FILE__, __LINE__, fgsl_ebadlen)
call fgsl_error('ya and za dimensions do not match', 'fgsl_interp', __LINE__, fgsl_ebadlen)
fgsl_interp2d_init = fgsl_ebadlen
return
endif
Expand Down Expand Up @@ -539,12 +539,12 @@
integer(fgsl_int) :: fgsl_spline2d_init
! this may be a good time to check the dimensions of za vs those of xa and ya
if (size(xa) /= size(za, dim=1)) then
call fgsl_error('xa and za dimensions do not match', __FILE__, __LINE__, fgsl_ebadlen)
call fgsl_error('xa and za dimensions do not match', 'fgsl_interp', __LINE__, fgsl_ebadlen)
fgsl_spline2d_init = fgsl_ebadlen
return
endif
if (size(ya) /= size(za, dim=2)) then
call fgsl_error('ya and za dimensions do not match', __FILE__, __LINE__, fgsl_ebadlen)
call fgsl_error('ya and za dimensions do not match', 'fgsl_interp', __LINE__, fgsl_ebadlen)
fgsl_spline2d_init = fgsl_ebadlen
return
endif
Expand Down Expand Up @@ -573,22 +573,39 @@
fgsl_spline2d_eval_e = gsl_spline2d_eval_e(interp%gsl_spline2d, x, y, &
xa%gsl_interp_accel, ya%gsl_interp_accel, z)
end function fgsl_spline2d_eval_e
function fgsl_spline2d_eval_deriv_x(interp, x, y, xa, ya)
function fgsl_spline2d_eval_extrap(interp, x, y, xa, ya)
type(fgsl_spline2d), intent(in) :: interp
real(fgsl_double), intent(in) :: x, y
type(fgsl_interp_accel), intent(inout) :: xa, ya
real(fgsl_double) :: fgsl_spline2d_eval_extrap
fgsl_spline2d_eval_extrap = gsl_spline2d_eval_extrap(&
interp%gsl_spline2d, x, y, xa%gsl_interp_accel, ya%gsl_interp_accel)
end function fgsl_spline2d_eval_extrap
function fgsl_spline2d_eval_extrap_e(interp, x, y, xa, ya, z)
type(fgsl_spline2d), intent(in) :: interp
real(fgsl_double), intent(in) :: x, y
type(fgsl_interp_accel), intent(inout) :: xa, ya
real(fgsl_double), intent(out) :: z
integer(fgsl_int) :: fgsl_spline2d_eval_extrap_e
fgsl_spline2d_eval_extrap_e = gsl_spline2d_eval_extrap_e(&
interp%gsl_spline2d, x, y, xa%gsl_interp_accel, ya%gsl_interp_accel, z)
end function fgsl_spline2d_eval_extrap_e
function fgsl_spline2d_eval_deriv_x(interp, x, y, xa, ya)
type(fgsl_spline2d), intent(in) :: interp
real(fgsl_double), intent(in) :: x, y
type(fgsl_interp_accel), intent(inout) :: xa, ya
real(fgsl_double) :: fgsl_spline2d_eval_deriv_x
fgsl_spline2d_eval_deriv_x = gsl_spline2d_eval_deriv_x(interp%gsl_spline2d, x, y, &
xa%gsl_interp_accel, ya%gsl_interp_accel)
fgsl_spline2d_eval_deriv_x = gsl_spline2d_eval_deriv_x(&
interp%gsl_spline2d, x, y, xa%gsl_interp_accel, ya%gsl_interp_accel)
end function fgsl_spline2d_eval_deriv_x
function fgsl_spline2d_eval_deriv_x_e(interp, x, y, xa, ya, z)
type(fgsl_spline2d), intent(in) :: interp
real(fgsl_double), intent(in) :: x, y
type(fgsl_interp_accel), intent(inout) :: xa, ya
real(fgsl_double), intent(out) :: z
integer(fgsl_int) :: fgsl_spline2d_eval_deriv_x_e
fgsl_spline2d_eval_deriv_x_e = gsl_spline2d_eval_deriv_x_e(interp%gsl_spline2d, x, y, &
xa%gsl_interp_accel, ya%gsl_interp_accel, z)
fgsl_spline2d_eval_deriv_x_e = gsl_spline2d_eval_deriv_x_e(&
interp%gsl_spline2d, x, y, xa%gsl_interp_accel, ya%gsl_interp_accel, z)
end function fgsl_spline2d_eval_deriv_x_e
function fgsl_spline2d_eval_deriv_y(interp, x, y, xa, ya)
type(fgsl_spline2d), intent(in) :: interp
Expand Down Expand Up @@ -665,6 +682,21 @@
name = gsl_spline2d_name(interp%gsl_spline2d)
fgsl_spline2d_name = fgsl_name(name)
end function fgsl_spline2d_name
function fgsl_spline2d_set(spline, za, i, j, z)
type(fgsl_spline2d), intent(in) :: spline
real(fgsl_double), intent(inout) :: za(*)
integer(fgsl_size_t), intent(in) :: i, j
real(fgsl_double), intent(in) :: z
integer(fgsl_int) :: fgsl_spline2d_set
fgsl_spline2d_set = gsl_spline2d_set(spline%gsl_spline2d, za, i, j, z)
end function fgsl_spline2d_set
function fgsl_spline2d_get(spline, za, i, j)
type(fgsl_spline2d), intent(in) :: spline
real(fgsl_double), intent(in) :: za(*)
integer(fgsl_size_t), intent(in) :: i, j
real(fgsl_double) :: fgsl_spline2d_get
fgsl_spline2d_get = gsl_spline2d_get(spline%gsl_spline2d, za, i, j)
end function fgsl_spline2d_get
function fgsl_spline2d_min_size(interp)
type(fgsl_spline2d), intent(in) :: interp
integer(fgsl_size_t) :: fgsl_spline2d_min_size
Expand Down
Loading

0 comments on commit 27a3e7c

Please sign in to comment.