1 #include "BSprivate.h"
2 
3 /*+ BSlow2high - A translation from a higher level matrix to a lower level
4                  matrix
5 
6     Input Parameters:
7 .   A - the sparse matrix (low level)
8 .   number - the high level numbering
9 .   distr - the high level distribution
10 .   procinfo - the usual processor information
11 
12     Returns:
13     A numbering of length len(distr)+1 translating from high to low
14 
15 	Notes:
16     For example, this routine is used to find the global row number for
17     the first row in each i-node.
18 
19  +*/
BSlow2high(BSspmat * A,BSnumbering * number,BSdistribution * distr,BSprocinfo * procinfo)20 BSnumbering *BSlow2high(BSspmat *A, BSnumbering *number,
21 		BSdistribution *distr, BSprocinfo *procinfo)
22 {
23 	int	i;
24 	int	ind;
25 	BSnumbering *l2h;
26 
27 	l2h = BSalloc_numbering(distr->max+1); CHKERRN(0);
28 
29 	for (i=0;i<distr->max+1;i++) l2h->numbers[i] = -1;
30 	for (i=0;i<number->length;i++) {
31 		ind = number->numbers[i];
32 		if (l2h->numbers[ind] < 0) {
33 			(*A->map->flocal2global)(1,&i,&(l2h->numbers[ind]),procinfo,A->map);
34 			CHKERRN(0);
35 		}
36 	}
37 	return(l2h);
38 }
39