3 #include "sll_assert.h"
4 #include "sll_errors.h"
62 integer,
intent(in) :: n1(4)
63 integer,
intent(in) :: n2(4)
64 integer,
intent(in) :: p1
65 integer,
intent(in) :: p2
72 call self%block1%init(n1(1), n2(1))
73 call self%block2%init(n1(2), n2(2))
74 call self%block3%init(n1(3), n2(3))
75 call self%block4%init(n1(4), n2(4), p1, p2)
84 s = self%block1%get_shape() + self%block2%get_shape() + &
85 self%block3%get_shape() + self%block4%get_shape()
95 character(len=*),
parameter :: this_sub_name =
"sll_t_linear_operator_matrix_c1_block % dot"
96 character(len=64) :: err_msg
106 call self%block1%dot(x%vd, y%vd)
107 call self%block2%dot_incr(x%vs, y%vd)
108 call self%block3%dot(x%vd, y%vs)
109 call self%block4%dot_incr(x%vs, y%vs)
112 err_msg =
"y must be of type sll_t_vector_space_c1_block"
113 sll_error(this_sub_name, err_msg)
118 err_msg =
"x must be of type sll_t_vector_space_c1_block"
119 sll_error(this_sub_name, err_msg)
131 character(len=*),
parameter :: this_sub_name =
"sll_t_linear_operator_matrix_c1_block % dot_incr"
132 character(len=64) :: err_msg
142 call self%block1%dot_incr(x%vd, y%vd)
143 call self%block2%dot_incr(x%vs, y%vd)
144 call self%block3%dot_incr(x%vd, y%vs)
145 call self%block4%dot_incr(x%vs, y%vs)
148 err_msg =
"y must be of type sll_t_vector_space_c1_block"
149 sll_error(this_sub_name, err_msg)
154 err_msg =
"x must be of type sll_t_vector_space_c1_block"
155 sll_error(this_sub_name, err_msg)
164 real(wp),
intent(inout) :: A(:, :)
166 integer :: i, j, i1, i2, j1, j2, k1, k2
169 sll_assert(
size(a, 1) == self%n1(1) + self%n1(3))
170 sll_assert(
size(a, 2) == self%n2(1) + self%n2(2))
172 associate(n1 => self%n1, &
177 a(1:n1(1), 1:n2(1)) = self%block1%A(:, :)
178 a(1:n1(1), n2(1) + 1:n2(1) + n2(2)) = self%block2%A(:, :)
179 a(n1(1) + 1:n1(1) + n1(3), 1:n2(1)) = self%block3%A(:, :)
185 j1 = modulo(i1 - 1 + k1, n1(4)) + 1
186 j2 = modulo(i2 - 1 + k2, n2(4)) + 1
187 i = (i1 - 1)*n2(4) + i2
188 j = (j1 - 1)*n2(4) + j2
189 a(i + 3, j + 3) = self%block4%A(k1, k2, i1, i2)
203 call self%block1%free()
204 call self%block2%free()
205 call self%block3%free()
206 call self%block4%free()
subroutine s_linear_operator_matrix_c1_block__dot_incr(self, x, y)
integer function, dimension(2) f_linear_operator_matrix_c1_block__get_shape(self)
subroutine s_linear_operator_matrix_c1_block__to_array(self, A)
subroutine s_linear_operator_matrix_c1_block__dot(self, x, y)
subroutine s_linear_operator_matrix_c1_block__init(self, n1, n2, p1, p2)
subroutine s_linear_operator_matrix_c1_block__free(self)
Abstract type implementing a generic vector space.
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.