A module for handling compressed vectors. Compressed vectors are stored in two lists. The first is a list of indices, the second a list of values. This module can add two of those vectors together.
More...
|
pure subroutine, public | addsparsevectors (inner_index_a, values_a, inner_index_b, values_b, inner_index_c, values_c, total_values_c, alpha_in, threshold_in) |
| Add together two sparse vectors. C = A + alpha*B. More...
|
|
pure real(ntreal) function, public | dotsparsevectors (inner_index_a, values_a, inner_index_b, values_b) |
| product = dot(A,B) More...
|
|
pure subroutine, public | pairwisemultiplyvectors (inner_index_a, values_a, inner_index_b, values_b, inner_index_c, values_c, total_values_c) |
| Pairwise Multiply Vectors C = A Mult B. More...
|
|
A module for handling compressed vectors. Compressed vectors are stored in two lists. The first is a list of indices, the second a list of values. This module can add two of those vectors together.
◆ addsparsevectors()
pure subroutine, public sparsevectormodule::addsparsevectors |
( |
integer, dimension(:), intent(in) |
inner_index_a, |
|
|
real(ntreal), dimension(:), intent(in) |
values_a, |
|
|
integer, dimension(:), intent(in) |
inner_index_b, |
|
|
real(ntreal), dimension(:), intent(in) |
values_b, |
|
|
integer, dimension(:), intent(out) |
inner_index_c, |
|
|
real(ntreal), dimension(:), intent(out) |
values_c, |
|
|
integer, intent(out) |
total_values_c, |
|
|
real(ntreal), intent(in), optional |
alpha_in, |
|
|
real(ntreal), intent(in), optional |
threshold_in |
|
) |
| |
Add together two sparse vectors. C = A + alpha*B.
- Parameters
-
[in] | inner_index_a | list of indices for A. |
[in] | values_a | list of values for A. |
[in] | inner_index_b | list of indices for B. |
[in] | values_b | list of values for B. |
[out] | inner_index_c | list of indices computed for C. |
[out] | values_c | list of values computed for C. |
[out] | total_values_c | this is the total number of values in C. |
[in] | alpha_in | value to scale VecB by. Optional, default is 1.0. |
[in] | threshold_in | for flushing values to zero. Default value is 0.0. The values that are returned for C are only valid in the range (1:total_values_c). We do not do an automatic shrinking of the array to keep this routine low in overhead. |
- Todo:
- in principal this can be done without any branching.
◆ dotsparsevectors()
pure real(ntreal) function, public sparsevectormodule::dotsparsevectors |
( |
integer, dimension(:), intent(in) |
inner_index_a, |
|
|
real(ntreal), dimension(:), intent(in) |
values_a, |
|
|
integer, dimension(:), intent(in) |
inner_index_b, |
|
|
real(ntreal), dimension(:), intent(in) |
values_b |
|
) |
| |
product = dot(A,B)
- Parameters
-
[in] | inner_index_a | list of indices for A. |
[in] | values_a | list of values for A. |
[in] | inner_index_b | list of indices for B. |
[in] | values_b | list of values for B. |
◆ pairwisemultiplyvectors()
pure subroutine, public sparsevectormodule::pairwisemultiplyvectors |
( |
integer, dimension(:), intent(in) |
inner_index_a, |
|
|
real(ntreal), dimension(:), intent(in) |
values_a, |
|
|
integer, dimension(:), intent(in) |
inner_index_b, |
|
|
real(ntreal), dimension(:), intent(in) |
values_b, |
|
|
integer, dimension(:), intent(out) |
inner_index_c, |
|
|
real(ntreal), dimension(:), intent(out) |
values_c, |
|
|
integer, intent(out) |
total_values_c |
|
) |
| |
Pairwise Multiply Vectors C = A Mult B.
- Parameters
-
[in] | inner_index_a | list of indices for A. |
[in] | values_a | list of values for A. |
[in] | inner_index_b | list of indices for B. |
[in] | values_b | list of values for B. |
[out] | inner_index_c | list of indices computed for C. |
[out] | values_c | list of values computed for C. |
[out] | total_values_c | this is the total number of values in C. |