~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/file/matrix/matrix_w.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2   */
  3 #include <stdio.h>
  4 #include <math.h>
  5 #include <tina/sys.h>
  6 #include <tina/sysfuncs.h>
  7 #include <tina/math.h>
  8 
  9 void    dmatrix_write_fp(FILE * fp, Matrix * a, int log)
 10 {
 11     int     i, j;
 12 
 13     if (log)
 14     {
 15         for (i = 0; i < a->m; i++)
 16         {
 17             for (j = 0; j < a->n; j++)
 18                 if (a->el.double_v[i][j] >= 0)
 19                     (void) fprintf(fp, "%7.2f ", log10(1.0 + a->el.double_v[i][j]));
 20                 else
 21                     (void) fprintf(fp, "%7.2f ", -log10(1.0 - a->el.double_v[i][j]));
 22             (void) fprintf(fp, "\n");
 23         }
 24     } else
 25     {
 26         for (i = 0; i < a->m; i++)
 27         {
 28             for (j = 0; j < a->n; j++)
 29                 (void) fprintf(fp, "%f ", a->el.double_v[i][j]);
 30             (void) fprintf(fp, "\n");
 31         }
 32     }
 33 }
 34 
 35 void    dmatrix_write(char *file, Matrix * a, char *mname, int log)
 36 {
 37     FILE   *fp;
 38     Matrix *matrix_prod();
 39 
 40     if (a == NULL)
 41     {
 42         error(" NUll matrix passed to printmat \n", non_fatal);
 43         return;
 44     }
 45     if ((fp = fopen(file, "w")) == NULL)
 46         fp = stdout;
 47     (void) fprintf(fp, "%s\n", mname);
 48     dmatrix_write_fp(fp, a, log);
 49     if (fp != stdout)
 50         (void) fclose(fp);
 51 }
 52 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.