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)
69 s(2) =
size(self%A, 2)*
size(self%A, 3)
82 character(len=*),
parameter :: this_sub_name =
"sll_t_linear_operator_matrix_stencil_to_dense_new % dot"
83 character(len=64) :: err_msg
89 associate(p1 => -lbound(x%array, 1) + 1, &
90 p2 => -lbound(x%array, 2) + 1)
92 associate(nx1 => ubound(x%array, 1) - p1, &
93 nx2 => ubound(x%array, 2) - p2)
100 sll_assert(self%s1 ==
size(y%array))
105 do i = 1,
size(y%array)
111 temp = temp + self%A(i, j1, j2)*x%array(j1, j2)
115 y%array(i) = y%array(i) + temp
121 err_msg =
"y must be of type sll_t_vector_space_real_array_1d"
122 sll_error(this_sub_name, err_msg)
131 err_msg =
"x must be of type sll_t_vector_space_real_array_2d"
132 sll_error(this_sub_name, err_msg)
141 class(sll_c_vector_space),
intent(in) :: x
142 class(sll_c_vector_space),
intent(inout) :: y
147 character(len=*),
parameter :: this_sub_name =
"sll_t_linear_operator_matrix_stencil_to_dense_new % dot"
148 character(len=64) :: err_msg
152 type is (sll_t_vector_space_real_array_2d)
154 associate(p1 => -lbound(x%array, 1) + 1, &
155 p2 => -lbound(x%array, 2) + 1)
157 associate(nx1 => ubound(x%array, 1) - p1, &
158 nx2 => ubound(x%array, 2) - p2)
162 type is (sll_t_vector_space_real_array_1d)
165 sll_assert(self%s1 ==
size(y%array))
168 do i = 1,
size(y%array)
174 temp = temp + self%A(i, j1, j2)*x%array(j1, j2)
178 y%array(i) = y%array(i) + temp
184 err_msg =
"y must be of type sll_t_vector_space_real_array_1d"
185 sll_error(this_sub_name, err_msg)
194 err_msg =
"x must be of type sll_t_vector_space_real_array_2d"
195 sll_error(this_sub_name, err_msg)
subroutine s_linear_operator_matrix_stencil_to_dense_new__dot(self, x, y)
subroutine s_linear_operator_matrix_stencil_to_dense_new__dot_incr(self, x, y)
subroutine s_linear_operator_matrix_stencil_to_dense_new__init(self, s1, s2, s3)
integer function, dimension(2) f_linear_operator_matrix_stencil_to_dense_new__get_shape(self)
subroutine s_linear_operator_matrix_stencil_to_dense_new__free(self)
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.