Compute the inner product vector or matrix .
This interface provides methods for computing the inner products between a basis
of real
or complex
vectors and a single vector
or another basis . Depending on the case, it
returns a one-dimensional array or a two-dimensional array
with the same type as .
The example below assumes that you have already extended the abstract_vector_rdp
class to define your own my_real_vector
type. It then computes the inner product
vector defined as .
type(my_real_vector), dimension(10) :: X
type(my_real_vector) :: y
real(dp), dimension(:), allocatable :: v
! ... Part of your code where you initialize everything ...
call innerprod(v, X, y)
! ... Rest of your code ...
Similarly, computing the matrix of inner products between two bases can be done as shown below.
type(my_real_vector), dimension(10) :: X
type(my_real_vector), dimension(10) :: Y
real(dp), dimension(:, :), allocatable :: M
! ... Part of your code where you initialize everything ...
call innerprod(M, X, Y)
! ... Rest of your code ...
Computes the inner product vector between
a basis X
of abstract_vector
and v
, a single abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(out) | :: | v(size(X)) |
Resulting inner-product vector. |
||
class(abstract_vector_rsp), | intent(in) | :: | X(:) |
Bases of |
||
class(abstract_vector_rsp), | intent(in) | :: | y |
Bases of |
Computes the inner product matrix between
two bases of abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(out) | :: | M(size(X),size(Y)) |
Resulting inner-product matrix. |
||
class(abstract_vector_rsp), | intent(in) | :: | X(:) |
Bases of |
||
class(abstract_vector_rsp), | intent(in) | :: | Y(:) |
Bases of |
Computes the inner product vector between
a basis X
of abstract_vector
and v
, a single abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(out) | :: | v(size(X)) |
Resulting inner-product vector. |
||
class(abstract_vector_rdp), | intent(in) | :: | X(:) |
Bases of |
||
class(abstract_vector_rdp), | intent(in) | :: | y |
Bases of |
Computes the inner product matrix between
two bases of abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(out) | :: | M(size(X),size(Y)) |
Resulting inner-product matrix. |
||
class(abstract_vector_rdp), | intent(in) | :: | X(:) |
Bases of |
||
class(abstract_vector_rdp), | intent(in) | :: | Y(:) |
Bases of |
Computes the inner product vector between
a basis X
of abstract_vector
and v
, a single abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(out) | :: | v(size(X)) |
Resulting inner-product vector. |
||
class(abstract_vector_csp), | intent(in) | :: | X(:) |
Bases of |
||
class(abstract_vector_csp), | intent(in) | :: | y |
Bases of |
Computes the inner product matrix between
two bases of abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(out) | :: | M(size(X),size(Y)) |
Resulting inner-product matrix. |
||
class(abstract_vector_csp), | intent(in) | :: | X(:) |
Bases of |
||
class(abstract_vector_csp), | intent(in) | :: | Y(:) |
Bases of |
Computes the inner product vector between
a basis X
of abstract_vector
and v
, a single abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(out) | :: | v(size(X)) |
Resulting inner-product vector. |
||
class(abstract_vector_cdp), | intent(in) | :: | X(:) |
Bases of |
||
class(abstract_vector_cdp), | intent(in) | :: | y |
Bases of |
Computes the inner product matrix between
two bases of abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(out) | :: | M(size(X),size(Y)) |
Resulting inner-product matrix. |
||
class(abstract_vector_cdp), | intent(in) | :: | X(:) |
Bases of |
||
class(abstract_vector_cdp), | intent(in) | :: | Y(:) |
Bases of |