Fast Auxiliary Space Preconditioning  1.8.4 Feb/15/2016
graphics.c
Go to the documentation of this file.
1 
6 #include <math.h>
7 
8 #include "fasp.h"
9 #include "fasp_functs.h"
10 
11 static void put_byte(FILE *fp, const INT c);
12 static void put_word(FILE *fp, const INT w);
13 static void put_dword(FILE *fp, const INT d);
14 static INT write_bmp16(const char *fname, INT m, INT n, const char map[]);
15 
16 /*---------------------------------*/
17 /*-- Public Functions --*/
18 /*---------------------------------*/
19 
44 void fasp_dcsr_subplot (const dCSRmat *A,
45  const char *filename,
46  INT size)
47 {
48  INT m = A->row;
49  INT n = A->col;
50  INT i, j, k, minmn=MIN(m,n);
51 
52  if (size>minmn) size=minmn;
53 
54  printf("Writing matrix pattern to `%s'...\n",filename);
55 
56  char *map = (char *)fasp_mem_calloc(size * size, sizeof(char));
57  memset(map, 0x0F, size * size);
58 
59  for (i = 0; i < size; ++i) {
60  for (j = A->IA[i]; j < A->IA[i+1]; ++j) {
61  if (A->JA[j]<size) {
62  k = size*i + A->JA[j];
63  if (map[k] != 0x0F)
64  map[k] = 0x0F;
65  else if (A->val[j] > 1e-20)
66  map[k] = 0x09; /* bright blue */
67  else if (A->val[j] < -1e-20)
68  map[k] = 0x0C; /* bright red */
69  else
70  map[k] = 0x06; /* brown */
71  } // end if
72  } // end for j
73  } // end for i
74 
75  write_bmp16(filename, size, size, map);
76 
77  fasp_mem_free(map);
78 }
79 
105 void fasp_dbsr_subplot (const dBSRmat *A,
106  const char *filename,
107  INT size)
108 {
109  INT m = A->ROW;
110  INT n = A->COL;
111  INT nb = A->nb;
112  INT nb2 = nb*nb;
113  INT offset;
114 
115  INT row,col,i, j, k,l, minmn=nb*MIN(m,n);
116  REAL val;
117 
118  if (size>minmn) size=minmn;
119 
120  printf("Writing matrix pattern to `%s'...\n",filename);
121 
122  char *map = (char *)fasp_mem_calloc(size * size, sizeof(char));
123 
124  memset(map, 0x0F, size * size);
125 
126  for ( i = 0; i < size/nb; i++ ) {
127 
128  for ( j = A->IA[i]; j < A->IA[i+1]; j++ ) {
129  for ( k = 0; k < A->nb; k++ ) {
130  for ( l = 0; l < A->nb; l++ ) {
131 
132  row = i*nb + k;
133  col = A->JA[j]*nb + l;
134  val = A->val[ A->JA[j]*nb2 + k*nb + l];
135 
136  if (col<size) {
137 
138  offset = size*row + col;
139 
140  if (map[offset] != 0x0F)
141  map[offset] = 0x0F;
142  else if ( val > 1e-20)
143  map[offset] = 0x09; /* bright blue */
144  else if ( val < -1e-20)
145  map[offset] = 0x0C; /* bright red */
146  else if (val == 0)
147  map[offset] = 0x00; /* bright red */
148  else
149  map[offset] = 0x06; /* brown */
150  } // end if
151  }
152  }
153  }
154  }
155 
156  write_bmp16(filename, size, size, map);
157 
158  fasp_mem_free(map);
159 }
160 
173  INT level)
174 {
175  FILE *datei;
176  char buf[120];
177  INT i;
178  REAL xmid,ymid,xc,yc;
179 
180  sprintf(buf,"Grid_ref_level%d.eps",level);
181  datei = fopen(buf,"w");
182  if(datei==NULL) {
183  printf("Opening file %s fails!\n", buf);
184  return;
185  }
186 
187  fprintf(datei, "%%!PS-Adobe-2.0-2.0 EPSF-2.0\n");
188  fprintf(datei, "%%%%BoundingBox: 0 0 550 550\n");
189  fprintf(datei, "25 dup translate\n");
190  fprintf(datei, "%f setlinewidth\n",0.2);
191  fprintf(datei, "/Helvetica findfont %f scalefont setfont\n",64.0*pow(0.5,level));
192  fprintf(datei, "/b{0 setgray} def\n");
193  fprintf(datei, "/r{1.0 0.6 0.6 setrgbcolor} def\n");
194  fprintf(datei, "/u{0.1 0.7 0.1 setrgbcolor} def\n");
195  fprintf(datei, "/d{0.1 0.1 1.0 setrgbcolor} def\n");
196  fprintf(datei, "/cs{closepath stroke} def\n");
197  fprintf(datei, "/m{moveto} def\n");
198  fprintf(datei, "/l{lineto} def\n");
199 
200  fprintf(datei,"b\n");
201  for(i=0; i<pg->triangles; ++i) {
202  xc = (pg->p[pg->t[i][0]][0]+pg->p[pg->t[i][1]][0]+pg->p[pg->t[i][2]][0])*150.0;
203  yc = (pg->p[pg->t[i][0]][1]+pg->p[pg->t[i][1]][1]+pg->p[pg->t[i][2]][1])*150.0;
204 
205  xmid = pg->p[pg->t[i][0]][0]*450.0;
206  ymid = pg->p[pg->t[i][0]][1]*450.0;
207  fprintf(datei,"%.1f %.1f m ",0.9*xmid+0.1*xc,0.9*ymid+0.1*yc);
208  xmid = pg->p[pg->t[i][1]][0]*450.0;
209  ymid = pg->p[pg->t[i][1]][1]*450.0;
210  fprintf(datei,"%.1f %.1f l ",0.9*xmid+0.1*xc,0.9*ymid+0.1*yc);
211  xmid = pg->p[pg->t[i][2]][0]*450.0;
212  ymid = pg->p[pg->t[i][2]][1]*450.0;
213  fprintf(datei,"%.1f %.1f l ",0.9*xmid+0.1*xc,0.9*ymid+0.1*yc);
214  fprintf(datei,"cs\n");
215  }
216  fprintf(datei,"r\n");
217  for(i=0; i<pg->vertices; ++i) {
218  xmid = pg->p[i][0]*450.0;
219  ymid = pg->p[i][1]*450.0;
220  fprintf(datei,"%.1f %.1f m ",xmid,ymid);
221  fprintf(datei,"(%d) show\n ",i);
222  }
223  fprintf(datei,"u\n");
224  for(i=0; i<pg->edges; ++i) {
225  xmid = 0.5*(pg->p[pg->e[i][0]][0]+pg->p[pg->e[i][1]][0])*450.0;
226  ymid = 0.5*(pg->p[pg->e[i][0]][1]+pg->p[pg->e[i][1]][1])*450.0;
227  fprintf(datei,"%.1f %.1f m ",xmid,ymid);
228  fprintf(datei,"(%d) show\n ",i);
229 
230  xmid = pg->p[pg->e[i][0]][0]*450.0;
231  ymid = pg->p[pg->e[i][0]][1]*450.0;
232  fprintf(datei,"%.1f %.1f m ",xmid,ymid);
233  xmid = pg->p[pg->e[i][1]][0]*450.0;
234  ymid = pg->p[pg->e[i][1]][1]*450.0;
235  fprintf(datei,"%.1f %.1f l ",xmid,ymid);
236  fprintf(datei,"cs\n");
237  }
238  fprintf(datei,"d\n");
239  for(i=0; i<pg->triangles; ++i) {
240  xmid = (pg->p[pg->t[i][0]][0]+pg->p[pg->t[i][1]][0]+pg->p[pg->t[i][2]][0])*150.0;
241  ymid = (pg->p[pg->t[i][0]][1]+pg->p[pg->t[i][1]][1]+pg->p[pg->t[i][2]][1])*150.0;
242  fprintf(datei,"%.1f %.1f m ",xmid,ymid);
243  fprintf(datei,"(%d) show\n ",i);
244  }
245  fprintf(datei, "showpage\n");
246  fclose(datei);
247 }
248 
249 /*---------------------------------*/
250 /*-- Private Functions --*/
251 /*---------------------------------*/
252 
262 static void put_byte (FILE *fp,
263  const INT c)
264 {
265  fputc(c, fp);
266  return;
267 }
268 
278 static void put_word (FILE *fp,
279  const INT w)
280 { /* big endian */
281  put_byte(fp, w);
282  put_byte(fp, w >> 8);
283  return;
284 }
285 
295 static void put_dword (FILE *fp,
296  const INT d)
297 { /* big endian */
298  put_word(fp, d);
299  put_word(fp, d >> 16);
300  return;
301 }
302 
368 static INT write_bmp16 (const char *fname,
369  const INT m,
370  const INT n,
371  const char map[])
372 {
373  FILE *fp;
374  INT offset, bmsize, i, j, b, ret = 1;
375 
376  if (!(1 <= m && m <= 32767))
377  printf("### ERROR: %s invalid height %d\n", __FUNCTION__, m);
378 
379  if (!(1 <= n && n <= 32767))
380  printf("### ERROR: %s invalid width %d\n", __FUNCTION__, n);
381 
382  fp = fopen(fname, "wb");
383  if (fp == NULL) {
384  printf("### ERROR: %s unable to create `%s'\n", __FUNCTION__, fname);
385  ret = 0;
386  goto FINISH;
387  }
388  offset = 14 + 40 + 16 * 4;
389  bmsize = (4 * n + 31) / 32;
390  /* struct BMPFILEHEADER (14 bytes) */
391  /* UINT bfType */ put_byte(fp, 'B'), put_byte(fp, 'M');
392  /* DWORD bfSize */ put_dword(fp, offset + bmsize * 4);
393  /* UINT bfReserved1 */ put_word(fp, 0);
394  /* UNIT bfReserved2 */ put_word(fp, 0);
395  /* DWORD bfOffBits */ put_dword(fp, offset);
396  /* struct BMPINFOHEADER (40 bytes) */
397  /* DWORD biSize */ put_dword(fp, 40);
398  /* LONG biWidth */ put_dword(fp, n);
399  /* LONG biHeight */ put_dword(fp, m);
400  /* WORD biPlanes */ put_word(fp, 1);
401  /* WORD biBitCount */ put_word(fp, 4);
402  /* DWORD biCompression */ put_dword(fp, 0 /* BI_RGB */);
403  /* DWORD biSizeImage */ put_dword(fp, 0);
404  /* LONG biXPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
405  /* LONG biYPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
406  /* DWORD biClrUsed */ put_dword(fp, 0);
407  /* DWORD biClrImportant */ put_dword(fp, 0);
408  /* struct RGBQUAD (16 * 4 = 64 bytes) */
409  /* CGA-compatible colors: */
410  /* 0x00 = black */ put_dword(fp, 0x000000);
411  /* 0x01 = blue */ put_dword(fp, 0x000080);
412  /* 0x02 = green */ put_dword(fp, 0x008000);
413  /* 0x03 = cyan */ put_dword(fp, 0x008080);
414  /* 0x04 = red */ put_dword(fp, 0x800000);
415  /* 0x05 = magenta */ put_dword(fp, 0x800080);
416  /* 0x06 = brown */ put_dword(fp, 0x808000);
417  /* 0x07 = light gray */ put_dword(fp, 0xC0C0C0);
418  /* 0x08 = dark gray */ put_dword(fp, 0x808080);
419  /* 0x09 = bright blue */ put_dword(fp, 0x0000FF);
420  /* 0x0A = bright green */ put_dword(fp, 0x00FF00);
421  /* 0x0B = bright cyan */ put_dword(fp, 0x00FFFF);
422  /* 0x0C = bright red */ put_dword(fp, 0xFF0000);
423  /* 0x0D = bright magenta */put_dword(fp, 0xFF00FF);
424  /* 0x0E = yellow */ put_dword(fp, 0xFFFF00);
425  /* 0x0F = white */ put_dword(fp, 0xFFFFFF);
426  /* pixel data bits */
427  b = 0;
428  for (i = m - 1; i >= 0; i--) {
429  for (j = 0; j < ((n + 7) / 8) * 8; ++j) {
430  b <<= 4;
431  b |= (j < n ? map[i * n + j] & 15 : 0);
432  if (j & 1) put_byte(fp, b);
433  }
434  }
435  fflush(fp);
436 
437  if (ferror(fp)) {
438  printf("### ERROR: %s write error on `%s'\n", __FUNCTION__, fname);
439  ret = 0;
440  }
441 FINISH: if (fp != NULL) fclose(fp);
442  return ret;
443 }
444 
470  const char *fname)
471 {
472  FILE *fp;
473  INT offset, bmsize, i, j, b, ret = 1;
474  INT n,m;
475  INT size;
476  INT nb = A->nb;
477  INT nb2 = nb*nb;
478  INT col,k,l;
479  REAL val;
480 
481  m = A->ROW*A->nb;
482  n = A->COL*A->nb;
483 
484  char *map;
485 
486  size = ( (n+7)/8 )*8;
487 
488  map = (char *)fasp_mem_calloc(size, sizeof(char));
489 
490  memset(map, 0x0F, size);
491 
492  if (!(1 <= m && m <= 32767))
493  printf("### ERROR: %s invalid height %d\n", __FUNCTION__, m);
494 
495  if (!(1 <= n && n <= 32767))
496  printf("### ERROR: %s invalid width %d\n", __FUNCTION__, n);
497 
498  fp = fopen(fname, "wb");
499  if (fp == NULL) {
500  printf("### ERROR: %s unable to create `%s'\n", __FUNCTION__, fname);
501  ret = 0;
502  goto FINISH;
503  }
504 
505  offset = 14 + 40 + 16 * 4;
506  bmsize = (4 * n + 31) / 32;
507  /* struct BMPFILEHEADER (14 bytes) */
508  /* UINT bfType */ put_byte(fp, 'B'), put_byte(fp, 'M');
509  /* DWORD bfSize */ put_dword(fp, offset + bmsize * 4);
510  /* UINT bfReserved1 */ put_word(fp, 0);
511  /* UNIT bfReserved2 */ put_word(fp, 0);
512  /* DWORD bfOffBits */ put_dword(fp, offset);
513  /* struct BMPINFOHEADER (40 bytes) */
514  /* DWORD biSize */ put_dword(fp, 40);
515  /* LONG biWidth */ put_dword(fp, n);
516  /* LONG biHeight */ put_dword(fp, m);
517  /* WORD biPlanes */ put_word(fp, 1);
518  /* WORD biBitCount */ put_word(fp, 4);
519  /* DWORD biCompression */ put_dword(fp, 0 /* BI_RGB */);
520  /* DWORD biSizeImage */ put_dword(fp, 0);
521  /* LONG biXPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
522  /* LONG biYPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
523  /* DWORD biClrUsed */ put_dword(fp, 0);
524  /* DWORD biClrImportant */ put_dword(fp, 0);
525  /* struct RGBQUAD (16 * 4 = 64 bytes) */
526  /* CGA-compatible colors: */
527  /* 0x00 = black */ put_dword(fp, 0x000000);
528  /* 0x01 = blue */ put_dword(fp, 0x000080);
529  /* 0x02 = green */ put_dword(fp, 0x008000);
530  /* 0x03 = cyan */ put_dword(fp, 0x008080);
531  /* 0x04 = red */ put_dword(fp, 0x800000);
532  /* 0x05 = magenta */ put_dword(fp, 0x800080);
533  /* 0x06 = brown */ put_dword(fp, 0x808000);
534  /* 0x07 = light gray */ put_dword(fp, 0xC0C0C0);
535  /* 0x08 = dark gray */ put_dword(fp, 0x808080);
536  /* 0x09 = bright blue */ put_dword(fp, 0x0000FF);
537  /* 0x0A = bright green */ put_dword(fp, 0x00FF00);
538  /* 0x0B = bright cyan */ put_dword(fp, 0x00FFFF);
539  /* 0x0C = bright red */ put_dword(fp, 0xFF0000);
540  /* 0x0D = bright magenta */put_dword(fp, 0xFF00FF);
541  /* 0x0E = yellow */ put_dword(fp, 0xFFFF00);
542  /* 0x0F = white */ put_dword(fp, 0xFFFFFF);
543  /* pixel data bits */
544  b = 0;
545 
547  // for(i=size-1; i>=m; i--){
548  // memset(map, 0x0F, size);
549  // for (j = 0; j < size; ++j) {
550  // b <<= 4;
551  // b |= (j < n ? map[j] & 15 : 0);
552  // if (j & 1) put_byte(fp, b);
553  // }
554  // }
556 
557  for ( i = A->ROW-1; i >=0; i-- ) {
558 
559  for ( k = A->nb-1; k >=0; k-- ) {
560 
561  memset(map, 0x0F, size);
562 
563  for ( j = A->IA[i]; j < A->IA[i+1]; j++ ) {
564  for ( l = 0; l < A->nb; l++ ) {
565 
566  col = A->JA[j]*nb + l;
567  val = A->val[ A->JA[j]*nb2 + k*nb + l];
568 
569  if (map[col] != 0x0F)
570  map[col] = 0x0F;
571  else if ( val > 1e-20)
572  map[col] = 0x09; /* bright blue */
573  else if ( val < -1e-20)
574  map[col] = 0x0C; /* bright red */
575  else if (val == 0)
576  map[col] = 0x00; /* bright red */
577  else
578  map[col] = 0x06; /* brown */
579  } // for l
580  } // for j
581 
582 
583  for (j = 0; j < size; ++j) {
584  b <<= 4;
585  b |= (j < n ? map[j] & 15 : 0);
586  if (j & 1) put_byte(fp, b);
587  }
588 
589  }
590  }
591 
592  fflush(fp);
593  if (ferror(fp)) {
594  printf("### ERROR: %s write error on `%s'\n", __FUNCTION__, fname);
595  ret = 0;
596  }
597 FINISH: if (fp != NULL) fclose(fp);
598 
599  fasp_mem_free(map);
600 
601  return ret;
602 }
603 
629  const char *fname)
630 {
631  FILE *fp;
632  INT offset, bmsize, i, j, b, ret = 1;
633  INT n,m;
634  INT size;
635 
636  INT col;
637  REAL val;
638 
639  m = A->row;
640  n = A->col;
641 
642  char *map;
643 
644  size = ( (n+7)/8 )*8;
645 
646  map = (char *)fasp_mem_calloc(size, sizeof(char));
647 
648  memset(map, 0x0F, size);
649 
650  if (!(1 <= m && m <= 32767))
651  printf("### ERROR: %s invalid height %d\n", __FUNCTION__, m);
652 
653  if (!(1 <= n && n <= 32767))
654  printf("### ERROR: %s invalid width %d\n", __FUNCTION__, n);
655 
656  fp = fopen(fname, "wb");
657  if (fp == NULL) {
658  printf("### ERROR: %s unable to create `%s'\n", __FUNCTION__, fname);
659  ret = 0;
660  goto FINISH;
661  }
662 
663  offset = 14 + 40 + 16 * 4;
664  bmsize = (4 * n + 31) / 32;
665  /* struct BMPFILEHEADER (14 bytes) */
666  /* UINT bfType */ put_byte(fp, 'B'), put_byte(fp, 'M');
667  /* DWORD bfSize */ put_dword(fp, offset + bmsize * 4);
668  /* UINT bfReserved1 */ put_word(fp, 0);
669  /* UNIT bfReserved2 */ put_word(fp, 0);
670  /* DWORD bfOffBits */ put_dword(fp, offset);
671  /* struct BMPINFOHEADER (40 bytes) */
672  /* DWORD biSize */ put_dword(fp, 40);
673  /* LONG biWidth */ put_dword(fp, n);
674  /* LONG biHeight */ put_dword(fp, m);
675  /* WORD biPlanes */ put_word(fp, 1);
676  /* WORD biBitCount */ put_word(fp, 4);
677  /* DWORD biCompression */ put_dword(fp, 0 /* BI_RGB */);
678  /* DWORD biSizeImage */ put_dword(fp, 0);
679  /* LONG biXPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
680  /* LONG biYPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
681  /* DWORD biClrUsed */ put_dword(fp, 0);
682  /* DWORD biClrImportant */ put_dword(fp, 0);
683  /* struct RGBQUAD (16 * 4 = 64 bytes) */
684  /* CGA-compatible colors: */
685  /* 0x00 = black */ put_dword(fp, 0x000000);
686  /* 0x01 = blue */ put_dword(fp, 0x000080);
687  /* 0x02 = green */ put_dword(fp, 0x008000);
688  /* 0x03 = cyan */ put_dword(fp, 0x008080);
689  /* 0x04 = red */ put_dword(fp, 0x800000);
690  /* 0x05 = magenta */ put_dword(fp, 0x800080);
691  /* 0x06 = brown */ put_dword(fp, 0x808000);
692  /* 0x07 = light gray */ put_dword(fp, 0xC0C0C0);
693  /* 0x08 = dark gray */ put_dword(fp, 0x808080);
694  /* 0x09 = bright blue */ put_dword(fp, 0x0000FF);
695  /* 0x0A = bright green */ put_dword(fp, 0x00FF00);
696  /* 0x0B = bright cyan */ put_dword(fp, 0x00FFFF);
697  /* 0x0C = bright red */ put_dword(fp, 0xFF0000);
698  /* 0x0D = bright magenta */put_dword(fp, 0xFF00FF);
699  /* 0x0E = yellow */ put_dword(fp, 0xFFFF00);
700  /* 0x0F = white */ put_dword(fp, 0xFFFFFF);
701  /* pixel data bits */
702  b = 0;
703 
705  // for(i=((m+7)/8)*8 - 1; i>=m; i--){
706  // memset(map, 0x0F, size);
707  // for (j = 0; j < size; ++j) {
708  // b <<= 4;
709  // b |= (j < n ? map[j] & 15 : 0);
710  // if (j & 1) put_byte(fp, b);
711  // }
712  // }
714 
715  for ( i = A->row-1; i >=0; i-- ) {
716  memset(map, 0x0F, size);
717 
718  for ( j = A->IA[i]; j < A->IA[i+1]; j++ ) {
719  col = A->JA[j];
720  val = A->val[j];
721  if (map[col] != 0x0F)
722  map[col] = 0x0F;
723  else if ( val > 1e-20)
724  map[col] = 0x09; /* bright blue */
725  else if ( val < -1e-20)
726  map[col] = 0x0C; /* bright red */
727  else if (val == 0)
728  map[col] = 0x00; /* bright red */
729  else
730  map[col] = 0x06; /* brown */
731  } // for j
732 
733  for (j = 0; j < size; ++j) {
734  b <<= 4;
735  b |= (j < n ? map[j] & 15 : 0);
736  if (j & 1) put_byte(fp, b);
737  }
738  }
739 
740  fflush(fp);
741  if (ferror(fp)) {
742  printf("### ERROR: %s write error on `%s'\n", __FUNCTION__, fname);
743  ret = 0;
744  }
745 FINISH: if (fp != NULL) fclose(fp);
746 
747  fasp_mem_free(map);
748 
749  return ret;
750 }
751 
752 /*---------------------------------*/
753 /*-- End of File --*/
754 /*---------------------------------*/
INT * JA
integer array of column indexes, the size is nnz
Definition: fasp.h:163
#define REAL
Definition: fasp.h:67
void fasp_dcsr_subplot(const dCSRmat *A, const char *filename, INT size)
Write sparse matrix pattern in BMP file format.
Definition: graphics.c:44
INT nb
dimension of each sub-block
Definition: fasp_block.h:56
REAL * val
nonzero entries of A
Definition: fasp.h:166
REAL(* p)[2]
Definition: fasp.h:1129
Block sparse row storage matrix of REAL type.
Definition: fasp_block.h:44
void * fasp_mem_calloc(LONGLONG size, INT type)
1M = 1024*1024
Definition: memory.c:60
INT(* e)[2]
Definition: fasp.h:1130
#define INT
Definition: fasp.h:64
void fasp_mem_free(void *mem)
Free up previous allocated memory body.
Definition: memory.c:150
REAL * val
Definition: fasp_block.h:67
INT vertices
Definition: fasp.h:1140
INT fasp_dcsr_plot(const dCSRmat *A, const char *fname)
Write dCSR sparse matrix pattern in BMP file format.
Definition: graphics.c:628
INT col
column of matrix A, n
Definition: fasp.h:154
Main header file for FASP.
INT fasp_dbsr_plot(const dBSRmat *A, const char *fname)
Write dBSR sparse matrix pattern in BMP file format.
Definition: graphics.c:469
INT row
row number of matrix A, m
Definition: fasp.h:151
Sparse matrix of REAL type in CSR format.
Definition: fasp.h:148
INT COL
number of cols of sub-blocks in matrix A, N
Definition: fasp_block.h:50
INT edges
Definition: fasp.h:1141
#define MIN(a, b)
Definition: fasp.h:73
INT triangles
Definition: fasp.h:1142
INT ROW
number of rows of sub-blocks in matrix A, M
Definition: fasp_block.h:47
INT * JA
Definition: fasp_block.h:74
Two dimensional grid data structure.
Definition: fasp.h:1127
INT * IA
integer array of row pointers, the size is m+1
Definition: fasp.h:160
INT * IA
integer array of row pointers, the size is ROW+1
Definition: fasp_block.h:70
void fasp_dbsr_subplot(const dBSRmat *A, const char *filename, INT size)
Write sparse matrix pattern in BMP file format.
Definition: graphics.c:105
INT(* t)[3]
Definition: fasp.h:1131
void fasp_grid2d_plot(pgrid2d pg, INT level)
Output grid to a EPS file.
Definition: graphics.c:172