stdlib_sum_kahan Interface

public interface stdlib_sum_kahan

Summary

Sum elements of rank N arrays. (Specification)

Description

This interface provides standard conforming call for sum of elements of any rank. The 1-D base implementation follows a chunked approach combined with a kahan kernel for optimizing performance and increasing accuracy. The N-D interfaces calls upon the (N-1)-D implementation. Supported data types include real and complex.


Functions

private pure module function stdlib_sum_kahan_1d_cdp(a) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: a(:)

Return Value complex(kind=dp)

private pure module function stdlib_sum_kahan_1d_cdp_mask(a, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: a(:)
logical, intent(in) :: mask(:)

Return Value complex(kind=dp)

private pure module function stdlib_sum_kahan_1d_csp(a) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: a(:)

Return Value complex(kind=sp)

private pure module function stdlib_sum_kahan_1d_csp_mask(a, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: a(:)
logical, intent(in) :: mask(:)

Return Value complex(kind=sp)

private pure module function stdlib_sum_kahan_1d_dp(a) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: a(:)

Return Value real(kind=dp)

private pure module function stdlib_sum_kahan_1d_dp_mask(a, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: a(:)
logical, intent(in) :: mask(:)

Return Value real(kind=dp)

private pure module function stdlib_sum_kahan_1d_sp(a) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: a(:)

Return Value real(kind=sp)

private pure module function stdlib_sum_kahan_1d_sp_mask(a, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: a(:)
logical, intent(in) :: mask(:)

Return Value real(kind=sp)

private pure module function stdlib_sum_kahan_2d_cdp(x, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: x(:,:)
logical, intent(in), optional :: mask(:,:)

Return Value complex(kind=dp)

private pure module function stdlib_sum_kahan_2d_csp(x, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: x(:,:)
logical, intent(in), optional :: mask(:,:)

Return Value complex(kind=sp)

private pure module function stdlib_sum_kahan_2d_dim_cdp(x, dim, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: x(:,:)
integer, intent(in) :: dim
logical, intent(in), optional :: mask(:,:)

Return Value complex(kind=dp), (merge(size(x,1),size(x,2),mask=1

private pure module function stdlib_sum_kahan_2d_dim_csp(x, dim, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: x(:,:)
integer, intent(in) :: dim
logical, intent(in), optional :: mask(:,:)

Return Value complex(kind=sp), (merge(size(x,1),size(x,2),mask=1

private pure module function stdlib_sum_kahan_2d_dim_dp(x, dim, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x(:,:)
integer, intent(in) :: dim
logical, intent(in), optional :: mask(:,:)

Return Value real(kind=dp), (merge(size(x,1),size(x,2),mask=1

private pure module function stdlib_sum_kahan_2d_dim_sp(x, dim, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: x(:,:)
integer, intent(in) :: dim
logical, intent(in), optional :: mask(:,:)

Return Value real(kind=sp), (merge(size(x,1),size(x,2),mask=1

private pure module function stdlib_sum_kahan_2d_dp(x, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x(:,:)
logical, intent(in), optional :: mask(:,:)

Return Value real(kind=dp)

private pure module function stdlib_sum_kahan_2d_sp(x, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: x(:,:)
logical, intent(in), optional :: mask(:,:)

Return Value real(kind=sp)

private pure module function stdlib_sum_kahan_3d_cdp(x, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: x(:,:,:)
logical, intent(in), optional :: mask(:,:,:)

Return Value complex(kind=dp)

private pure module function stdlib_sum_kahan_3d_csp(x, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: x(:,:,:)
logical, intent(in), optional :: mask(:,:,:)

Return Value complex(kind=sp)

private pure module function stdlib_sum_kahan_3d_dim_cdp(x, dim, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
logical, intent(in), optional :: mask(:,:,:)

Return Value complex(kind=dp), (merge(size(x,1),size(x,2),mask=1

private pure module function stdlib_sum_kahan_3d_dim_csp(x, dim, mask) result(s)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
logical, intent(in), optional :: mask(:,:,:)

Return Value complex(kind=sp), (merge(size(x,1),size(x,2),mask=1

private pure module function stdlib_sum_kahan_3d_dim_dp(x, dim, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
logical, intent(in), optional :: mask(:,:,:)

Return Value real(kind=dp), (merge(size(x,1),size(x,2),mask=1

private pure module function stdlib_sum_kahan_3d_dim_sp(x, dim, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
logical, intent(in), optional :: mask(:,:,:)

Return Value real(kind=sp), (merge(size(x,1),size(x,2),mask=1

private pure module function stdlib_sum_kahan_3d_dp(x, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x(:,:,:)
logical, intent(in), optional :: mask(:,:,:)

Return Value real(kind=dp)

private pure module function stdlib_sum_kahan_3d_sp(x, mask) result(s)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: x(:,:,:)
logical, intent(in), optional :: mask(:,:,:)

Return Value real(kind=sp)


Fortran-lang/stdlib was developed by fortran-lang/stdlib contributors
© 2025 Creative Commons License
69eaa205

Documentation generated by FORD on 2025-02-28 09:25