144 assert(j >= 0 && j < n);
146 if (toupper(*uplo) ==
'U') {
150 virtualnbline =
max(m - n, 0) + j + (toupper(*diag) ==
'N');
151 nbline =
min(virtualnbline, m);
159 diagcol =
max(n - m, 0);;
160 virtualline = j - diagcol + (toupper(*diag) ==
'U');
161 firstline =
max(0, virtualline);
162 off =
max(firstline - i, 0);
176 Int *ptrsizebuff,
Int **pptrbuff,
Int *ptrblock,
190 assert(j >= 0 && j < n);
192 insidemat(uplo, diag, start, j, m, n, &offset);
198 intervalsize =
min(end - start, nbline);
199 (*ptrsizebuff) += intervalsize;
202 ptrstart = ptrblock +
localindice(start + ia, j + ja,
203 templateheight0, templatewidth0, ma);
204 memcpy((
char *) (*pptrbuff), (
char *) ptrstart,
205 intervalsize *
sizeof(
Int));
208 (*pptrbuff) += intervalsize;
211 ptrstart = ptrblock +
localindice(start + ib, j + jb,
212 templateheight1, templatewidth1, mb);
213 memcpy((
char *) ptrstart, (
char *) (*pptrbuff),
214 intervalsize *
sizeof(
Int));
217 (*pptrbuff) += intervalsize;
222 printf(
"action is %d outside the scope of the case [0..2] !! \n ", action);
232scan_intervals(type, ja, jb, n, ma, mb, q0, q1, col0, col1,
235 Int ja, jb, n, q0, q1, col0, col1;
239 Int offset, j0, j1, templatewidth0, templatewidth1, nbcol0, nbcol1;
241 assert(type ==
'c' || type ==
'r');
242 nbcol0 = (type ==
'c' ? ma->
nbcol : ma->
nbrow);
243 nbcol1 = (type ==
'c' ? mb->
nbcol : mb->
nbrow);
244 templatewidth0 = q0 * nbcol0;
245 templatewidth1 = q1 * nbcol1;
249 j0 =
SHIFT(col0, sp0, q0) * nbcol0 - ja;
250 j1 =
SHIFT(col1, sp1, q1) * nbcol1 - jb;
257 assert(j0 + nbcol0 > 0);
258 assert(j1 + nbcol1 > 0);
259 while ((j0 < n) && (j1 < n)) {
265 j0 += templatewidth0;
270 j1 += templatewidth1;
275 start =
max(start, 0);
277 result[offset].
gstart = start;
278 end =
min(end0, end1);
280 j0 += templatewidth0;
284 j1 += templatewidth1;
294 result[offset].
len = end - start;
302scanD0(uplo, diag, action, ptrbuff, ptrsizebuff,
315 IDESC *v_inter, *h_inter;
316 Int vinter_nb, hinter_nb;
323 Int templateheight1, templatewidth1;
324 Int templateheight0, templatewidth0;
327 templateheight1 = p1 * mb->
nbrow;
328 templateheight0 = p0 * ma->
nbrow;
329 templatewidth1 = q1 * mb->
nbcol;
330 templatewidth0 = q0 * ma->
nbcol;
335 for (h = 0; h < hinter_nb; h++)
336 for (v = 0; v < vinter_nb; v++) {
338 for (j = 0; j < h_inter[h].
len; j++)
339 intersect(uplo, diag, j + h_inter[h].gstart,
340 v_inter[v].gstart, v_inter[v].gstart + v_inter[v].len,
341 action, ptrsizebuff, &ptrbuff, ptrblock, m, n,
342 ma, ia, ja, templateheight0, templatewidth0,
343 mb, ib, jb, templateheight1, templatewidth1);
static2 void intersect(char *uplo, char *diag, Int j, Int start, Int end, Int action, Int *ptrsizebuff, Int **pptrbuff, Int *ptrblock, Int m, Int n, MDESC *ma, Int ia, Int ja, Int templateheight0, Int templatewidth0, MDESC *mb, Int ib, Int jb, Int templateheight1, Int templatewidth1)
static2 Int insidemat(char *uplo, char *diag, Int i, Int j, Int m, Int n, Int *offset)