37 use num_types,
only: rp
56 integer,
intent(in) :: n
57 real(kind=rp),
intent(in) :: f_min, f_max, q
58 real(kind=rp),
dimension(n),
intent(out) :: x_out
59 real(kind=rp),
dimension(n),
intent(in) :: x_in
61 x_out = convex_down_ramp_mapping_kernel(f_min, f_max, q, x_in)
74 sens_out, sens_in, X_in, n)
75 integer,
intent(in) :: n
76 real(kind=rp),
intent(in) :: f_min, f_max, q
77 real(kind=rp),
dimension(n),
intent(out) :: sens_out
78 real(kind=rp),
dimension(n),
intent(in) :: sens_in
79 real(kind=rp),
dimension(n),
intent(in) :: x_in
81 sens_out = convex_down_ramp_mapping_backward_kernel(f_min, f_max, q, &
94 integer,
intent(in) :: n
95 real(kind=rp),
intent(in) :: f_min, f_max, q
96 real(kind=rp),
dimension(n),
intent(out) :: x_out
97 real(kind=rp),
dimension(n),
intent(in) :: x_in
99 x_out = convex_up_ramp_mapping_kernel(f_min, f_max, q, x_in)
112 sens_out, sens_in, X_in, n)
113 integer,
intent(in) :: n
114 real(kind=rp),
intent(in) :: f_min, f_max, q
115 real(kind=rp),
dimension(n),
intent(out) :: sens_out
116 real(kind=rp),
dimension(n),
intent(in) :: sens_in
117 real(kind=rp),
dimension(n),
intent(in) :: x_in
119 sens_out = convex_up_ramp_mapping_backward_kernel(f_min, f_max, q, &
130 elemental function convex_down_ramp_mapping_kernel(f_min, f_max, q, X_in) &
132 real(kind=rp),
intent(in) :: f_min, f_max, q
133 real(kind=rp),
intent(in) :: x_in
134 real(kind=rp) :: x_out
136 x_out = f_min + (f_max - f_min) * x_in / (1.0_rp + q * (1.0_rp - x_in))
138 end function convex_down_ramp_mapping_kernel
147 elemental function convex_down_ramp_mapping_backward_kernel(f_min, f_max, q, &
148 sens_in, X_in)
result(sens_out)
149 real(kind=rp),
intent(in) :: f_min, f_max, q
150 real(kind=rp),
intent(in) :: sens_in, x_in
151 real(kind=rp) :: sens_out
153 sens_out = sens_in * (f_max - f_min) * (q + 1.0_rp) / &
154 ((1.0_rp - q * (x_in - 1.0_rp))**2)
156 end function convex_down_ramp_mapping_backward_kernel
164 elemental function convex_up_ramp_mapping_kernel(f_min, f_max, q, X_in) &
166 real(kind=rp),
intent(in) :: f_min, f_max, q
167 real(kind=rp),
intent(in) :: x_in
168 real(kind=rp) :: x_out
170 x_out = f_min + (f_max - f_min) * x_in * (1.0_rp + q) / (x_in + q)
172 end function convex_up_ramp_mapping_kernel
181 elemental function convex_up_ramp_mapping_backward_kernel(f_min, f_max, q, &
182 sens_in, X_in)
result(sens_out)
183 real(kind=rp),
intent(in) :: f_min, f_max, q
184 real(kind=rp),
intent(in) :: sens_in, x_in
185 real(kind=rp) :: sens_out
187 sens_out = sens_in * (f_max - f_min) * (q + 1.0_rp) * q / ((x_in + q)**2)
189 end function convex_up_ramp_mapping_backward_kernel
CPU backend for RAMP mapping operations.
subroutine, public convex_down_ramp_mapping_apply_backward_cpu(f_min, f_max, q, sens_out, sens_in, x_in, n)
Apply convex-down RAMP chain rule on CPU.
subroutine, public convex_up_ramp_mapping_apply_backward_cpu(f_min, f_max, q, sens_out, sens_in, x_in, n)
Apply convex-up RAMP chain rule on CPU.
subroutine, public convex_up_ramp_mapping_apply_cpu(f_min, f_max, q, x_out, x_in, n)
Apply convex-up RAMP forward mapping on CPU.
subroutine, public convex_down_ramp_mapping_apply_cpu(f_min, f_max, q, x_out, x_in, n)
Apply convex-down RAMP forward mapping on CPU.