3 #include "sll_assert.h"
4 #include "sll_errors.h"
28 real(
wp),
allocatable :: a(:, :, :)
51 integer,
intent(in) :: s1
52 integer,
intent(in) :: s2
53 integer,
intent(in) :: s3
55 allocate (self%A(s1, s2, s3))
68 s(1) =
size(self%A, 1)*
size(self%A, 2)
69 s(2) =
size(self%A, 3)
82 character(len=*),
parameter :: this_sub_name =
"sll_t_linear_operator_matrix_dense_to_stencil_new % dot"
83 character(len=64) :: err_msg
90 sll_assert(self%s3 ==
size(x%array))
96 associate(p1 => -lbound(y%array, 1) + 1, &
97 p2 => -lbound(y%array, 2) + 1)
99 associate(ny1 => ubound(y%array, 1) - p1, &
100 ny2 => ubound(y%array, 2) - p2)
110 do k = 1,
size(x%array)
111 temp = temp + self%A(j1, j2, k)*x%array(k)
114 y%array(j1, j2) = y%array(j1, j2) + temp
121 y%array(1 - p1:0, :) = y%array(ny1 - p1 + 1:ny1, :)
122 y%array(ny1 + 1:ny1 + p1, :) = y%array(1:p1, :)
123 y%array(:, 1 - p2:0) = y%array(:, ny2 - p2 + 1:ny2)
124 y%array(:, ny2 + 1:ny2 + p2) = y%array(:, 1:p2)
131 err_msg =
"y must be of type sll_t_vector_space_real_array_2d"
132 sll_error(this_sub_name, err_msg)
137 err_msg =
"x must be of type sll_t_vector_space_real_array_1d"
138 sll_error(this_sub_name, err_msg)
147 class(sll_c_vector_space),
intent(in) :: x
148 class(sll_c_vector_space),
intent(inout) :: y
153 character(len=*),
parameter :: this_sub_name =
"sll_t_linear_operator_matrix_dense_to_stencil_new % dot_incr"
154 character(len=64) :: err_msg
158 type is (sll_t_vector_space_real_array_1d)
161 sll_assert(self%s3 ==
size(x%array))
165 type is (sll_t_vector_space_real_array_2d)
167 associate(p1 => -lbound(y%array, 1) + 1, &
168 p2 => -lbound(y%array, 2) + 1)
170 associate(ny1 => ubound(y%array, 1) - p1, &
171 ny2 => ubound(y%array, 2) - p2)
179 do k = 1,
size(x%array)
180 temp = temp + self%A(j1, j2, k)*x%array(k)
183 y%array(j1, j2) = y%array(j1, j2) + temp
190 y%array(1 - p1:0, :) = y%array(ny1 - p1 + 1:ny1, :)
191 y%array(ny1 + 1:ny1 + p1, :) = y%array(1:p1, :)
192 y%array(:, 1 - p2:0) = y%array(:, ny2 - p2 + 1:ny2)
193 y%array(:, ny2 + 1:ny2 + p2) = y%array(:, 1:p2)
200 err_msg =
"y must be of type sll_t_vector_space_real_array_2d"
201 sll_error(this_sub_name, err_msg)
206 err_msg =
"x must be of type sll_t_vector_space_real_array_1d"
207 sll_error(this_sub_name, err_msg)
subroutine s_linear_operator_matrix_dense_to_stencil_new__dot(self, x, y)
subroutine s_linear_operator_matrix_dense_to_stencil_new__free(self)
subroutine s_linear_operator_matrix_dense_to_stencil_new__dot_incr(self, x, y)
integer function, dimension(2) f_linear_operator_matrix_dense_to_stencil_new__get_shape(self)
subroutine s_linear_operator_matrix_dense_to_stencil_new__init(self, s1, s2, s3)
Abstract type implementing a generic vector space.
Vector space for wrapping 1D Fortran real arrays.
Vector space for wrapping 2D Fortran real arrays.
Module to select the kind parameter.
integer, parameter, public f64
f64 is the kind type for 64-bit reals (double precision)
Abstract base class for all vector spaces.
Vector space for wrapping 1D Fortran real arrays.
Vector space for wrapping 2D Fortran real arrays.