3 #include "sll_assert.h"
4 #include "sll_errors.h"
26 real(
wp),
allocatable :: a(:, :)
27 real(
wp),
allocatable :: at(:, :)
30 logical :: transposed = .false.
52 integer,
intent(in) :: s1
53 integer,
intent(in) :: s2
54 logical,
optional,
intent(in) :: transposed
56 if (
present(transposed)) self%transposed = transposed
58 if (self%transposed)
then
59 allocate (self%At(s1, s2))
61 allocate (self%A(s1, s2))
74 if (self%transposed)
then
88 integer :: nx(1), ny(1), n(2)
90 character(len=*),
parameter :: this_sub_name =
"sll_t_linear_operator_matrix_dense_to_dense % dot"
91 character(len=64) :: err_msg
101 sll_assert(n(2) == nx(1))
109 sll_assert(n(1) == ny(1))
111 if (self%transposed)
then
112 y%array = matmul(x%array, self%At)
114 y%array = matmul(self%A, x%array)
118 err_msg =
"y must be of type sll_t_vector_space_real_array_1d"
119 sll_error(this_sub_name, err_msg)
124 err_msg =
"x must be of type sll_t_vector_space_real_array_1d"
125 sll_error(this_sub_name, err_msg)
137 integer :: nx(1), ny(1), n(2)
139 character(len=*),
parameter :: this_sub_name =
"sll_t_linear_operator_matrix_dense_to_dense % dot"
140 character(len=64) :: err_msg
150 sll_assert(n(2) == nx(1))
158 sll_assert(n(1) == ny(1))
160 if (self%transposed)
then
161 y%array = y%array + matmul(x%array, self%At)
163 y%array = y%array + matmul(self%A, x%array)
167 err_msg =
"y must be of type sll_t_vector_space_real_array_1d"
168 sll_error(this_sub_name, err_msg)
173 err_msg =
"x must be of type sll_t_vector_space_real_array_1d"
174 sll_error(this_sub_name, err_msg)
184 if (self%transposed)
then
subroutine s_linear_operator_matrix_dense_to_dense__dot(self, x, y)
subroutine s_linear_operator_matrix_dense_to_dense__free(self)
integer function, dimension(2) f_linear_operator_matrix_dense_to_dense__get_shape(self)
subroutine s_linear_operator_matrix_dense_to_dense__dot_incr(self, x, y)
subroutine s_linear_operator_matrix_dense_to_dense__init(self, s1, s2, transposed)
Abstract type implementing a generic vector space.
Vector space for wrapping 1D 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.