t remains to describe a recipe for construction of the maps
,
,
.
The map
indexes a matrix. We choose the "rowbyrow" indexing.
If
then
Therefore,
if
then
and
With
so defined we can calculate the
arrays
in parallel.
Therefore, to identify the mappings
and
it suffices to map domains of these mappings into the domain of
.
For each
from domain of
we perform on a separate thread the following
calculation:
where the last set is the set of numbers in domain of
.
The total size of calculated data is known apriori after the arrays
have been calculated. Hence, after we calculate each
on a separate thread, we do not need to merge data because the collection can
happen directly into correct place.
To be precise,
let
and
is obtained via the procedure of the section
(
Calculation of
partial sums in parallel
). We allocate an
array
For every
(thread index) we
calculate
as described above. We allocate the result into
as follows. For
the result is placed
into
For
the result is placed
into
For any
the result is placed
into
The result
is the indexing of the boundary subdomains
and
is enumeration of the boundary subdomains.
The
case is almost identical. We replace
with
Indeed, we are interested in the
area
We arrive to the following
procedure.
Allocate
and, for every
,
place result
of
into
.
Then
is the indexing of the internal subdomains
and
is enumeration of the internal subdomains.
