kusano 7d535a
/*! @file mark_relax.c
kusano 7d535a
 * \brief Record the rows pivoted by the relaxed supernodes.
kusano 7d535a
 *
kusano 7d535a
 * 
kusano 7d535a
 * -- SuperLU routine (version 4.0) --
kusano 7d535a
 * Lawrence Berkeley National Laboratory
kusano 7d535a
 * June 1, 2009
kusano 7d535a
 * <\pre>
kusano 7d535a
 */
kusano 7d535a
#include "slu_ddefs.h"
kusano 7d535a
kusano 7d535a
/*! \brief
kusano 7d535a
 *
kusano 7d535a
 * 
kusano 7d535a
 * Purpose
kusano 7d535a
 * =======
kusano 7d535a
 *    mark_relax() - record the rows used by the relaxed supernodes.
kusano 7d535a
 * 
kusano 7d535a
 */
kusano 7d535a
int mark_relax(
kusano 7d535a
	int n,		    /* order of the matrix A */
kusano 7d535a
	int *relax_end,     /* last column in a relaxed supernode.
kusano 7d535a
			     * if j-th column starts a relaxed supernode,
kusano 7d535a
			     * relax_end[j] represents the last column of
kusano 7d535a
			     * this supernode. */
kusano 7d535a
	int *relax_fsupc,   /* first column in a relaxed supernode.
kusano 7d535a
			     * relax_fsupc[j] represents the first column of
kusano 7d535a
			     * j-th supernode. */
kusano 7d535a
	int *xa_begin,	    /* Astore->colbeg */
kusano 7d535a
	int *xa_end,	    /* Astore->colend */
kusano 7d535a
	int *asub,	    /* row index of A */
kusano 7d535a
	int *marker	    /* marker[j] is the maximum column index if j-th
kusano 7d535a
			     * row belongs to a relaxed supernode. */ )
kusano 7d535a
{
kusano 7d535a
    register int jcol, kcol;
kusano 7d535a
    register int i, j, k;
kusano 7d535a
kusano 7d535a
    for (i = 0; i < n && relax_fsupc[i] != EMPTY; i++)
kusano 7d535a
    {
kusano 7d535a
	jcol = relax_fsupc[i];	/* first column */
kusano 7d535a
	kcol = relax_end[jcol]; /* last column */
kusano 7d535a
	for (j = jcol; j <= kcol; j++)
kusano 7d535a
	    for (k = xa_begin[j]; k < xa_end[j]; k++)
kusano 7d535a
		marker[asub[k]] = jcol;
kusano 7d535a
    }
kusano 7d535a
    return i;
kusano 7d535a
}