22 #define SOLVER_PSDPI 72
23 #define SOLVER_PSPICTSIZE 6.6
57 const char *directory )
65 pictsize = (double) (solvptr->nodenbr + 1);
67 fprintf (stream,
"%%!PS-Adobe-2.0 EPSF-2.0\n");
68 fprintf (stream,
"%%%%Title: pastixSymbolmatrix (%ld,%ld,%ld)\n",
69 (
long) solvptr->cblknbr, (
long) solvptr->bloknbr, (
long)solvptr->nodenbr);
70 fprintf (stream,
"%%%%Creator: pastixSymbolDraw (LaBRI, Universite Bordeaux I)\n");
71 fprintf (stream,
"%%%%CreationDate: %s", ctime (&picttime));
72 fprintf (stream,
"%%%%BoundingBox: 0 0 %ld %ld\n",
73 (
long) (SOLVER_PSPICTSIZE * SOLVER_PSDPI),
74 (
long) (SOLVER_PSPICTSIZE * SOLVER_PSDPI));
75 fprintf (stream,
"%%%%Pages: 0\n");
76 fprintf (stream,
"%%%%EndComments\n");
77 fprintf (stream,
"/c { 4 2 roll pop pop newpath 2 copy 2 copy moveto dup lineto dup lineto closepath fill } bind def\n");
78 fprintf (stream,
"/d { 4 2 roll pop pop newpath 2 copy 2 copy moveto dup lineto dup lineto closepath } bind def\n");
79 fprintf (stream,
"/b { 4 copy 2 index exch moveto lineto dup 3 index lineto exch lineto closepath fill pop } bind def\n");
80 fprintf (stream,
"/a { 4 copy 2 index exch moveto lineto dup 3 index lineto exch lineto closepath pop } bind def\n");
81 fprintf (stream,
"/r { setrgbcolor } bind def\n");
82 fprintf (stream,
"/g { setgray } bind def\n");
84 fprintf (stream,
"0 setlinecap\n");
85 fprintf (stream,
"%f dup scale\n",
86 (
double) SOLVER_PSDPI * SOLVER_PSPICTSIZE / pictsize);
87 fprintf (stream,
"/Times-Roman 70 selectfont\n");
88 fprintf (stream,
"[ 1 0 0 -1 0 %d ] concat\n",
89 (
int) (solvptr->nodenbr + 1));
91 fprintf (stream,
"0 0\n");
92 for (cblknum = 0; cblknum < solvptr->cblknbr; cblknum ++) {
103 if ((coloval[0] == coloval[1]) &&
104 (coloval[1] == coloval[2])) {
105 fprintf (stream,
"%.2g g ",
109 fprintf (stream,
"%.2g %.2g %.2g r \n",
110 (
float) coloval[0], (
float) coloval[1], (
float) coloval[2]);
113 fprintf (stream,
"%ld\t%ld\tc\n",
114 (
long) (cblk->
fcolnum - solvptr->baseval),
115 (
long) (cblk->
lcolnum - solvptr->baseval + 1));
118 for (; blok<lblok; blok++)
120 if ( !(cblk->
cblktype & CBLK_COMPRESSED) ) {
121 fprintf (stream,
"%.2g %.2g %.2g r \n",
126 pastix_int_t conso_dense = 2*nrows*ncols;
127 pastix_int_t conso_LR = 0;
131 conso_LR += (((nrows+ncols) * blok->
LRblock[0]->
rk));
134 conso_LR += nrows*ncols;
137 conso_LR += (((nrows+ncols) * blok->
LRblock[1]->
rk));
140 conso_LR += nrows*ncols;
143 gain = 1.0 * conso_dense / conso_LR;
147 fprintf(stream,
"%.2g %.2g %.2g r \n",
151 else if (gain < 5.) {
152 fprintf(stream,
"%.2g %.2g %.2g r \n",
157 float color = 0.5 + (gain-5) / 10.;
161 fprintf(stream,
"%.2g %.2g %.2g r \n",
166 fprintf (stream,
"%ld\t%ld\tb\n",
167 (
long) (blok->
frownum - solvptr->baseval),
168 (
long) (blok->
lrownum - solvptr->baseval + 1));
176 FILE *fd1, *fd2, *fd3;
177 int original_cblk = 1;
179 int factoLU = (solvptr->factotype ==
PastixFactLU) ? 1 : 0;
185 fprintf(fd3,
"%ld\n", (
long)(solvptr->bloknbr-solvptr->cblknbr));
187 fprintf (stream,
"0 0\n");
188 for (cblknum = 0; cblknum < solvptr->cblknbr; cblknum ++) {
189 int unused, nb_contrib;
190 SolverCblk *cblk = &solvptr->cblktab[cblknum];
194 if ( 3 != fscanf(fd2,
"%d %d %d\n", &unused, &nb_contrib, &original_cblk) ) {
195 fclose(fd1); fclose(fd2); fclose(fd3);
198 fprintf (stream,
"%.2g g %ld\t%ld\tc\n",
200 (
long) (cblk->
fcolnum - solvptr->baseval),
201 (
long) (cblk->
lcolnum - solvptr->baseval + 1));
202 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
203 fprintf (stream,
"%ld\t%ld\t4 copy 3 index exch moveto [ 1 0 0 -1 0 0 ] concat 0.0 0.0 0.0 setrgbcolor (%d) show [ 1 0 0 -1 0 0 ] concat pop\n",
204 (
long) (cblk->
fcolnum - solvptr->baseval),
205 (
long) (cblk->
lcolnum - solvptr->baseval + 1),
210 for (; blok<lblok; blok++)
212 int unused, nb_contrib;
215 if ( 2 != fscanf(fd1,
"%d %d\n", &unused, &nb_contrib) ) {
216 fclose(fd1); fclose(fd2); fclose(fd3);
219 fprintf (stream,
"%ld\t%ld\ta\n",
220 (
long) (blok->
frownum - solvptr->baseval),
221 (
long) (blok->
lrownum - solvptr->baseval + 1));
222 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
224 pastix_int_t conso_dense = 2*nrows*ncols;
225 pastix_int_t conso_LR = 0;
226 fprintf (stream,
"%ld\t%ld\t4 copy 3 index exch moveto [ 1 0 0 -1 0 0 ] concat 1.0 1.0 1.0 setrgbcolor (%d) show [ 1 0 0 -1 0 0 ] concat pop\n",
227 (
long) (blok->
frownum - solvptr->baseval),
228 (
long) (blok->
lrownum - solvptr->baseval + 1),
232 conso_LR += (((nrows+ncols) * blok->
LRblock[0]->
rk));
235 conso_LR += nrows*ncols;
239 conso_LR += (((nrows+ncols) * blok->
LRblock[1]->
rk));
242 conso_LR += nrows*ncols;
246 gain = 1.0 * conso_dense / conso_LR;
250 fprintf(fd3,
"%d\n%f\n", nb_contrib, gain);
253 if (original_cblk == 0){
268 fprintf (stream,
"pop pop\n");
269 o = fprintf (stream,
"showpage\n");
272 return ((o != EOF) ? 0 : 1);