@@ -3,6 +3,7 @@ module forlab_math
3
3
4
4
use stdlib_kinds, only: sp, dp, qp, int8, int16, int32, int64
5
5
use stdlib_optval, only: optval
6
+ use stdlib_math, only: arange, is_close, all_close
6
7
implicit none
7
8
private
8
9
@@ -53,55 +54,6 @@ module forlab_math
53
54
#:endfor
54
55
end interface angle
55
56
56
- !> Version: experimental
57
- !>
58
- !> Returns a boolean scalar/array where two scalar/arrays are element-wise equal within a tolerance.
59
- !> ([Specification](../page/specs/forlab_math.html#is_close))
60
- interface is_close
61
- #:set RC_KINDS_TYPES = REAL_KINDS_TYPES + CMPLX_KINDS_TYPES
62
- #:for k1, t1 in RC_KINDS_TYPES
63
- elemental module logical function is_close_${t1[0]}$${k1}$(a, b, rel_tol, abs_tol, equal_nan) result(close)
64
- ${t1}$, intent(in) :: a, b
65
- real(${k1}$), intent(in), optional :: rel_tol, abs_tol
66
- logical, intent(in), optional :: equal_nan
67
- end function is_close_${t1[0]}$${k1}$
68
- #:endfor
69
- end interface is_close
70
-
71
- !> Version: experimental
72
- !>
73
- !> Returns a boolean scalar where two arrays are element-wise equal within a tolerance.
74
- !> ([Specification](../page/specs/forlab_math.html#all_close))
75
- interface all_close
76
- #:set RC_KINDS_TYPES = REAL_KINDS_TYPES + CMPLX_KINDS_TYPES
77
- #:set RANKS = range(1, MAXRANK + 1)
78
- #:for k1, t1 in RC_KINDS_TYPES
79
- #:for r1 in RANKS
80
- logical pure module function all_close_${r1}$_${t1[0]}$${k1}$(a, b, rel_tol, abs_tol, equal_nan) result(close)
81
- ${t1}$, intent(in) :: a${ranksuffix(r1)}$, b${ranksuffix(r1)}$
82
- real(${k1}$), intent(in), optional :: rel_tol, abs_tol
83
- logical, intent(in), optional :: equal_nan
84
- end function all_close_${r1}$_${t1[0]}$${k1}$
85
- #:endfor
86
- #:endfor
87
- end interface all_close
88
-
89
- !> Version: experimental
90
- !>
91
- !> `arange` creates a rank-1 `array` of the `integer/real` type
92
- !> with fixed-spaced values of given spacing, within a given interval.
93
- !> ([Specification](../page/specs/forlab_math.html#arange))
94
- interface arange
95
- #:set RI_KINDS_TYPES = REAL_KINDS_TYPES + INT_KINDS_TYPES
96
- #:for k1, t1 in RI_KINDS_TYPES
97
- pure module function arange_${t1[0]}$_${k1}$(start, end, step) result(result)
98
- ${t1}$, intent(in) :: start
99
- ${t1}$, intent(in), optional :: end, step
100
- ${t1}$, allocatable :: result(:)
101
- end function arange_${t1[0]}$_${k1}$
102
- #:endfor
103
- end interface arange
104
-
105
57
!> Version: experimental
106
58
!>
107
59
!> `signum` returns the sign of variables.
0 commit comments