7 module function f1h_fcn(this, x) result(f)
8 class(fcn1var_helper),
intent(in) :: this
9 real(real64),
intent(in) :: x
11 if (
associated(this%m_fcn))
then
17 module function f1h_is_fcn_defined(this) result(x)
18 class(fcn1var_helper),
intent(in) :: this
20 x =
associated(this%m_fcn)
24 module subroutine f1h_set_fcn(this, fcn)
25 class(fcn1var_helper),
intent(inout) :: this
26 procedure(fcn1var),
intent(in),
pointer :: fcn
31 module function f1h_is_diff_defined(this) result(x)
32 class(fcn1var_helper),
intent(in) :: this
34 x =
associated(this%m_diff)
38 module function f1h_diff_fcn(this, x, f) result(df)
40 class(fcn1var_helper),
intent(in) :: this
41 real(real64),
intent(in) :: x
42 real(real64),
intent(in),
optional :: f
46 real(real64),
parameter :: zero = 0.0d0
49 real(real64) :: eps, epsmch, h, temp, f1, f0
52 epsmch = epsilon(epsmch)
56 if (this%is_derivative_defined())
then
62 if (h < epsmch) h = eps
75 module subroutine f1h_set_diff(this, diff)
76 class(fcn1var_helper),
intent(inout) :: this
77 procedure(fcn1var),
pointer,
intent(in) :: diff