Commit 2fef23a1 authored by Mathieu Faverge's avatar Mathieu Faverge

Fix tshqr

parent 46e54e52
......@@ -81,7 +81,7 @@ libhqr_initmtx_tshqr( libhqr_tree_t *qrtree,
libhqr_tile_args_t *args;
libhqr_tile_info_t *tileinfo;
int *pivots;
int low_mt, j, k, l;
int j, k, l;
if (qrtree == NULL) {
fprintf(stderr, "libhqr_hqr_init, illegal value of qrtree");
......@@ -105,8 +105,6 @@ libhqr_initmtx_tshqr( libhqr_tree_t *qrtree,
qrtree->mt = (trans == LIBHQR_TSQR) ? A->mt : A->nt;
qrtree->nt = kt;
low_mt = qrtree->mt;
qrtree->p = 1;
qrtree->a = 1;
......@@ -130,7 +128,7 @@ libhqr_initmtx_tshqr( libhqr_tree_t *qrtree,
tileinfo[0].first_nextpiv = qrtree->mt;
tileinfo[0].first_prevpiv = qrtree->mt;
for (j=1; j<low_mt-lt; j++, l++) {
for (j=1; j<qrtree->mt-lt; j++, l++) {
tileinfo[j].type = LIBHQR_KILLED_BY_TS;
tileinfo[j].index = -2;
tileinfo[j].currpiv = 0;
......@@ -152,9 +150,24 @@ libhqr_initmtx_tshqr( libhqr_tree_t *qrtree,
tileinfo[0].first_prevpiv = j;
}
/* Add the new element when performing a TT kernel */
if ( lt > 0 ) {
int last = qrtree->mt-lt;
for( j=last; j<qrtree->mt; j++ ) {
tileinfo[j].type = -1;
tileinfo[j].index = -1;
tileinfo[j].currpiv = -1;
tileinfo[j].nextpiv = -1;
tileinfo[j].prevpiv = -1;
tileinfo[j].first_nextpiv = -1;
tileinfo[j].first_prevpiv = -1;
}
lt--;
}
/* Let's register elt1 as the first pivot */
pivots[k] = 0;
lt--;
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment