21 #ifndef DOXYGEN_SHOULD_SKIP_THIS
23 #define SOLVER_PSDPI 72
24 #define SOLVER_PSPICTSIZE 6.6
59 const char *directory )
67 pictsize = (double) (solvptr->
nodenbr + 1);
69 fprintf (stream,
"%%!PS-Adobe-2.0 EPSF-2.0\n");
70 fprintf (stream,
"%%%%Title: pastixSymbolmatrix (%ld,%ld,%ld)\n",
72 fprintf (stream,
"%%%%Creator: pastixSymbolDraw (LaBRI, Universite Bordeaux I)\n");
73 fprintf (stream,
"%%%%CreationDate: %s", ctime (&picttime));
74 fprintf (stream,
"%%%%BoundingBox: 0 0 %ld %ld\n",
75 (
long) (SOLVER_PSPICTSIZE * SOLVER_PSDPI),
76 (
long) (SOLVER_PSPICTSIZE * SOLVER_PSDPI));
77 fprintf (stream,
"%%%%Pages: 0\n");
78 fprintf (stream,
"%%%%EndComments\n");
79 fprintf (stream,
"/c { 4 2 roll pop pop newpath 2 copy 2 copy moveto dup lineto dup lineto closepath fill } bind def\n");
80 fprintf (stream,
"/d { 4 2 roll pop pop newpath 2 copy 2 copy moveto dup lineto dup lineto closepath } bind def\n");
81 fprintf (stream,
"/b { 4 copy 2 index exch moveto lineto dup 3 index lineto exch lineto closepath fill pop } bind def\n");
82 fprintf (stream,
"/a { 4 copy 2 index exch moveto lineto dup 3 index lineto exch lineto closepath pop } bind def\n");
83 fprintf (stream,
"/r { setrgbcolor } bind def\n");
84 fprintf (stream,
"/g { setgray } bind def\n");
86 fprintf (stream,
"0 setlinecap\n");
87 fprintf (stream,
"%f dup scale\n",
88 (
double) SOLVER_PSDPI * SOLVER_PSPICTSIZE / pictsize);
89 fprintf (stream,
"/Times-Roman 70 selectfont\n");
90 fprintf (stream,
"[ 1 0 0 -1 0 %d ] concat\n",
93 fprintf (stream,
"0 0\n");
94 for (cblknum = 0; cblknum < solvptr->
cblknbr; cblknum ++) {
105 if ((coloval[0] == coloval[1]) &&
106 (coloval[1] == coloval[2])) {
107 fprintf (stream,
"%.2g g ",
111 fprintf (stream,
"%.2g %.2g %.2g r \n",
112 (
float) coloval[0], (
float) coloval[1], (
float) coloval[2]);
115 fprintf (stream,
"%ld\t%ld\tc\n",
120 for (; blok<lblok; blok++)
122 if ( !(cblk->
cblktype & CBLK_COMPRESSED) ) {
123 fprintf (stream,
"%.2g %.2g %.2g r \n",
133 conso_LR += (((nrows+ncols) * blok->
LRblock[0]->
rk));
136 conso_LR += nrows*ncols;
139 conso_LR += (((nrows+ncols) * blok->
LRblock[1]->
rk));
142 conso_LR += nrows*ncols;
145 gain = 1.0 * conso_dense / conso_LR;
149 fprintf(stream,
"%.2g %.2g %.2g r \n",
153 else if (gain < 5.) {
154 fprintf(stream,
"%.2g %.2g %.2g r \n",
159 float color = 0.5 + (gain-5) / 10.;
163 fprintf(stream,
"%.2g %.2g %.2g r \n",
168 fprintf (stream,
"%ld\t%ld\tb\n",
176 FILE *fd1, *fd2, *fd3;
177 int original_cblk = 1;
187 fprintf (stream,
"0 0\n");
188 for (cblknum = 0; cblknum < solvptr->
cblknbr; cblknum ++) {
189 int unused, nb_contrib;
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",
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",
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",
222 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
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",
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;
248 fprintf(fd3,
"%d\n%f\n", nb_contrib, gain);
251 if (original_cblk == 0){
265 fprintf (stream,
"pop pop\n");
266 o = fprintf (stream,
"showpage\n");
269 return ((o != EOF) ? 0 : 1);
BEGIN_C_DECLS typedef int pastix_int_t
int solverDraw(const SolverMatrix *const solvptr, FILE *const stream, int verbose, const char *directory)
Writes a PostScript picture of the low-rank solver matrix.
FILE * pastix_fopenw(const char *dirname, const char *filename, const char *mode)
Open a file in the unique directory of the pastix instance.
static pastix_int_t blok_rownbr(const SolverBlok *blok)
Compute the number of rows of a block.
static pastix_int_t cblk_colnbr(const SolverCblk *cblk)
Compute the number of columns in a column block.
pastix_factotype_t factotype
pastix_lrblock_t * LRblock[2]
SolverCblk *restrict cblktab
Solver column block structure.
Solver column block structure.