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 ptrsizebuff, pptrbuff, ptrblock,
178 ma, ia, ja, templateheight0, templatewidth0,
179 mb, ib, jb, templateheight1, templatewidth1)
180 Int action, *ptrsizebuff;
182 float **pptrbuff, *ptrblock;
183 Int templateheight0, templatewidth0;
184 Int templateheight1, templatewidth1;
186 Int ia, ja, ib, jb, m, n;
198 assert(j >= 0 && j < n);
200 insidemat(uplo, diag, start, j, m, n, &offset);
206 intervalsize =
min(end - start, nbline);
207 (*ptrsizebuff) += intervalsize;
210 ptrstart = ptrblock +
localindice(start + ia, j + ja,
211 templateheight0, templatewidth0, ma);
212 memcpy((
char *) (*pptrbuff), (
char *) ptrstart,
213 intervalsize *
sizeof(
float));
216 (*pptrbuff) += intervalsize;
219 ptrstart = ptrblock +
localindice(start + ib, j + jb,
220 templateheight1, templatewidth1, mb);
221 memcpy((
char *) ptrstart, (
char *) (*pptrbuff),
222 intervalsize *
sizeof(
float));
225 (*pptrbuff) += intervalsize;
230 printf(
"action is %d outside the scope of the case [0..2] !! \n ", action);
240scan_intervals(type, ja, jb, n, ma, mb, q0, q1, col0, col1,
243 Int ja, jb, n, q0, q1, col0, col1;
247 Int offset, j0, j1, templatewidth0, templatewidth1, nbcol0, nbcol1;
249 assert(type ==
'c' || type ==
'r');
250 nbcol0 = (type ==
'c' ? ma->
nbcol : ma->
nbrow);
251 nbcol1 = (type ==
'c' ? mb->
nbcol : mb->
nbrow);
252 templatewidth0 = q0 * nbcol0;
253 templatewidth1 = q1 * nbcol1;
257 j0 =
SHIFT(col0, sp0, q0) * nbcol0 - ja;
258 j1 =
SHIFT(col1, sp1, q1) * nbcol1 - jb;
265 assert(j0 + nbcol0 > 0);
266 assert(j1 + nbcol1 > 0);
267 while ((j0 < n) && (j1 < n)) {
273 j0 += templatewidth0;
278 j1 += templatewidth1;
283 start =
max(start, 0);
285 result[offset].
gstart = start;
286 end =
min(end0, end1);
288 j0 += templatewidth0;
292 j1 += templatewidth1;
302 result[offset].
len = end - start;
310scanD0(uplo, diag, action, ptrbuff, ptrsizebuff,
324 IDESC *v_inter, *h_inter;
325 Int vinter_nb, hinter_nb;
332 Int templateheight1, templatewidth1;
333 Int templateheight0, templatewidth0;
336 templateheight1 = p1 * mb->
nbrow;
337 templateheight0 = p0 * ma->
nbrow;
338 templatewidth1 = q1 * mb->
nbcol;
339 templatewidth0 = q0 * ma->
nbcol;
344 for (h = 0; h < hinter_nb; h++)
345 for (v = 0; v < vinter_nb; v++) {
347 for (j = 0; j < h_inter[h].
len; j++)
348 intersect(uplo, diag, j + h_inter[h].gstart,
349 v_inter[v].gstart, v_inter[v].gstart + v_inter[v].len,
350 action, ptrsizebuff, &ptrbuff, ptrblock, m, n,
351 ma, ia, ja, templateheight0, templatewidth0,
352 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, float **pptrbuff, float *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)