147 assert(j >= 0 && j < n);
149 if (toupper(*uplo) ==
'U') {
153 virtualnbline =
max(m - n, 0) + j + (toupper(*diag) ==
'N');
154 nbline =
min(virtualnbline, m);
162 diagcol =
max(n - m, 0);;
163 virtualline = j - diagcol + (toupper(*diag) ==
'U');
164 firstline =
max(0, virtualline);
165 off =
max(firstline - i, 0);
179 ptrsizebuff, pptrbuff, ptrblock,
181 ma, ia, ja, templateheight0, templatewidth0,
182 mb, ib, jb, templateheight1, templatewidth1)
183 Int action, *ptrsizebuff;
186 Int templateheight0, templatewidth0;
187 Int templateheight1, templatewidth1;
189 Int ia, ja, ib, jb, m, n;
201 assert(j >= 0 && j < n);
203 insidemat(uplo, diag, start, j, m, n, &offset);
209 intervalsize =
min(end - start, nbline);
210 (*ptrsizebuff) += intervalsize;
213 ptrstart = ptrblock +
localindice(start + ia, j + ja,
214 templateheight0, templatewidth0, ma);
215 memcpy((
char *) (*pptrbuff), (
char *) ptrstart,
216 intervalsize *
sizeof(
complex));
219 (*pptrbuff) += intervalsize;
222 ptrstart = ptrblock +
localindice(start + ib, j + jb,
223 templateheight1, templatewidth1, mb);
224 memcpy((
char *) ptrstart, (
char *) (*pptrbuff),
225 intervalsize *
sizeof(
complex));
228 (*pptrbuff) += intervalsize;
233 printf(
"action is %d outside the scope of the case [0..2] !! \n ", action);
243scan_intervals(type, ja, jb, n, ma, mb, q0, q1, col0, col1,
246 Int ja, jb, n, q0, q1, col0, col1;
250 Int offset, j0, j1, templatewidth0, templatewidth1, nbcol0, nbcol1;
252 assert(type ==
'c' || type ==
'r');
253 nbcol0 = (type ==
'c' ? ma->
nbcol : ma->
nbrow);
254 nbcol1 = (type ==
'c' ? mb->
nbcol : mb->
nbrow);
255 templatewidth0 = q0 * nbcol0;
256 templatewidth1 = q1 * nbcol1;
260 j0 =
SHIFT(col0, sp0, q0) * nbcol0 - ja;
261 j1 =
SHIFT(col1, sp1, q1) * nbcol1 - jb;
268 assert(j0 + nbcol0 > 0);
269 assert(j1 + nbcol1 > 0);
270 while ((j0 < n) && (j1 < n)) {
276 j0 += templatewidth0;
281 j1 += templatewidth1;
286 start =
max(start, 0);
288 result[offset].
gstart = start;
289 end =
min(end0, end1);
291 j0 += templatewidth0;
295 j1 += templatewidth1;
305 result[offset].
len = end - start;
313scanD0(uplo, diag, action, ptrbuff, ptrsizebuff,
327 IDESC *v_inter, *h_inter;
328 Int vinter_nb, hinter_nb;
335 Int templateheight1, templatewidth1;
336 Int templateheight0, templatewidth0;
339 templateheight1 = p1 * mb->
nbrow;
340 templateheight0 = p0 * ma->
nbrow;
341 templatewidth1 = q1 * mb->
nbcol;
342 templatewidth0 = q0 * ma->
nbcol;
347 for (h = 0; h < hinter_nb; h++)
348 for (v = 0; v < vinter_nb; v++) {
350 for (j = 0; j < h_inter[h].
len; j++)
351 intersect(uplo, diag, j + h_inter[h].gstart,
352 v_inter[v].gstart, v_inter[v].gstart + v_inter[v].len,
353 action, ptrsizebuff, &ptrbuff, ptrblock, m, n,
354 ma, ia, ja, templateheight0, templatewidth0,
355 mb, ib, jb, templateheight1, templatewidth1);
static2 Int insidemat(char *uplo, char *diag, Int i, Int j, Int m, Int n, Int *offset)
static2 void intersect(char *uplo, char *diag, Int j, Int start, Int end, Int action, Int *ptrsizebuff, complex **pptrbuff, complex *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)