9 #include "sll_errors.h"
58 generic :: source => source_scalar, source_array
113 real(wp),
intent(in) :: a
158 real(wp),
intent(in) :: a
180 real(wp),
intent(in) :: a
201 real(wp),
intent(in) :: a
206 call self%source(temp)
227 real(wp),
intent(in) :: a(:)
233 call self%source(temp)
234 call self%mult(a(1), x(1))
237 call temp%mult(a(i), x(i))
258 real(wp),
intent(in) :: a(:)
264 call self%source(temp)
267 call temp%mult(a(i), x(i))
292 res = sqrt(self%inner(self))
311 sll_error(
"sll_c_vector_space % inner",
"Function not implemented.")
314 print *, storage_size(self), storage_size(x)
328 sll_warning(
"sll_c_vector_space % show",
"Overload this subroutine if you need it.")
330 print *, storage_size(self)
348 allocate (x, source=self)
367 integer,
intent(in) :: n
369 allocate (x(n), source=self)
Abstract type implementing a generic vector space.
subroutine s_vector_space__source_scalar(self, x)
Copy constructor: create one copy of vector z
subroutine s_vector_space__show(self)
Show something, for debug.
real(wp) function f_vector_space__norm(self)
Norm of vector: ||z||.
integer, parameter wp
Working precision.
subroutine s_vector_space__incr_mult(self, a, x)
z += a * x
subroutine s_vector_space__mult_add(self, a, x, y)
z = a * x + y
real(wp) function f_vector_space__inner(self, x)
Inner product: <z,x>
subroutine s_vector_space__add(self, x, y)
z = x + y
subroutine s_vector_space__lcmb(self, a, x)
z =
subroutine s_vector_space__source_array(self, x, n)
Copy constructor: create n copies of vector z
subroutine s_vector_space__incr_lcmb(self, a, x)
z +=
subroutine s_vector_space__mult(self, a, x)
z = a * x
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.